|
@@ -0,0 +1,78 @@
|
|
|
+(function () {
|
|
|
+ z.ui.comp.init($("[name=search]"));
|
|
|
+ bindGrid();
|
|
|
+ bindEvents();
|
|
|
+
|
|
|
+
|
|
|
+ function bindEvents() {
|
|
|
+ $("div[name=searchBtn]").on("click", function () {
|
|
|
+ reloadGrid(true);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function confirm(id) {
|
|
|
+ z.ui.loading(true, true);
|
|
|
+ z.ui.ajax({
|
|
|
+ url: z.ui.comm.getEntranceUrl("/contract"),
|
|
|
+ data: {id:id},
|
|
|
+ type: 'get',
|
|
|
+ success: function (result) {
|
|
|
+ z.ui.loading(false);
|
|
|
+ if(result){
|
|
|
+ z.ui.modal("milestoneModal").close(result);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function reloadGrid(iBackToFirstPage) {
|
|
|
+ z.ui.jqgrid("[name=grid]").setGridParam({
|
|
|
+ reloadfirstpage:iBackToFirstPage,
|
|
|
+ postData: z.ui.form.childStringify(z.ui.form.getFormFields($("[name=search]")))
|
|
|
+ }).trigger("reloadGrid");
|
|
|
+ }
|
|
|
+
|
|
|
+ function bindGrid() {
|
|
|
+ var postdata = z.ui.form.getFormFields($("[name=search]"));
|
|
|
+ z.ui.jqgrid("[name=grid]").init({
|
|
|
+ multiselect: false,
|
|
|
+ shrinkToFit:true,//设置表格自适应
|
|
|
+ url: z.ui.comm.getEntranceUrl('/flow/contract/milestone/page'),
|
|
|
+ postData: z.ui.form.childStringify(postdata),
|
|
|
+ colModel: [
|
|
|
+ {
|
|
|
+ label: "操作", name: 'action',align:"center", width: 100,frozen: true, fixed: true,
|
|
|
+ buttons:
|
|
|
+ [
|
|
|
+ {
|
|
|
+ label: "<i class =\"fa fa-pencil\"> </i> 选择",
|
|
|
+ className: "btn btn-info",
|
|
|
+ onClick: function (rowObject, rowindex) {
|
|
|
+ confirm(rowObject.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {name: "id", hidden: true, key: true},
|
|
|
+ {label: '合同名称', name: "name", width: 200},
|
|
|
+ {label: '合同编号', name: "contractNumber",align:"center", width: 150},
|
|
|
+ {label: '合同金额', name: "contractAmount",align:"center", width: 150},
|
|
|
+ {label: '合同余额', name: "contractBalance",align:"center", width: 150},
|
|
|
+ {label: '已开票金额', name: "invoicedAmount",align:"center", width: 150}
|
|
|
+ ],
|
|
|
+ loadComplete: function (xhr) {
|
|
|
+ $(".jqgfirstrow").find("td:first").css("width", "50");
|
|
|
+ $("th[id$=_rn]").each(function () {
|
|
|
+ $(this).css("width", "50");
|
|
|
+ });
|
|
|
+ $("td[aria-describedby$=_rn]").each(function () {
|
|
|
+ $(this).css("width", "50");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ ondblClickRow: function (rowid, iRow, iCol, e) {
|
|
|
+ var rowData = z.ui.jqgrid("[name=grid]").getRowData(rowid);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+}());
|