Job ticket construction method, device, electronic device and storage medium

By generating hypertext markup language and JSON format data, the problems of poor universality and flexibility of existing job ticket form design are solved, and flexible and efficient job ticket form construction and customization are realized, reducing development costs and simplifying maintain.

CN118862851BActive Publication Date: 2025-02-21SUZHOU LONGXIN INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410828026.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2025-02-21
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

The design of existing work ticket forms is poor, the development workload is large, the investment cost is high, the maintenance is difficult, and the flexibility is poor, making it difficult to meet customized needs.

Method used

By obtaining the form components of the user-configured job ticket template, generate hypertext markup language (HTML) and JSON format data, and using the browser/server B/S architecture model to achieve fast and flexible job ticket style design and customization.

Benefits of technology

It realizes flexible and efficient work ticket form construction, reduces development costs, improves the flexibility and practicality of work ticket form, and simplifies post-maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118862851B_ABST
    Figure CN118862851B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method, device, electronic device and storage medium for constructing a job ticket, the method comprising: obtaining a form component of a job ticket template configured by a user; generating a hypertext markup language of the job ticket template based on the form component; generating JSON format data of the job ticket template based on the hypertext markup language, so as to restore the JSON format data into a job ticket form after the user selects the job ticket template. The browser / server B / S architecture mode is adopted, and the job ticket style design operation is quickly performed using a WEB browser, which can simply, quickly, flexibly and effectively meet the preset customization requirements of various job tickets, and finally achieve a job ticket construction and use solution with high flexibility, strong practicality and low development cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for constructing a job ticket. Background Art

[0002] A work permit is a written document that must be held when performing dangerous work or work that requires special permission in certain specific fields, such as electricity, chemicals, and construction. It usually contains detailed information about the work, safety measures, and the signature of the person in charge to ensure the safety and compliance of the work.

[0003] With the diversification of work ticket type design and the demand for content design tending towards customization, the current design of work ticket forms is greatly affected by the customization of market demand. The traditional work ticket form design is mainly customized for each type, which leads to poor versatility of work ticket forms, large development workload, high investment cost, and difficulty in later maintenance. Moreover, each work ticket form needs to be designed separately, resulting in poor flexibility in the design of work ticket forms. There is an urgent need for a solution for work ticket form design with high flexibility and strong practicality. Summary of the invention

[0004] One purpose of the present application is to propose a method, device, electronic device and storage medium for constructing a job ticket, which can flexibly and efficiently construct a job ticket form.

[0005] According to one aspect of an embodiment of the present application, a method for constructing a job ticket is disclosed, the method comprising: obtaining a form component of a job ticket template configured by a user; generating a hypertext markup language of the job ticket template based on the form component; generating JSON format data of the job ticket template based on the hypertext markup language, so as to restore the JSON format data into a job ticket form after the user selects the job ticket template.

[0006] As in an embodiment of the present invention, after generating the JSON format data of the job ticket template based on the hypertext markup language, the method further includes: judging whether the job ticket template exists in the template set based on the input value of the template code in the JSON format data, and giving a prompt based on the result; or judging whether the job ticket template exists in the template set after filtering out the label and label remark information of the form component in the JSON format data, and giving a prompt based on the result.

[0007] As in an embodiment of the present invention, obtaining the form component of the job ticket template configured by the user includes: obtaining the form component of the job ticket template configured by the user through the front-end drag technology and the custom encapsulated function.

[0008] As in an embodiment of the present invention, the method also includes: generating JSON format data of the job ticket template based on the hypertext markup language, including: using a processing function to generate JSON format data of a multi-layer nested array object of the job ticket template from the hypertext markup language based on extraction rules.

[0009] As in an embodiment of the present invention, a processing function is used to generate JSON format data of a multi-layer nested array object of the job ticket template from the hypertext markup language based on extraction rules, including: using a processing function to find the nested relationship in the hypertext markup language, extracting the attribute information of the label of each level as the key value of the attribute key name of the object element corresponding to each level, so as to generate JSON format data of the multi-layer nested array object.

[0010] As in an embodiment of the present invention, the method further includes: obtaining a job ticket template selected by a user from a template collection; and using a restoration function to reversely restore the JSON format data of the job ticket template into a job ticket form based on the extraction rule.

