easyUI 多功能datagrid 用户控件

Posted 邹敏向日葵

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了easyUI 多功能datagrid 用户控件相关的知识,希望对你有一定的参考价值。

1 往来单位
[{"id":"000","parentId":"","text":"客户列表","state":"open","children":[{"id":"000001","parentId":"000","text":"客户","state":"closed","children":[{"id":"000001001","parentId":"000001","text":"高校客户"},{"id":"000001002","parentId":"000001","text":"政府客户"},{"id":"000001004","parentId":"000001","text":"金融客户"},{"id":"000001005","parentId":"000001","text":"驾校客户"},{"id":"000001006","parentId":"000001","text":"医药行业"},{"id":"000001007","parentId":"000001","text":"培训行业"},{"id":"000001003","parentId":"000001","text":"企业客户"},{"id":"000001008","parentId":"000001","text":"不分类客户"}]},{"id":"000002","parentId":"000","text":"供货商","state":"closed","children":[{"id":"000002001","parentId":"000002","text":"江西供货商"},{"id":"000002002","parentId":"000002","text":"北上广供货商"},{"id":"000002003","parentId":"000002","text":"其他省供货商"}]},{"id":"000003","parentId":"000","text":"其他","state":"closed","children":[{"id":"000003001","parentId":"000003","text":"招标公司"},{"id":"000003002","parentId":"000003","text":"服务机构"}]}]}]

{"total":620,"rows":[{"Gue_number":"000001001001","Gue_parentNumber":"000001001","Gue_name":"南昌大学","Gue_ifType":"1","Gue_code":"0101001","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001002","Gue_parentNumber":"000001001","Gue_name":"江西财经大学","Gue_ifType":"1","Gue_code":"0101002","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001003","Gue_parentNumber":"000001001","Gue_name":"江西师范大学","Gue_ifType":"1","Gue_code":"0101003","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001004","Gue_parentNumber":"000001001","Gue_name":"南昌航空大学","Gue_ifType":"1","Gue_code":"0101004","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001005","Gue_parentNumber":"000001001","Gue_name":"江西工业贸易职业技术学院","Gue_ifType":"1","Gue_code":"0101005","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001006","Gue_parentNumber":"000001001","Gue_name":"江西师范高等专科学校","Gue_ifType":"1","Gue_code":"0101006","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001007","Gue_parentNumber":"000001001","Gue_name":"江西机电学院","Gue_ifType":"1","Gue_code":"0101007","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001008","Gue_parentNumber":"000001001","Gue_name":"江西农业大学","Gue_ifType":"1","Gue_code":"0101008","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001009","Gue_parentNumber":"000001001","Gue_name":"江西现代职业技术学院","Gue_ifType":"1","Gue_code":"0101009","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001010","Gue_parentNumber":"000001001","Gue_name":"江西现代教育技术中心","Gue_ifType":"1","Gue_code":"0101010","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001011","Gue_parentNumber":"000001001","Gue_name":"江西警察学院","Gue_ifType":"1","Gue_code":"0101011","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001012","Gue_parentNumber":"000001001","Gue_name":"江西工程职业学院","Gue_ifType":"1","Gue_code":"0101012","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001013","Gue_parentNumber":"000001001","Gue_name":"九江学院","Gue_ifType":"1","Gue_code":"0101013","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001014","Gue_parentNumber":"000001001","Gue_name":"江西制造学院","Gue_ifType":"1","Gue_code":"0101014","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001015","Gue_parentNumber":"000001001","Gue_name":"旅游职业中专","Gue_ifType":"1","Gue_code":"0101015","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001016","Gue_parentNumber":"000001001","Gue_name":"江西景德镇市珠山区教育体育局","Gue_ifType":"1","Gue_code":"0101092","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001017","Gue_parentNumber":"000001001","Gue_name":"女子中等专科学校","Gue_ifType":"1","Gue_code":"0101017","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001018","Gue_parentNumber":"000001001","Gue_name":"江西理工大学","Gue_ifType":"1","Gue_code":"0101018","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001019","Gue_parentNumber":"000001001","Gue_name":"江西水利工程学院","Gue_ifType":"1","Gue_code":"0101019","Ying":"0.00","Yu":"0.00","Qi":"0.00"},{"Gue_number":"000001001020","Gue_parentNumber":"000001001","Gue_name":"南昌理工大学","Gue_ifType":"1","Gue_code":"0101020","Ying":"0.00","Yu":"0.00","Qi":"0.00"}]}

2 入库仓库

[{"id":"000","parentId":"","text":"物资库","state":"open","children":[{"id":"000001","parentId":"000","text":"测试库"},{"id":"000002","parentId":"000","text":"数据库"},{"id":"000003","parentId":"000","text":"高新库"}]}]

