{ "type" : "page", "title" : "库初始化凭证编辑页面", "body" : { "type" : "form", "id" : "eip4-edit-form", "title" : "", "mode" : "horizontal", "horizontal" : { "leftFixed" : 120 }, "body" : [ { "type" : "grid", "columns" : [ { "md" : 4, "body" : [ { "name" : "NUMBER", "label" : "凭证编号", "required" : true, "type" : "input-text" } ] }, { "md" : 4, "body" : [ { "name" : "STORE_ID", "label" : "办公用品库", "required" : true, "type" : "select", "clearable" : true, "source" : "/api/picker/OA_OFFICE_STOREHOUSE/list?perPage=500" } ] }, { "md" : 4, "body" : [ { "name" : "REGISTER_USER", "label" : "登记人", "type" : "static", "tpl" : "${REGISTER_USER_DISPLAY__ ? REGISTER_USER_DISPLAY__ : (DISPLAYNAME ? DISPLAYNAME : REGISTER_USER)}", "value" : "${currentUser}" } ] } ] }, { "type" : "grid", "columns" : [ { "md" : 12, "body" : [ { "type" : "flex", "justify" : "flex-start", "alignItems" : "center", "style" : { "paddingLeft" : "120px", "marginBottom" : "4px" }, "items" : [ { "name" : "SELECT", "label" : "添加", "type" : "button", "level" : "primary", "actionType" : "dialog", "dialog" : { "type" : "dialog", "id" : "egadddlgSELECT", "title" : "", "size" : "lg", "body" : { "type" : "crud", "api" : "/api/picker/2a863c20-3d71-4481-9eb3-846b1a1d28e2/list", "mode" : "table", "syncLocation" : false, "selectable" : true, "multiple" : true, "keepItemSelectionOnPageChange" : true, "primaryField" : "_id", "labelField" : "_label", "headerToolbar" : [ { "type" : "search-box", "placeholder" : "输入关键字搜索", "name" : "q" } ], "footerToolbar" : [ "pagination" ], "onEvent" : { "selectedChange" : { "actions" : [ { "actionType" : "setValue", "componentId" : "egadddlgSELECT", "args" : { "value" : { "__egpicked" : "${event.data.selectedItems}" } } } ] } } }, "actions" : [ { "type" : "button", "label" : "取消", "actionType" : "close" }, { "type" : "button", "label" : "确定", "level" : "primary", "onEvent" : { "click" : { "actions" : [ { "actionType" : "addItem", "componentId" : "eg-GOODSDETAIL", "args" : { "item" : "${ARRAYMAP(__egpicked, item => ({GOODS_ID: item.OA_OFFICE_GOODS_ID, GOODS_ID_DISPLAY__: item._label, GOODS_NAME: item.GOODS_NAME, GOODS_STANDARD: item.GOODS_STANDARD, GOODS_UNIT: item.GOODS_UNIT}))}" } }, { "actionType" : "closeDialog" } ] } } } ] }, "hiddenOn" : "${__readonly}" } ] }, { "name" : "GOODSDETAIL", "label" : "现有用品", "required" : true, "type" : "input-table", "id" : "eg-GOODSDETAIL", "addable" : false, "removable" : true, "staticOn" : "${__readonly}", "columns" : [ { "name" : "GOODS_ID", "label" : "用品名称", "type" : "tpl", "tpl" : "${GOODS_ID_DISPLAY__ ? GOODS_ID_DISPLAY__ : GOODS_ID}", "quickEdit" : false }, { "name" : "GOODS_STANDARD", "label" : "规格", "quickEdit" : { "name" : "GOODS_STANDARD", "disabled" : true, "type" : "input-text" } }, { "name" : "GOODS_UNIT", "label" : "计量单位", "quickEdit" : { "name" : "GOODS_UNIT", "disabled" : true, "type" : "input-text" } }, { "name" : "IN_AMOUNT", "label" : "数量", "quickEdit" : { "name" : "IN_AMOUNT", "required" : true, "type" : "input-number", "precision" : 0, "step" : 1, "max" : 9999999, "onEvent" : { "change" : { "actions" : [ { "actionType" : "ajax", "outputVar" : "egRow", "args" : { "api" : { "method" : "post", "url" : "/api/script/execute-editgrid-row", "data" : { "templateId" : "142c2d66-c377-48fd-bc19-3874c407e1b6", "editgridField" : "GOODSDETAIL", "scriptKey" : "4f1c334b-f4c9-44ac-8ff0-2ddde1f98914", "changedField" : "IN_AMOUNT", "row" : "${__rendererData}", "parent" : { "GOODSDETAIL" : "${__rendererData.GOODSDETAIL || GOODSDETAIL}" } } } } }, { "actionType" : "setValue", "componentId" : "eg-GOODSDETAIL", "args" : { "index" : "${index}", "value" : "${egRow.rowSetValues}" } }, { "actionType" : "setValue", "componentId" : "eip4-edit-form", "args" : { "value" : "${egRow.parentSetValues}" } } ] } } } }, { "name" : "PRICE", "label" : "单价(元)", "quickEdit" : { "name" : "PRICE", "type" : "input-number", "precision" : 2, "max" : 9999999.99, "onEvent" : { "change" : { "actions" : [ { "actionType" : "ajax", "outputVar" : "egRow", "args" : { "api" : { "method" : "post", "url" : "/api/script/execute-editgrid-row", "data" : { "templateId" : "142c2d66-c377-48fd-bc19-3874c407e1b6", "editgridField" : "GOODSDETAIL", "scriptKey" : "4f1c334b-f4c9-44ac-8ff0-2ddde1f98914", "changedField" : "PRICE", "row" : "${__rendererData}", "parent" : { "GOODSDETAIL" : "${__rendererData.GOODSDETAIL || GOODSDETAIL}" } } } } }, { "actionType" : "setValue", "componentId" : "eg-GOODSDETAIL", "args" : { "index" : "${index}", "value" : "${egRow.rowSetValues}" } }, { "actionType" : "setValue", "componentId" : "eip4-edit-form", "args" : { "value" : "${egRow.parentSetValues}" } } ] } } } }, { "name" : "COUNTPRICE", "label" : "金额(元)", "quickEdit" : { "name" : "COUNTPRICE", "disabled" : true, "type" : "input-number", "precision" : 2, "max" : 9.9999999999E8 } } ], "needConfirm" : false } ] } ] }, { "type" : "grid", "columns" : [ { "md" : 12, "body" : [ { "name" : "REMARK", "label" : "备注", "type" : "textarea" } ] } ] }, { "name" : "OA_OFFICE_GOODS_INITIALIZEVOUCHER_ID", "label" : "主键", "hidden" : true, "type" : "input-text" }, { "name" : "REGISTER_DATE", "label" : "登记日期", "hidden" : true, "type" : "input-date", "value" : "${now}" }, { "name" : "ISKEEPACCOUNT", "label" : "是否记账", "required" : true, "hidden" : true, "type" : "select", "clearable" : true, "source" : "/api/poc/dict/YESNO", "value" : "0" }, { "type" : "group", "body" : [ ] } ], "actions" : [ ] } }