[0011] As in an embodiment of the present invention, a restoration function is utilized to reversely restore the JSON format data of the job ticket template into a job ticket form based on the extraction rule, including: converting the JSON format data of the multi-layer nested array object into array data that can be traversed in a loop; traversing the array data in a loop, and determining whether the key value length of the current object element meets a length threshold; when the length threshold is met, generating corresponding hypertext markup language tags for the attribute information of the sub-object elements in each layer of the array; when the length threshold is not met, exiting the loop traversal, and appending the generated hypertext markup language tag string to the specified tag element.

[0012] As in the embodiment of the present invention, the method further includes: obtaining a form component value input by a user in the job ticket form, and storing the form component value and the form component in a key-value pair manner.

[0013] As in the embodiment of the present invention, the JSON format data includes: the identification of the form component, the tag name, the tag type, and the tag order.

[0014] According to one aspect of an embodiment of the present application, a job ticket construction device is disclosed, the device comprising: a component acquisition module, configured to acquire a form component of a job ticket template configured by a user; a first generation module, configured to generate a hypertext markup language of the job ticket template based on the form component; and a second generation module, configured to generate JSON format data of the job ticket template based on the hypertext markup language, so as to restore the JSON format data into a job ticket form after the user selects the job ticket template.

[0015] As in an embodiment of the present invention, the device also includes a model judgment module, which is configured to judge whether the job ticket template exists in the template collection based on the input value of the template code in the JSON format data, and to give a prompt based on the result; or to judge whether the job ticket template exists in the template collection after filtering out the label and label comment information of the form component in the JSON format data, and to give a prompt based on the result.

[0016] As in the embodiment of the present invention, the component acquisition module is configured to acquire the form component of the job ticket template configured by the user through the front-end drag technology and the custom encapsulated function.

[0017] As in the embodiment of the present invention, the second generating module is configured to generate JSON format data of the job ticket template from the hypertext markup language based on the extraction rules using a processing function.

[0018] As in an embodiment of the present invention, the device also includes: a template selection module, configured to obtain a job ticket template selected by a user from a template collection; and a form restoration module, configured to use a restoration function to reversely restore the JSON format data of the job ticket template into a job ticket form based on the extraction rules.

[0019] As in the embodiment of the present invention, the device further includes: a form storage module configured to obtain the form component value input by the user in the job ticket form, and store the form component value and the form component in a key-value pair manner.

[0020] In an exemplary embodiment of the present application, the JSON format data includes: an identifier of the form component, a tag name, a tag type, and a tag order.

[0021] According to one aspect of an embodiment of the present application, an electronic device is disclosed, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the methods provided in the above-mentioned various optional implementation modes.

[0022] According to one aspect of an embodiment of the present application, a computer program medium is disclosed, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the methods provided in the various optional implementations described above.

[0023] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above various optional implementations.

[0024] In the embodiment of the present invention, the form component of the job ticket template configured by the user is obtained; the hypertext markup language of the job ticket template is generated based on the form component; the JSON format data of the job ticket template is generated based on the hypertext markup language, so that after the user selects the job ticket template, the JSON format data is restored to the job ticket form. The browser / server B / S architecture mode is adopted, and the job ticket style design operation is quickly performed using a WEB browser, which simply, quickly, flexibly and effectively meets the preset customization requirements of various job tickets, and finally achieves a work ticket construction and use solution with high flexibility, strong practicality and low development cost.

[0025] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0026] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The above and other objects, features and advantages of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.

[0028] Figure 1 A flow chart of the job ticket construction method provided in the present application is shown.

[0029] Figure 2 Another flow chart of the job ticket construction method provided by the present application is shown.

[0030] Figure 3 A schematic diagram of a work ticket template that is higher than a safety work permit provided in an embodiment of the present invention.

[0031] Figure 4 Another flow chart of the job ticket construction method provided in the present application is shown.

[0032] Figure 5 Another flow chart of the job ticket construction method provided in the present application is shown.

[0033] Figure 6 A block diagram of a job ticket construction device according to an embodiment of the present application is shown.

[0034] Figure 7 A hardware diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0035] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present application will be more comprehensive and complete and the concepts of the example embodiments will be fully conveyed to those skilled in the art. The accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0036] In addition, the described features, structures or characteristics may be combined in one or more example embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the example embodiments of the present application. However, those skilled in the art will appreciate that the technical solution of the present application may be practiced while omitting one or more of the specific details, or other methods, components, steps, etc. may be adopted. In other cases, known structures, methods, implementations or operations are not shown or described in detail to avoid obscuring the present application and making the various aspects of the present application obscure.