{"total":4,"rows":[{"Stor_number":"000001001","Stor_parentNumber":"000001","Stor_name":"测试","Stor_IfType":"1","Stor_Code":"03"},{"Stor_number":"000003001","Stor_parentNumber":"000003","Stor_name":"高新","Stor_IfType":"1","Stor_Code":"05"},{"Stor_number":"000003002","Stor_parentNumber":"000003","Stor_name":"高新区","Stor_IfType":"1","Stor_Code":"06"},{"Stor_number":"000003003003","Stor_parentNumber":"000003","Stor_name":"高新大道","Stor_IfType":"1","Stor_Code":"07"}]}
3 经手人
[{"id":"000","parentId":"","text":"总经理","state":"open","children":[{"id":"000007","parentId":"000","text":"项目管理办公室","state":"closed","children":[{"id":"000007001","parentId":"000007","text":"运维部"},{"id":"000007002","parentId":"000007","text":"研发部"},{"id":"000007003","parentId":"000007","text":"项目部"}]},{"id":"000008","parentId":"000","text":"营销总监","state":"closed","children":[{"id":"000008002","parentId":"000008","text":"采购部"},{"id":"000008003","parentId":"000008","text":"营销一部"},{"id":"000008004","parentId":"000008","text":"商务文员"}]},{"id":"000009","parentId":"000","text":"副总经理(资产)","state":"closed","children":[{"id":"000009001","parentId":"000009","text":"财务部"},{"id":"000009002","parentId":"000009","text":"库管部"}]},{"id":"000010","parentId":"000","text":"副总经理(行政)","state":"closed","children":[{"id":"000010001","parentId":"000010","text":"行政部"},{"id":"000010002","parentId":"000010","text":"人事部"}]}]}]