[0037] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0038] The proposed method for constructing a work ticket in an embodiment of the present invention takes the variability of work ticket style requirements as a starting point, utilizes HTML5+CSS3+JS technology, adopts the B / S architecture mode, and uses a WEB browser to quickly, effectively, and flexibly design the work ticket style, ultimately meeting the customization requirements of various work tickets. HTML5, CSS3, and JavaScript are the core technologies for building modern Web applications. HTML5 is used to build the page structure, CSS3 is used to design the style, and JavaScript can realize the interactive function. The B / S (Browser / Server) architecture mode refers to the client using a browser as a user interface, while the server is responsible for processing the business logic and data storage of the application.

[0039] The following is a detailed description of the job ticket construction method proposed in the embodiment of the present invention in conjunction with a specific embodiment.

[0040] Figure 1 The flowchart of the method for constructing a job ticket provided by the present application is shown. The execution subject of the method can be any terminal with computing and processing functions, such as a server. The server is loaded with a system for implementing the method for constructing a job ticket, such as Figure 1 As shown, the method may include but is not limited to the following steps:

[0041] Step S110: Obtain the form component of the job ticket template configured by the user.

[0042] In an embodiment of the present invention, the job ticket template can be divided into a fixed part and a configuration part. The fixed part can include information such as the template code and the template name. The form component of the user-configured job ticket template can include all form components of the user-configured fixed part and the configuration part.

[0043] In an embodiment of the present invention, the form component of the user-configured job ticket template can be obtained through the front-end drag technology and the custom encapsulated function. Before configuration, a variety of form elements of the job ticket can be pre-set. The form element can be a plain text box, a pure multi-line text box, a pure date and time, etc. for inputting content. After setting a variety of form elements, each form element is pre-encapsulated into a custom component function to form a form component. For example, the form component can be a plain text box, a pure multi-line text box, a pure date and time, etc., which can be dragged and added in the configuration interface. After the form component is set, the front-end drag technology combined with the custom encapsulated function can be used to obtain the form component configured by the user on the Web browser, for example, dynamically drag and add, edit and delete form components in the job ticket template.

[0044] Step S120: Generate a hypertext markup language of the job ticket template based on the form component.

[0045] In the embodiment of the present invention, the front-end drag-and-drop technology is combined with a custom encapsulated function to obtain the form components configured by the user on the web browser and generate the hypertext markup language HTML5 of the job ticket template. All form components in the HTML5 have their own unique identification ID, tag name, custom attribute value and other tags.

[0046] Step S130: Generate JSON format data of the job ticket template based on the hypertext markup language, so as to restore the JSON format data into a job ticket form after the user selects the job ticket template.

[0047] In an embodiment of the present invention, when executing a save operation, the processing function can be used to generate the JSON format data of the job ticket template from the hypertext markup language based on the extraction rules. The processing function can extract and sort the form components according to the properties of the above-mentioned form components, generate a job ticket template in a JSON string format with regularity and hierarchical relationship, and the job ticket template can be selected by the user, and after the user selects, the JSON format data is restored to the job ticket form.

[0048] In the embodiment of the present invention, the JSON format data of the generated job ticket template is a composite type of data, and its outermost format is an array format, and the array contains multi-layer objects and arrays. The data storage in the object format may include the ID number (with uniqueness), label type, label name, and label order of the form component, but the present invention is not limited to this, for example, it may also include label prompt text, label combination number, whether it is required to fill in the mark, placeholder size, parent element unique number, parent element combination number, child element array set, etc. Therefore, the JSON string format data may include the mark, label name, label type, and label order of the form component, but the present invention is not limited to this, for example, it may also include label remarks, label order, child elements (not fixed), parent unique identification ID (not fixed), parent label order (not fixed), label configuration items (not fixed), and other configuration items.

[0049] In an embodiment of the present invention, when generating JSON format data of a multi-layer nested array object, a processing function can be used to find the nested relationship in the hypertext markup language, and the attribute information of the label of each level is extracted as the key value of the attribute key name of the object element corresponding to each level, so as to generate JSON format data of a multi-layer nested array object. Among them, the nested relationship is also the parent-child relationship of the label, which means that other elements are nested in a double label, then the elements nested therein are equivalent to child elements, and the outer elements are equivalent to parent elements. If the child element also includes the child element of the child element, then the child element of the child element can be called the grandchild element of the parent element of the child element.

[0050] In the embodiment of the present invention, the processing function first searches for a tag (parent tag) with a custom style name of formParent in the hypertext markup language, and then searches for all tags (child tags) with a custom style name of formChild in the formParent tag, thereby finding the nested relationship, and then extracts the attribute information of the tags at each level as the key value of the attribute key name of the object element corresponding to each level, so as to generate JSON format data of a multi-layer nested array object.

[0051] First, a child object element in the JSON format array data is generated according to each child tag, that is, a child object element in the JSON format array data is generated according to a formChild tag. Then, the attribute information of the tag at each level is extracted as the key value of the attribute key name of the object element corresponding to each level, wherein the attribute information may include but is not limited to ID, tag order, parent ID information, and the attribute key name of the object element may be: id, dataIndex, dataParentid key name. After finding the nested relationship, the ID, tag order, and parent ID information of the tag at each level are extracted as the key value of the id, dataIndex, and dataParentid key name of the object element at this level. For example, according to the ID, tag order, and parent ID information of the formChild tag, the key values ​​corresponding to the id, dataIndex, and dataParentid key names of the child object element are extracted. The key value corresponding to the children key name of the child object element stores the tag type, NAME, ID, custom style name, tag order, parent ID and other information of the form element tag in the formChild tag, and the corresponding children key value of the child object element stores the tagType, name, id, dataClass, dataIndex, dataParentid and other information of the grandchild element. Thus, JSON format data of multi-layer nested array objects is generated.

[0052] In an embodiment of the present invention, after executing the save operation to generate the JSON format data of the job ticket template, the system can also determine whether the template already exists in the template collection, and prompt according to the determination result. In an embodiment of the present invention, two methods are provided to determine whether the template already exists in the template collection, and one method can be selected for determination in actual application.

[0053] One is to determine whether the job ticket template exists in the template collection based on the input value of the template code in the JSON format data, and prompt according to the result. This method directly judges the input value of the template code. If it exists, the input box corresponding to the template code will be marked in red and prompted "Template code already exists". If it does not exist, the JSON format data of the job ticket template will be saved in the template collection.

[0054] The other is to filter out the labels and label remark information of the form components in the JSON format data, then determine whether the job ticket template exists in the template collection, and give a prompt based on the result. It should be pointed out that the labels and label remark information of the form components in the JSON format data include but are not limited to: the unique identification ID of all form components, label remark, and parent unique identification ID (not fixed) information. Determine whether the filtered data exists in the template collection. If it does exist, a window will pop up to prompt "Addition failed, template code already exists". If it does not exist, the JSON format data of the job ticket template will be saved in the template collection.

[0055] In the embodiment of the present invention, after the JSON format data of the job ticket template is generated from the hypertext markup language, the JSON format data can also be restored to the job ticket form after the user selects the job ticket template.

[0056] Figure 2 Another flowchart of the method for constructing a job ticket provided by the present application is shown. After generating the JSON format data of the job ticket template, the method may also include but is not limited to the following steps:

[0057] Step S210: Obtain the job ticket template selected by the user from the template set.

[0058] In the embodiment of the present invention, required job ticket template information can be selected from the job ticket template set.

[0059] Step S220: using a restoration function to reversely restore the JSON format data of the job ticket template into a job ticket form based on the extraction rules.

[0060] In the embodiment of the present invention, after selecting the job ticket template information, the restoration function can be used to restore the JSON format data stored in the selected job ticket template to the job ticket form style, and the user can then complete the job ticket form information according to the actual content. When restoring, the restoration function can reverse the JSON string job ticket form information according to the extraction rule of the processing function, that is, restore the JSON string to Hypertext Markup Language.

[0061] In an embodiment of the present invention, when the JSON format data of the job ticket template is reversely restored to the job ticket form based on the extraction rule by using the restoration function, the JSON format data of the multi-layer nested array object can be converted into array data that can be traversed in a loop by using the restoration function. Then the array data is traversed in a loop, and it is determined whether the key value length of the current object element meets the length threshold. When the length threshold is met, the attribute information of the sub-object element in each layer of the array is generated into a corresponding hypertext markup language tag. When the length threshold is not met, the loop traversal is jumped out, and the generated hypertext markup language tag string is appended to the specified tag element.