{"total":48,"rows":[{"Worker_number":"000024","Worker_department":"000","Worker_ID_Attendance":"1001","Worker_name":"郭驭华","Bran_name":"总经理","Bran_number":"000","Worker_001payment":"0.00"},{"Worker_number":"000031","Worker_department":"000007001","Worker_ID_Attendance":"1006","Worker_name":"张晓明","Bran_name":"运维部","Bran_number":"000007001","Worker_001payment":"0.00"},{"Worker_number":"000007001","Worker_department":"000009001","Worker_ID_Attendance":"2005","Worker_name":"邱红","Bran_name":"财务部","Bran_number":"000009001","Worker_001payment":"0.00"},{"Worker_number":"000006","Worker_department":"000009","Worker_ID_Attendance":"2015","Worker_name":"雷凌","Bran_name":"副总经理(资产)","Bran_number":"000009","Worker_001payment":"0.00"},{"Worker_number":"000005","Worker_department":"000007","Worker_ID_Attendance":"3014","Worker_name":"刘宇华","Bran_name":"项目管理办公室","Bran_number":"000007","Worker_001payment":"0.00"},{"Worker_number":"000006002","Worker_department":"000008003","Worker_ID_Attendance":"3039","Worker_name":"雷刚","Bran_name":"营销一部","Bran_number":"000008003","Worker_001payment":"0.00"},{"Worker_number":"000005001","Worker_department":"000007003","Worker_ID_Attendance":"5001","Worker_name":"何学裕","Bran_name":"项目部","Bran_number":"000007003","Worker_001payment":"0.00"},{"Worker_number":"000005002","Worker_department":"000007003","Worker_ID_Attendance":"5002","Worker_name":"吴志龙","Bran_name":"项目部","Bran_number":"000007003","Worker_001payment":"0.00"},{"Worker_number":"000005003","Worker_department":"000007002","Worker_ID_Attendance":"5003","Worker_name":"曹强","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000041","Worker_department":"000007002","Worker_ID_Attendance":"8063","Worker_name":"郭丽琴","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000049","Worker_department":"000008003","Worker_ID_Attendance":"8071","Worker_name":"王屹","Bran_name":"营销一部","Bran_number":"000008003","Worker_001payment":"0.00"},{"Worker_number":"000053","Worker_department":"000010001","Worker_ID_Attendance":"8076","Worker_name":"韦清清","Bran_name":"行政部","Bran_number":"000010001","Worker_001payment":"0.00"},{"Worker_number":"000055","Worker_department":"000007002","Worker_ID_Attendance":"8078","Worker_name":"邓志鹏","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000059","Worker_department":"000007003","Worker_ID_Attendance":"8082","Worker_name":"郑在汉","Bran_name":"项目部","Bran_number":"000007003","Worker_001payment":"0.00"},{"Worker_number":"000078","Worker_department":"000007002","Worker_ID_Attendance":"8101","Worker_name":"郑林芝","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000079","Worker_department":"000007002","Worker_ID_Attendance":"8102","Worker_name":"魏诗茹","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000099","Worker_department":"000007002","Worker_ID_Attendance":"8123","Worker_name":"黄芬","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000100","Worker_department":"000010002","Worker_ID_Attendance":"8124","Worker_name":"吴秋珍","Bran_name":"人事部","Bran_number":"000010002","Worker_001payment":"0.00"},{"Worker_number":"000104","Worker_department":"000008003","Worker_ID_Attendance":"8128","Worker_name":"何钱发","Bran_name":"营销一部","Bran_number":"000008003","Worker_001payment":"0.00"},{"Worker_number":"000107","Worker_department":"000008005","Worker_ID_Attendance":"8131","Worker_name":"曹宇","Bran_name":"","Bran_number":"","Worker_001payment":"0.00"},{"Worker_number":"000112","Worker_department":"000007001","Worker_ID_Attendance":"8136","Worker_name":"淦剑","Bran_name":"运维部","Bran_number":"000007001","Worker_001payment":"0.00"},{"Worker_number":"000113","Worker_department":"000009001","Worker_ID_Attendance":"8137","Worker_name":"程巧云","Bran_name":"财务部","Bran_number":"000009001","Worker_001payment":"0.00"},{"Worker_number":"000116","Worker_department":"000007003","Worker_ID_Attendance":"8140","Worker_name":"韩垂坤","Bran_name":"项目部","Bran_number":"000007003","Worker_001payment":"0.00"},{"Worker_number":"000117","Worker_department":"000007003","Worker_ID_Attendance":"8141","Worker_name":"刘茂平","Bran_name":"项目部","Bran_number":"000007003","Worker_001payment":"0.00"},{"Worker_number":"000130","Worker_department":"000007002","Worker_ID_Attendance":"8154","Worker_name":"邹明琦","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000132","Worker_department":"000007004","Worker_ID_Attendance":"8156","Worker_name":"陈志燕","Bran_name":"","Bran_number":"","Worker_001payment":"0.00"},{"Worker_number":"000142","Worker_department":"000010002","Worker_ID_Attendance":"8171","Worker_name":"刘琴","Bran_name":"人事部","Bran_number":"000010002","Worker_001payment":"0.00"},{"Worker_number":"000163","Worker_department":"000008005","Worker_ID_Attendance":"8189","Worker_name":"曹代潍","Bran_name":"","Bran_number":"","Worker_001payment":"0.00"},{"Worker_number":"000166","Worker_department":"000008002","Worker_ID_Attendance":"8192","Worker_name":"万南霞","Bran_name":"采购部","Bran_number":"000008002","Worker_001payment":"0.00"},{"Worker_number":"000178","Worker_department":"000007002","Worker_ID_Attendance":"8204","Worker_name":"廖俊清","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000180","Worker_department":"000009001","Worker_ID_Attendance":"8206","Worker_name":"张勤","Bran_name":"财务部","Bran_number":"000009001","Worker_001payment":"0.00"},{"Worker_number":"000184","Worker_department":"000007002","Worker_ID_Attendance":"8210","Worker_name":"程益兰","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000185","Worker_department":"000007002","Worker_ID_Attendance":"8211","Worker_name":"邱妙文","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000189","Worker_department":"000007002","Worker_ID_Attendance":"8215","Worker_name":"金翊磊","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000200","Worker_department":"000007002","Worker_ID_Attendance":"8227","Worker_name":"段学辉","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000201","Worker_department":"000007003","Worker_ID_Attendance":"8228","Worker_name":"李绍波","Bran_name":"项目部","Bran_number":"000007003","Worker_001payment":"0.00"},{"Worker_number":"000202","Worker_department":"000008","Worker_ID_Attendance":"8229","Worker_name":"刘祖福","Bran_name":"营销总监","Bran_number":"000008","Worker_001payment":"0.00"},{"Worker_number":"000204","Worker_department":"000008004","Worker_ID_Attendance":"8231","Worker_name":"邹群英","Bran_name":"商务文员","Bran_number":"000008004","Worker_001payment":"0.00"},{"Worker_number":"000207","Worker_department":"000008005","Worker_ID_Attendance":"8235","Worker_name":"邹武华","Bran_name":"","Bran_number":"","Worker_001payment":"0.00"},{"Worker_number":"000208","Worker_department":"000007002","Worker_ID_Attendance":"8236","Worker_name":"赵梦霞","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000211","Worker_department":"000008005","Worker_ID_Attendance":"8239","Worker_name":"蒋建军","Bran_name":"","Bran_number":"","Worker_001payment":"0.00"},{"Worker_number":"000214","Worker_department":"000007002","Worker_ID_Attendance":"8242","Worker_name":"杨杰","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000221","Worker_department":"000007002","Worker_ID_Attendance":"8249","Worker_name":"朱杰","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000222","Worker_department":"000008003","Worker_ID_Attendance":"8250","Worker_name":"刘健","Bran_name":"营销一部","Bran_number":"000008003","Worker_001payment":"0.00"},{"Worker_number":"000224","Worker_department":"000008005","Worker_ID_Attendance":"8252","Worker_name":"尹孝杰","Bran_name":"","Bran_number":"","Worker_001payment":"0.00"},{"Worker_number":"000225","Worker_department":"000008005","Worker_ID_Attendance":"8253","Worker_name":"吕普林","Bran_name":"","Bran_number":"","Worker_001payment":"0.00"},{"Worker_number":"000227","Worker_department":"000007002","Worker_ID_Attendance":"8255","Worker_name":"徐新全","Bran_name":"研发部","Bran_number":"000007002","Worker_001payment":"0.00"},{"Worker_number":"000229","Worker_department":"000008003","Worker_ID_Attendance":"8257","Worker_name":"吴志冬","Bran_name":"营销一部","Bran_number":"000008003","Worker_001payment":"0.00"}]}
4 部门
[{"id":"000","parentId":"","text":"总经理","state":"open","children":[{"id":"000007","parentId":"000","text":"项目管理办公室"},{"id":"000008","parentId":"000","text":"营销总监"},{"id":"000009","parentId":"000","text":"副总经理(资产)"},{"id":"000010","parentId":"000","text":"副总经理(行政)"}]}]

{"total":15,"rows":[{"Bran_number":"000","Bran_name":"总经理","Bran_parentNumber":"","Bran_code":"000"},{"Bran_number":"000007","Bran_name":"项目管理办公室","Bran_parentNumber":"000","Bran_code":"05"},{"Bran_number":"000007001","Bran_name":"运维部","Bran_parentNumber":"000007","Bran_code":"0501"},{"Bran_number":"000007002","Bran_name":"研发部","Bran_parentNumber":"000007","Bran_code":"0502"},{"Bran_number":"000007003","Bran_name":"项目部","Bran_parentNumber":"000007","Bran_code":"0503"},{"Bran_number":"000008","Bran_name":"营销总监","Bran_parentNumber":"000","Bran_code":"04"},{"Bran_number":"000008002","Bran_name":"采购部","Bran_parentNumber":"000008","Bran_code":"0402"},{"Bran_number":"000008003","Bran_name":"营销一部","Bran_parentNumber":"000008","Bran_code":"0403"},{"Bran_number":"000008004","Bran_name":"商务文员","Bran_parentNumber":"000008","Bran_code":"0404"},{"Bran_number":"000009","Bran_name":"副总经理(资产)","Bran_parentNumber":"000","Bran_code":"03"},{"Bran_number":"000009001","Bran_name":"财务部","Bran_parentNumber":"000009","Bran_code":"0301"},{"Bran_number":"000009002","Bran_name":"库管部","Bran_parentNumber":"000009","Bran_code":"0302"},{"Bran_number":"000010","Bran_name":"副总经理(行政)","Bran_parentNumber":"000","Bran_code":"02"},{"Bran_number":"000010001","Bran_name":"行政部","Bran_parentNumber":"000010","Bran_code":"0201"},{"Bran_number":"000010002","Bran_name":"人事部","Bran_parentNumber":"000010","Bran_code":"0203"}]}

5商品
[{"id":"001","parentId":"0","text":"商品列表","state":"closed","children":[{"id":"001001","parentId":"001","text":"机房设备"},{"id":"001002","parentId":"001","text":"电脑及显示器"},{"id":"001003","parentId":"001","text":"打印机设备"},{"id":"001004","parentId":"001","text":"公司自用办公用品"},{"id":"001005","parentId":"001","text":"设备维修"},{"id":"001006","parentId":"001","text":"海康产品"},{"id":"001007","parentId":"001","text":"其它监控设备"},{"id":"001008","parentId":"001","text":"网络产品"},{"id":"001009","parentId":"001","text":"施工工具"},{"id":"001010","parentId":"001","text":"其它摄像机"},{"id":"001011","parentId":"001","text":"电脑配件"},{"id":"001012","parentId":"001","text":"GPS设备"},{"id":"001013","parentId":"001","text":"各类线材"},{"id":"001014","parentId":"001","text":"其他"},{"id":"001015","parentId":"001","text":"安装耗材"},{"id":"001016","parentId":"001","text":"路由器交换机"}]}]