[0062] In an embodiment of the present invention, a restore function is first used to convert the JSON format data of a multi-layer nested array object into array data that can be traversed in a loop. Then, each layer of data is traversed in a loop. When traversing, the attribute information of the sub-object elements in each layer of the array can be used to generate corresponding hypertext markup language tags in order from low to high levels. For example, the first layer of the array is traversed first, and the corresponding hypertext markup language tags are generated according to the id, dataIndex, and dataParentid of the sub-object elements in the first layer of the array. While traversing in a loop, it is determined whether the length of the children key value of the current object meets the length threshold. If it meets the length threshold, the children key value is traversed in a loop, and then the corresponding hypertext markup language tag is generated according to tagType, name, id, dataClass, dataIndex, and dataParentid. If it does not meet the length threshold, the loop is exited and the generated hypertext markup language tag string is appended to the specified tag element.

[0063] In the embodiment of the present invention, the form component of the job ticket template configured by the user is obtained; the hypertext markup language of the job ticket template is generated based on the form component; the JSON format data of the job ticket template is generated based on the hypertext markup language, so that after the user selects the job ticket template, the JSON format data is restored to the job ticket form. The browser / server B / S architecture mode is adopted, and the job ticket style design operation is quickly performed using a WEB browser, which simply, quickly, flexibly and effectively meets the preset customization requirements of various job tickets, and finally achieves a work ticket construction and use solution with high flexibility, strong practicality and low development cost.

[0064] In the embodiment of the present invention, after the form is restored to the work ticket form, the user can perform assignment operations on the form components. Based on this, the embodiment can also include the following steps:

[0065] Step S230, obtaining the form component value input by the user in the job ticket form, and storing the form component value and the form component in a key-value pair.

[0066] In the embodiment of the present invention, the user can input form component values ​​in the job ticket form according to the actual job situation. Figure 3 A schematic diagram of a work ticket template that is higher than a safety work permit provided by an embodiment of the present invention, such as Figure 3 As shown, if the user fills in the form, the job ticket form can be completed.

[0067] In an embodiment of the present invention, after the user fills out the job ticket form, a save operation can be performed to store the form component values ​​and the form components in a key-value pair format, and the job ticket can be stored in the system, thereby completing the addition of job ticket information data.

[0068] In an embodiment of the present invention, when a job ticket form is added and stored after editing, the JSON data of the form component value and the JSON data of the form component are stored in a key-value pair. The JSON string of the form component value contains the identifier, tag name, tag type, and tag order of each form component, but the present invention is not limited to this. For example, it can also include tag notes, child elements (not fixed), parent unique identification ID (not fixed), parent tag order (not fixed), tag configuration items (not fixed) and other information.

[0069] In an embodiment of the present invention, there is a job ticket status field in the job ticket information, and the job ticket status may include but is not limited to "pending approval, pending completion, completed, in progress, and invalidated". When the job ticket information status is updated to "completed" or "invalidated", the system automatically moves the current job ticket information to the job ticket history information module for subsequent search and use. When searching and using it later, it involves restoring the JSON format data to the job ticket form. Since the processing function is used to store the form component values ​​and the form components in the JSON data as key-value pairs based on the extraction rules, the restoration function can be used to reversely restore the JSON string to Hypertext Markup Language according to the extraction rules of the processing function.

[0070] It should be pointed out that there can be two data conversions in the embodiment of the present invention. The first is when the job ticket template is saved, the form components in the job ticket template are converted from hypertext markup language to JSON format data using a processing function. The second is when the user fills in the job ticket form and saves the job ticket form, the various form components in the job ticket form and the corresponding form component values ​​are converted from hypertext markup language to JSON format data using a processing function. Correspondingly, there can be two data restorations in the present application. Both data restorations use a restoration function based on the extraction rules of the processing function to reversely restore the JSON format data to the job ticket form (hypertext markup language).

[0071] It should be noted that in the two data conversions, the second data conversion has more correspondence between the form component values ​​filled in by the user and the form components than the first data conversion. There are also some correspondences between the form component values ​​and the form components in the first data conversion, for example, Figure 3 The correspondence between the form components marked with circles and their corresponding form component values ​​"application units". The second data conversion includes not only the data in the first data conversion, but also Figure 3 The correspondence between the form components marked with circles and the form component values, such as "XXX".

[0072] In the embodiment of the present invention, the form component of the job ticket template configured by the user is obtained; the hypertext markup language of the job ticket template is generated based on the form component; the JSON format data of the job ticket template is generated based on the hypertext markup language, so that after the user selects the job ticket template, the JSON format data is restored to the job ticket form. The browser / server B / S architecture mode is adopted, and the job ticket style design operation is quickly performed using a WEB browser, which simply, quickly, flexibly and effectively meets the preset customization requirements of various job tickets, and finally achieves a work ticket construction and use solution with high flexibility, strong practicality and low development cost.