{"total":1131,"rows":[{"Id":"1","Goods_Code":"shangpinliebiao","Goods_Number":"001","Goods_Name":"商品列表","Goods_BigUnit":"","Goods_SmallUint":"","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"3","Goods_Code":"002","Goods_Number":"001002","Goods_Name":"电脑及显示器","Goods_BigUnit":"","Goods_SmallUint":"","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"4","Goods_Code":"003","Goods_Number":"001003","Goods_Name":"打印机设备","Goods_BigUnit":"","Goods_SmallUint":"","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"8","Goods_Code":"004","Goods_Number":"001004","Goods_Name":"公司自用办公用品","Goods_BigUnit":"","Goods_SmallUint":"","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"23","Goods_Code":"001003","Goods_Number":"001014010","Goods_Name":"身份证读卡器","Goods_BigUnit":"","Goods_SmallUint":"个","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"25","Goods_Code":"","Goods_Number":"991","Goods_Name":"固定资产","Goods_BigUnit":"","Goods_SmallUint":"","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"28","Goods_Code":"003009","Goods_Number":"001014011","Goods_Name":"考勤机","Goods_BigUnit":"","Goods_SmallUint":"台","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"30","Goods_Code":"004007","Goods_Number":"001009046","Goods_Name":"录音笔","Goods_BigUnit":"","Goods_SmallUint":"个","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"42","Goods_Code":"005010","Goods_Number":"001010012","Goods_Name":"GST-JK1516硬盘录像机","Goods_BigUnit":"","Goods_SmallUint":"台","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"46","Goods_Code":"006","Goods_Number":"001006","Goods_Name":"海康产品","Goods_BigUnit":"","Goods_SmallUint":"","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"47","Goods_Code":"006001","Goods_Number":"001006001","Goods_Name":"海康DS-1210ZJ支架","Goods_BigUnit":"","Goods_SmallUint":"个","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"52","Goods_Code":"006006","Goods_Number":"001006006","Goods_Name":"海康DS-2CC1172P-IR1T枪机","Goods_BigUnit":"","Goods_SmallUint":"个","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"53","Goods_Code":"006007","Goods_Number":"001006007","Goods_Name":"海康DS-2CC5172P-IR1T半球","Goods_BigUnit":"","Goods_SmallUint":"个","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"55","Goods_Code":"007","Goods_Number":"001007","Goods_Name":"其它监控设备","Goods_BigUnit":"","Goods_SmallUint":"","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"56","Goods_Code":"007001","Goods_Number":"001013001","Goods_Name":"帝一75-5 96P视频线","Goods_BigUnit":"","Goods_SmallUint":"米","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"57","Goods_Code":"007002","Goods_Number":"001013002","Goods_Name":"帝一RW2X1电源线","Goods_BigUnit":"","Goods_SmallUint":"米","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"58","Goods_Code":"007003","Goods_Number":"001013003","Goods_Name":"帝一2X1.0控制线","Goods_BigUnit":"","Goods_SmallUint":"米","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"63","Goods_Code":"008","Goods_Number":"001008","Goods_Name":"网络产品","Goods_BigUnit":"","Goods_SmallUint":"","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"64","Goods_Code":"008001","Goods_Number":"001016005","Goods_Name":"中联程控交换机8进64出","Goods_BigUnit":"","Goods_SmallUint":"个","Goods_Spec":"","Goods_Aear":"","Goods_Model":""},{"Id":"65","Goods_Code":"009","Goods_Number":"001009","Goods_Name":"施工工具","Goods_BigUnit":"","Goods_SmallUint":"","Goods_Spec":"","Goods_Aear":"","Goods_Model":""}]}
View Code

 

 
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="DatagridDetial.ascx.cs"
    Inherits="UserControl_bill_Detial_DatagridDetial" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>多功能datagrid</title>
    <link rel="stylesheet" type="text/css" href="../../Css/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../Css/themes/icon.css" />
    <script type="text/javascript" src="../../Js/hdj_default/jquery-3.0.0.js"></script>
    <script type="text/javascript" src="../../Js/hdj_default/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../js/hdj_default/easyui-lang-zh_CN.js"></script>
</head>
<body>
    <div style="margin: 20px 0;">
    </div>
    <!-- 头部隐藏工具栏 -->
    <div class="showcolumnTools">
    </div>
    <!-- 中间数据表格 -->
    <table id="dg_Multi_function" style="height: auto">
    </table>
    <!-- 底部工具栏 -->
    <div class="bottomTools">
        <span style="float: right;">
            <select id="ddlType_Shuilv" class="easyui-combobox" data-options="editable : false,panelHeight:80">
                <option value="0" selected="selected">选择税率</option>
                <option value="0.03">普通税率(3%)</option>
                <option value="0.17">增值税(17%)</option>
                <option value="0.06">服务税(6%)</option>
            </select>
            <a id="buttonLoadDraft" href="javascript:FoldBill();" class="easyui-linkbutton floatRight"
                data-options="iconCls:\'icon-save\'">调入草稿</a>&nbsp; <a id="buttonSaveDraft" href="javascript:AddSave(193);"
                    class="easyui-linkbutton floatRight" data-options="iconCls:\'icon-save\'">存入草稿</a>&nbsp;
            <a id="buttonSave" href="javascript:ProviderDatagrid();" class="easyui-linkbutton floatRight"
                data-options="iconCls:\'icon-save\'">保存入库</a> </span>
    </div>
    <script type="text/javascript">
        var myMulti_dg = $("#dg_Multi_function"); //datagrid对象
        var varPricePointDigit = 2; //金额小数点位数

        $.extend($.fn.datagrid.methods, {
            editCell: function (jq, param) {
                //可编辑的列 Goods_Code Goods_Name tb_Number tb_dj_ws tb_dj_hs tb_ddw_hs tb_ddw_ws tb_je_ws tb_je_hs tb_shuilv tb_shuie
                var ediCol = param["field"];
                if (ediCol == "Goods_Code" || ediCol == "Goods_Name" || ediCol == "tb_Number" || ediCol == "tb_Number_ddw" || ediCol == "tb_dj_ws" || ediCol == "tb_dj_hs" || ediCol == "tb_ddw_hs" || ediCol == "tb_ddw_ws" || ediCol == "tb_je_ws" || ediCol == "tb_je_hs" || ediCol == "tb_shuilv" || ediCol == "tb_shuie") {
                    return jq.each(function () {
                        var opts = $(this).datagrid(\'options\');
                        var fields = $(this).datagrid(\'getColumnFields\', true).concat($(this).datagrid(\'getColumnFields\'));
                        for (var i = 0; i < fields.length; i++) {
                            var col = $(this).datagrid(\'getColumnOption\', fields[i]);
                            col.editor1 = col.editor;
                            if (fields[i] != param.field) {
                                col.editor = null;
                            }
                        }
                        $(this).datagrid(\'beginEdit\', param.index);
                        var ed = $(this).datagrid(\'getEditor\', param);
                        if (ed) {
                            if ($(ed.target).hasClass(\'textbox-f\')) {
                                $(ed.target).textbox(\'textbox\').focus();
                            } else {
                                $(ed.target).focus();
                            }
                        }
                        for (var i = 0; i < fields.length; i++) {
                            var col = $(this).datagrid(\'getColumnOption\', fields[i]);
                            col.editor = col.editor1;
                        }
                    });
                }
            },
            enableCellEditing: function (jq) {
                return jq.each(function () {
                    var dg = $(this);
                    var opts = dg.datagrid(\'options\');
                    opts.oldOnClickCell = opts.onClickCell;
                    opts.onClickCell = function (index, field) {
                        if (opts.editIndex != undefined) {
                            if (dg.datagrid(\'validateRow\', opts.editIndex)) {
                                dg.datagrid(\'endEdit\', opts.editIndex);
                                opts.editIndex = undefined;
                            } else {
                                return;
                            }
                        }

                        dg.datagrid(\'selectRow\', index).datagrid(\'editCell\', {
                            index: index,
                            field: field
                        });
                        opts.editIndex = index;
                        opts.oldOnClickCell.call(this, index, field);
                    }
                });
            },
            //列显示隐藏逻辑
            showHidecolumns: function (jq) {
                //初次加载就把含税和大单位隐藏
                myMulti_dg.datagrid(\'hideColumn\', \'tb_Number_ddw\'); //大单价对应数量
                myMulti_dg.datagrid(\'hideColumn\', \'tb_ddw_hs\'); //大单价(含税)
                myMulti_dg.datagrid(\'hideColumn\', \'tb_shuilv\'); //税率
                myMulti_dg.datagrid(\'hideColumn\', \'tb_shuie\'); //税额
                myMulti_dg.datagrid(\'hideColumn\', \'tb_dj_hs\'); //单价(含税)
                myMulti_dg.datagrid(\'hideColumn\', \'tb_je_hs\'); //金额(含税)
                myMulti_dg.datagrid(\'hideColumn\', \'tb_ddw_ws\'); //大单价(未税)
                myMulti_dg.datagrid(\'hideColumn\', \'tb_ddw\'); //大单位
                myMulti_dg.datagrid(\'showColumn\', \'tb_xdw\'); //小单位
                myMulti_dg.datagrid(\'showColumn\', \'tb_dj_ws\'); //单价(未税)
                myMulti_dg.datagrid(\'showColumn\', \'tb_je_ws\'); //金额(未税)
                var opts = $.data(jq[0], \'datagrid\').options;
                var dg = $(jq[0]); //获取到当前表格
                var arr = opts.hidecolumns; //隐藏列
                //勾选隐藏逻辑啊a[0]:表示编号,a[1]:表示名称
                for (i = 0; i < arr[0].length; i++) {
                    $(".showcolumnTools").append(\'<input type="checkbox" id="\' + arr[0][i] + \'" /><label>\' + arr[1][i] + \'</label>\'); //添加check元素
                    dg.datagrid(\'hideColumn\', arr[0][i]); //初次加载先隐藏
                    //$(".showcolumnTools").append(\'<input type="checkbox" id="\' + arr[0][i] + \'" /><label>显示\' + arr[1][i] + \'</label>\');
                    $("#" + arr[0][i]).click(function () {
                        var self = $(this);
                        var id = self.attr(\'id\');
                        console.log(id);
                        if (id == \'yongdadanwei\' || id == \'hanshui\') {//含税,用大单位,特殊逻辑
                            var ddw_self = $("#yongdadanwei"); //大单位check对象
                            var hs_self = $("#hanshui"); //含税check对象
                            //大单位:tb_ddw,小单位:tb_xdw ,大单位(含税):tb_ddw_hs ,大单位(未税):tb_ddw_ws
                            //金额(含税):tb_jehs ,金额(未税):tb_je_ws ,tb_shuilv tb_shuie,
                            //大单位对应数目:tb_Number_ddw,数目:tb_Number
                            if (hs_self.is(\':checked\') == true) { //含税+大单位
                                if (ddw_self.is(\':checked\') == true) {
                                    //用大单位+含税(显示:大单位(含税),税率,税额;隐藏:小单位,单价(未税),金额(未税))
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_ddw_hs\'); //大单价(含税)
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_shuilv\'); //税率
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_shuie\'); //税额
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_dj_hs\'); //单价(含税)
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_je_hs\'); //金额(含税)
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_ddw_ws\'); //大单价(未税)
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_ddw\'); //大单位
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_xdw\'); //小单位
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_dj_ws\'); //单价(未税)
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_je_ws\'); //金额(未税)
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_Number_ddw\'); //大单位对应数目
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_Number\'); //数目
                                } else {//含税+小单位
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_ddw_hs\'); //大单价(含税)
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_shuilv\'); //税率
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_shuie\'); //税额
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_dj_hs\'); //单价(含税)
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_je_hs\'); //金额(含税)
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_ddw_ws\'); //大单价(未税)
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_ddw\'); //大单位
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_xdw\'); //小单位
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_dj_ws\'); //单价(未税)
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_je_ws\'); //金额(未税)
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_Number_ddw\'); //大单位对应数目
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_Number\'); //数目
                                }
                            }
                            else {//不含税+大单位
                                if (ddw_self.is(\':checked\') == true) {
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_ddw_hs\'); //大单价(含税)
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_shuilv\'); //税率
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_shuie\'); //税额
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_dj_hs\'); //单价(含税)
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_je_hs\'); //金额(含税)
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_ddw_ws\'); //大单价(未税)
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_ddw\'); //大单位
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_xdw\'); //小单位
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_dj_ws\'); //单价(未税)
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_je_ws\'); //金额(未税)
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_Number_ddw\'); //大单位对应数目
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_Number\'); //数目
                                } else {//不含税+小单位
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_ddw_hs\'); //大单价(含税)
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_shuilv\'); //税率
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_shuie\'); //税额
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_dj_hs\'); //单价(含税)
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_je_hs\'); //金额(含税)
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_ddw_ws\'); //大单价(未税)
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_ddw\'); //大单位
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_xdw\'); //小单位
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_dj_ws\'); //单价(未税)
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_je_ws\'); //金额(未税)
                                    myMulti_dg.datagrid(\'hideColumn\', \'tb_Number_ddw\'); //大单位对应数目
                                    myMulti_dg.datagrid(\'showColumn\', \'tb_Number\'); //数目
                                }
                            }
                        } else {
                            self.is(\':checked\') == true ? myMulti_dg.datagrid(\'showColumn\', id) : myMulti_dg.datagrid(\'hideColumn\', id);
                        }
                    });
                }
            }
        });

        $(function () {
            myMulti_dg.datagrid().datagrid(\'enableCellEditing\');
        })

        //数据网格加载
        myMulti_dg.datagrid({
            columns: [[
                { field: \'Goods_Code\', title: \'编码\', width: 80, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'Goods_Name\', title: \'名称\', width: 150, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'Goods_Aear\', title: \'产地\', width: 80, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_guige\', title: \'规格\', width: 60, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_Type\', title: \'型号\', width: 60, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_sjkc\', title: \'实际库存\', width: 80, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_ddw\', title: \'大单位\', width: 50, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_xdw\', title: \'小单位\', width: 50, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_Number\', title: \'数量\', width: 50, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_Number_ddw\', title: \'数量(大)\', width: 60, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_dj_ws\', title: \'单价(未税)\', width: 80, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_dj_hs\', title: \'单价(含税)\', width: 80, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_ddw_hs\', title: \'大单价(含税)\', width: 100, align: \'right\', halign: \'center\', editor: { type: \'numberbox\', options: { precision: 2}} },
                { field: \'tb_ddw_ws\', title: \'大单价(未税)\', width: 100, align: \'right\', halign: \'center\', editor: { type: \'numberbox\', options: { precision: 2}} },
                { field: \'tb_je_hs\', title: \'金额(含税)\', width: 80, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_je_ws\', title: \'金额(未税)\', width: 80, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_shuilv\', title: \'税率\', width: 50, align: \'right\', halign: \'center\', editor: { type: \'numberbox\', options: { precision: 2}} },
                { field: \'tb_shuie\', title: \'税额\', width: 50, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_zhekou\', title: \'折扣\', width: 50, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_zkje\', title: \'折扣金额\', width: 80, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'tb_jsje\', title: \'结算金额\', width: 80, align: \'right\', halign: \'center\', editor: { type: \'numberbox\', options: { precision: 2}} },
                { field: \'tb_beizhu\', title: \'备注\', width: 120, align: \'right\', halign: \'center\', editor: \'text\' },
                { field: \'operation\', title: \'操作\', width: 60, align: \'center\', halign: \'center\', formatter: addOperationRow },
                { field: \'yongdadanwei\', title: \'用大单位\', hide: true },
                { field: \'hanshui\', title: \'含税\', hide: true }
            ]],
            showFooter: true, //尾行显示
            onLoadSuccess: function (data) {
                var length = myMulti_dg.datagrid(\'getRows\').length;
                for (var i = 0; i < 6 - length; i++) {
                    console.log(111);
                    addRow(); //添加空白行
                }
                formatMoney();
            },
            onClickCell: function (index, field) {
                //获取焦点
                var editors = myMulti_dg.datagrid(\'getEditors\', index);
                var nowEditor = editors[0];
                nowEditor.target[0].select();
                //双击
                if (field == \'Goods_Code\' || field == \'Goods_Name\' || field == \'Goods_Number\')
                    myonClickCell(index, field)

            },
            fixed: true,
            rownumbers: true,
            hidecolumns: [
            [\'tb_guige\', \'tb_Type\', \'Goods_Aear\', \'tb_beizhu\', \'yongdadanwei\', \'hanshui\'],
            [\'显示规格\', \'显示型号\', \'显示产地\', \'显示备注\', \'用大单位\', \'含税\']]//隐藏列配置
        });

        //添加数据表格操作列
        function addOperationRow(val, row, index) {
            return \'<div style="margin-top:4px"><a href="javascript:void(0);" onclick="addRow()">\' +
                               \'<img src="../../Images/hdj_cwgl/add_green.png" width="16px" height="16px" alt="添加" title="添加"/></a>&nbsp;\' +
                               \'<a href="javascript:void(0);" onclick="delRow(\' + index + \')">\' +
                               \'<img src="../../Images/hdj_cwgl/delete_red.png" width="16px" height="16px" alt="删除" title="删除"/></a></div>\';
        }
       //显示隐藏逻辑
        myMulti_dg.datagrid(\'showHidecolumns\'); //显示and隐藏列功能

        var addRow = function () {
            myMulti_dg.datagrid(\'appendRow\', {});
        };
        var delRow = function (index) {
            myMulti_dg.datagrid(\'deleteRow\', index);
        };
        //自动求and格式化(求和列:tb_je_hs,tb_je_ws,tb_Number,tb_sjkc,tb_Number_ddw)
        function formatMoney() {
            var rows = myMulti_dg.datagrid(\'getRows\');
            var tb_je_hs_total = 0;
            var tb_je_ws_total = 0;
            var tb_Number_total = 0;
            var tb_Number_ddw_total = 0;
            var tb_sjkc_total = 0;
            for (var i = 0; i < rows.length; i++) {
                tb_je_hs_total += isNaN(parseFloat(rows[i]["tb_je_hs"])) ? 0 : parseFloat(rows[i]["tb_je_hs"]);
                tb_je_ws_total += isNaN(parseFloat(rows[i]["tb_je_ws"])) ? 0 : parseFloat(rows[i]["tb_je_ws"]);
                tb_Number_total += isNaN(parseFloat(rows[i]["tb_Number"])) ? 0 : parseFloat(rows[i]["tb_Number"]);
                tb_Number_ddw_total += isNaN(parseFloat(rows[i]["tb_Number_ddw"])) ? 0 : parseFloat(rows[i]["tb_Number_ddw"]);
                tb_sjkc_total += isNaN(parseFloat(rows[i]["tb_sjkc"])) ? 0 : parseFloat(rows[i]["tb_sjkc"]);
            }
            var footRows = myMulti_dg.datagrid(\'getFooterRows\');
            footRows[0].tb_je_hs = toDecimal2(tb_je_hs_total);
            footRows[0].tb_je_ws = toDecimal2(tb_je_ws_total);
            footRows[0].tb_Number = tb_Number_total;
            footRows[0].tb_Number_ddw = tb_Number_ddw_total;
            footRows[0].tb_sjkc = tb_sjkc_total;
            myMulti_dg.datagrid(\'reloadFooter\', footRows);
        };
        //制保留2位小数,如:2,会在2后面补上00.即2.00          
        function toDecimal2(x) {
            var f = parseFloat(x);
            if (isNaN(f)) {
                return 0.00;
            }
            var f = Math.round(x * 100) / 100;
            var s = f.toString();
            var rs = s.indexOf(\'.\');
            if (rs < 0) {
                rs = s.length;
                s += \'.\';
            }
            while (s.length <= rs + 2) {
                s += \'0\';
            }
            return s;
        };
        //选择税率后修改表单
        $("#ddlType_Shuilv").combobox({
            onSelect: function (rec) {
                console.log(rec.value);
                var obj = myMulti_dg.datagrid(\'getData\').rows;
                console.log(obj);
                for (var i = 0; i < obj.length; i++) {
                    if (obj[i].Goods_Code != "" && "Goods_Code" in obj[i]) {
                        obj[i].tb_shuilv = rec.value; //更改税率
         

以上是关于easyUI 多功能datagrid 用户控件的主要内容,如果未能解决你的问题,请参考以下文章

Jquery EasyUI Editable DataGrid如何绑定combogrid控件

基于MVC4+EasyUI的Web开发框架经验总结(13)--DataGrid控件实现自己主动适应宽带高度

解决EasyUI DataGrid删除行失败的方法

EasyUI:datagrid控件简介

为啥easyui-datagrid分页控件把所有的都遮住了?

为啥easyui-datagrid分页控件把所有的都遮住了?