[0073] The following is an overall description of the method for constructing a job ticket in an embodiment of the present invention in conjunction with a specific embodiment. Figure 4 Another flow chart of the method for constructing a job ticket provided by the present application is shown in FIG. Figure 4 As shown, the method may include but is not limited to the following process:

[0074] In S401, the job ticket system is started.

[0075] In S402, a adding / editing operation is performed, the form component of the job ticket template configured by the user is obtained through the front-end drag-and-drop technology and the custom encapsulated function, and the hypertext markup language of the job ticket template is generated based on the form component.

[0076] In S403, a saving operation is performed to generate JSON format data of the job ticket template based on the hypertext markup language.

[0077] In S404, it is determined whether the job ticket template already exists.

[0078] In S405, if it does not exist, the JSON format data of the job ticket template is stored in the template collection.

[0079] It should be noted that if the template exists, you can enter the job ticket template and continue editing the template.

[0080] In S406, the job ticket template selected by the user from the template set is obtained.

[0081] In S407, the JSON format data of the job ticket template is reversely restored into a job ticket form based on the extraction rule using a restoration function.

[0082] In S408, the form component values ​​input by the user in the job ticket form are obtained, and the form component values ​​and the form components are stored in a key-value pair to generate and save the job ticket form.

[0083] In S409, the status of the job ticket form is updated according to the user operation.

[0084] There is a job ticket status field in the job ticket information, and the job ticket status may include but is not limited to "pending approval, pending completion, completed, in progress, and invalidated." The status of the job ticket form can be updated according to user operations.

[0085] In S410, the job ticket information whose status is updated to "completed" or "invalidated" is moved to the job ticket history information module for subsequent search and use.

[0086] It should be pointed out that this operation is automatically run by the system, and the execution order of this step can be before or after any step in the entire process.

[0087] In the embodiment of the present invention, the form component of the job ticket template configured by the user is obtained; the hypertext markup language of the job ticket template is generated based on the form component; the JSON format data of the job ticket template is generated based on the hypertext markup language, so that after the user selects the job ticket template, the JSON format data is restored to the job ticket form. The browser / server B / S architecture mode is adopted, and the job ticket style design operation is quickly performed using a WEB browser, which simply, quickly, flexibly and effectively meets the preset customization requirements of various job tickets, and finally achieves a work ticket construction and use solution with high flexibility, strong practicality and low development cost.

[0088] Figure 5 Another flow chart of the method for constructing a job ticket provided by the present application is shown in FIG. Figure 5 As shown, the method may include but is not limited to the following process:

[0089] S501, start the job ticket system.

[0090] S502, enter the job ticket template management module.

[0091] S503, execute adding / editing.

[0092] S504. Customize the configuration of the job ticket template style.

[0093] In an embodiment of the present invention, the markup code and style code of each form element are preset in the system. Through the front-end drag-and-drop technology combined with the custom encapsulated function, a regular hypertext markup language, that is, HTML5 code, can be generated. All form elements in the code have their own unique identification ID, style name, custom attribute value and other tags. The processing function in the data processing module then extracts and sorts out the above-mentioned tags to generate a regular and hierarchical JSON string. The individual form elements in the JSON string have unique identification ID, tag name, tag type, tag remarks, tag order, child elements (not fixed), parent unique identification ID (not fixed), parent tag order (not fixed), tag configuration items (not fixed) and other configuration items.

[0094] S505: Execute saving.

[0095] The outermost format of the composite data is an array format, which contains multiple layers of objects and arrays. The data in the object format includes the ID number (unique) of the form element, the label type, the label name, the label prompt text, the label combination number, the required mark, the placeholder size, the parent element unique number, the parent element combination number, the child element array collection, etc. When performing the save operation, the system will automatically convert the composite data collection into JSON format data and store it. The job ticket template data is saved successfully.

[0096] S506: Determine whether there is a customized job ticket template.

[0097] If the judgment result is yes, return to S504, if the judgment result is no, execute S507.

[0098] In the embodiments of the present invention, at least two methods of judgment can be provided. The first method is to directly judge the input value of the template code. If it already exists, the input box corresponding to the template code will be marked in red and a prompt "Template code already exists" will be displayed. The second method is to filter out the unique identification ID, label remarks, parent unique identification ID (not fixed) and other information of all elements from the automatically generated JSON string, and finally compare and judge with the existing data in the database. If there is a duplicate, a pop-up window will pop up to prompt "Addition failed, template code already exists".

[0099] S507: The data processing module generates JSON format data from the job ticket form information.

[0100] In an embodiment of the present invention, when the job ticket information management module adds, edits and stores, the JSON data of the form element value and the JSON data of the form element template value are stored. The JSON string of the form element template value contains the unique identification ID, label name, label type, label remark, label order, child element (not fixed), parent unique identification ID (not fixed), parent label order (not fixed), label configuration item (not fixed) and other information of each form element. Therefore, the restoration function in the data processing module can reversely restore the JSON string to Hypertext Markup Language according to the extraction rules of the processing function. Finally, the label of the generated form element is assigned according to the JSON data of the form element value.

[0101] S508. The job ticket template information is saved successfully.

[0102] S509, execute the job ticket.

[0103] S510: Determine whether the job ticket is completed.

[0104] If the judgment result is no, then return to S510; if the judgment result is yes, then execute S511.

[0105] S511. Save the job ticket to the job ticket history information management.

[0106] In the embodiment of the present invention, when executing the job ticket information data editing, the called job ticket template data can no longer be selected, and only the data information input by the job ticket form element can be changed. If a certain job ticket information is completed, the system will automatically move this job ticket information to the job ticket history information module.

[0107] In the embodiment of the present invention, the form component of the job ticket template configured by the user is obtained; the hypertext markup language of the job ticket template is generated based on the form component; the JSON format data of the job ticket template is generated based on the hypertext markup language, so that after the user selects the job ticket template, the JSON format data is restored to the job ticket form. The browser / server B / S architecture mode is adopted, and the job ticket style design operation is quickly performed using a WEB browser, which simply, quickly, flexibly and effectively meets the preset customization requirements of various job tickets, and finally achieves a work ticket construction and use solution with high flexibility, strong practicality and low development cost.

[0108] Figure 6 A block diagram of a job ticket construction device according to an embodiment of the present application is shown, the device comprising:

[0109] A component acquisition module 610 is configured to acquire a form component of a job ticket template configured by a user;

[0110] A first generating module 620, configured to generate a hypertext markup language of the job ticket template based on the form component;

[0111] The second generating module 630 is configured to generate JSON format data of the job ticket template based on the hypertext markup language, so as to restore the JSON format data into a job ticket form after the user selects the job ticket template.

[0112] In an exemplary embodiment of the present application, the device also includes a model judgment module 640, which is configured to judge whether the job ticket template exists in the template collection based on the input value of the template code in the JSON format data, and to give a prompt based on the result; or to judge whether the job ticket template exists in the template collection after filtering out the label and label comment information of the form component in the JSON format data, and to give a prompt based on the result.

[0113] In an exemplary embodiment of the present application, the component acquisition module 610 is configured to acquire the form component of the job ticket template configured by the user through the front-end drag technology and the custom packaged function.

[0114] In an exemplary embodiment of the present application, the second generating module 630 is configured to generate JSON format data of the job ticket template from the hypertext markup language based on extraction rules using a processing function.

[0115] In an exemplary embodiment of the present application, the device also includes: a template selection module 650, configured to obtain a job ticket template selected by a user from a template collection; a form restoration module 660, configured to use a restoration function to reversely restore the JSON format data of the job ticket template into a job ticket form based on the extraction rule.

[0116] In an exemplary embodiment of the present application, the apparatus further includes: a form storage module 670 configured to obtain form component values ​​input by the user in the job ticket form, and store the form component values ​​and the form components in a key-value pair format.

[0117] In an exemplary embodiment of the present application, the JSON format data includes: an identifier of the form component, a tag name, a tag type, and a tag order.

[0118] In the embodiment of the present invention, the form component of the job ticket template configured by the user is obtained; the hypertext markup language of the job ticket template is generated based on the form component; the JSON format data of the job ticket template is generated based on the hypertext markup language, so that after the user selects the job ticket template, the JSON format data is restored to the job ticket form. The browser / server B / S architecture mode is adopted, and the job ticket style design operation is quickly performed using a WEB browser, which simply, quickly, flexibly and effectively meets the preset customization requirements of various job tickets, and finally achieves a work ticket construction and use solution with high flexibility, strong practicality and low development cost.

[0119] Reference below Figure 7 The electronic device 70 according to an embodiment of the present application is described. Figure 7 The electronic device 70 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0120] like Figure 7 As shown, the electronic device 70 is in the form of a general computing device. The components of the electronic device 70 may include but are not limited to: at least one processing unit 710, at least one storage unit 720, and a bus 740 connecting different system components (including the storage unit 720 and the processing unit 70).

[0121] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 performs the steps according to various exemplary embodiments of the present invention described in the description of the exemplary method described above in this specification. For example, the processing unit 710 can perform the following steps: Figure 1 The steps shown in .

[0122] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 7201 and / or a cache storage unit 7202 , and may further include a read-only storage unit (ROM) 7203 .

[0123] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0124] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0125] The electronic device 70 may also communicate with one or more external devices 800 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 70, and / or communicate with any device that enables the electronic device 70 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. The input / output (I / O) interface 750 is connected to a display unit 740. Furthermore, the electronic device 70 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 70 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 70, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0126] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0127] In an exemplary embodiment of the present application, a computer-readable storage medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the method described in the above method embodiment.

[0128] According to one embodiment of the present application, a program product for implementing the method in the above method embodiment is also provided, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0129] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0130] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0131] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0132] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as JAVA, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0133] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0134] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0135] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0136] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the appended claims.

Claims

1. A method for constructing a job ticket, characterized in that: The method comprises: Get the form component of the user-configured job ticket template; Generate a hypertext markup language of the job ticket template based on the form component; Generating JSON format data of the job ticket template based on the hypertext markup language, so as to restore the JSON format data into a job ticket form after the user selects the job ticket template; Generating JSON format data of the job ticket template based on the hypertext markup language includes: Using the processing function to generate JSON format data of a multi-layer nested array object of the job ticket template from the hypertext markup language based on the extraction rule; The processing function is used to generate JSON format data of a multi-layer nested array object of the job ticket template from the hypertext markup language based on the extraction rule, including: The processing function is used to find the nested relationship in the hypertext markup language, and the attribute information of the label of each level is extracted as the key value of the attribute key name of the object element corresponding to each level, so as to generate JSON format data of the multi-layer nested array object.

2. The method for constructing a job ticket according to claim 1, characterized in that: After generating the JSON format data of the job ticket template based on the hypertext markup language, the method further includes: Determine whether the job ticket template exists in the template set based on the input value of the template code in the JSON format data, and give a prompt based on the result; or After filtering out the labels and label remark information of the form components in the JSON format data, it is determined whether the job ticket template exists in the template collection, and a prompt is given based on the result.

3. The method for constructing a job ticket according to claim 1, characterized in that: Get the form component of the user-configured job ticket template, including: The form component of the user-configured job ticket template is obtained through the front-end drag-and-drop technology and custom encapsulated functions.

4. The method for constructing a job ticket according to claim 1, characterized in that: The method further comprises: Get the job ticket template selected by the user from the template collection; The restoration function is used to reversely restore the JSON format data of the job ticket template into a job ticket form based on the extraction rule.

5. The method for constructing a job ticket according to claim 4, characterized in that: The JSON format data of the job ticket template is reversely restored into a job ticket form based on the extraction rule by using a restoration function, including: Convert the JSON format data of the multi-layer nested array object into array data that can be traversed in a loop; Loop through the array data and determine whether the key value length of the current object element meets the length threshold; When the length threshold is met, the attribute information of the sub-object elements in each layer of the array is used to generate corresponding hypertext markup language tags; When the length threshold is not met, the loop traversal is exited, and the generated hypertext markup language tag string is appended to the tag element.

6. The method for constructing a job ticket according to claim 4, characterized in that: The method further comprises: The form component value entered by the user in the job ticket form is obtained, and the form component value and the form component are stored in a key-value pair.

7. The method for constructing a job ticket according to any one of claims 1 to 6, characterized in that: The JSON format data includes: the form component identifier, tag name, tag type, and tag order.

8. A job ticket construction device, characterized in that: Using the method for constructing a job ticket according to any one of claims 1 to 7, the device comprises: A component acquisition module configured to acquire a form component of a job ticket template configured by a user; A first generating module, configured to generate a hypertext markup language of the job ticket template based on the form component; The second generating module is configured to generate JSON format data of the job ticket template based on the hypertext markup language, so as to restore the JSON format data into a job ticket form after the user selects the job ticket template.

9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the method described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Form visual configuration method and device

    CN114089958A

  • Method and system for adapting form to multiple terminals, electronic equipment and storage medium

    CN117056634A