| | |
| | | view.get("#dialogImg").show();
 |
| | | 
 |
| | | };</ClientEvent> |
| | | <ClientEvent name="onReady">
 |
| | | // start 通过收储公司id来加载库区数据
 |
| | | /**
 |
| | | * 通用工具函数:获取URL中的指定参数值
 |
| | | * @param {String} name 要获取的参数名
 |
| | | * @returns {String/null} 参数值(无则返回null)
 |
| | | */
 |
| | | function getUrlParam(name) {
 |
| | | // 解析URL的查询字符串(?后面的部分)
 |
| | | var search = window.location.search.substring(1);
 |
| | | // 分割成键值对数组
 |
| | | var params = search.split("&");
 |
| | | for (var i = 0; i < params.length; i++) {
 |
| | | var pair = params[i].split("=");
 |
| | | // 解码参数值(处理中文/特殊字符)
 |
| | | if (decodeURIComponent(pair[0]) === name) {
 |
| | | return decodeURIComponent(pair[1] || "");
 |
| | | }
 |
| | | }
 |
| | | return null;
 |
| | | };
 |
| | | 
 |
| | | var parentId = getUrlParam("parentId");
 |
| | | console.log("parentId",parentId);
 |
| | | view.get("#dsMain").set("parameter",{parentId: parentId}).flushAsync();
 |
| | | //end 
 |
| | | 
 |
| | | /**
 |
| | | * 查看详情
 |
| | | * @param {String/Number} manualId 手动传入的id值(可选)
 |
| | | */
 |
| | | detail = function(manualId){
 |
| | | // 优先使用手动传入的id,没有则走原有选中行逻辑
 |
| | | var id = manualId;
 |
| | | if(!id){
 |
| | | var cur = view.get("#dgMain").get("selection");
 |
| | | if(cur){
 |
| | | id = cur.get("id");
 |
| | | }
 |
| | | }
 |
| | | 
 |
| | | // 有id则打开详情页,否则提示
 |
| | | if(id){
 |
| | | var url = "/com.fzzy.igds.Depot.d?parentId="+ id;
 |
| | | window.$openTab("仓库管理", url);
 |
| | | }else{
 |
| | | $notify("请先选择库区……");
 |
| | | }
 |
| | | };
 |
| | | 
 |
| | | renderId = function(arg){
 |
| | | var txt = arg.data.getText("id");
 |
| | | if(!txt) return true;
 |
| | | // 关键修改:点击时把txt作为参数传给detail方法(注意转义双引号)
 |
| | | var htm = "<a href='javascript:;' onClick='detail(\""+txt+"\")' >"+txt+"</a>";
 |
| | | arg.dom.innerHTML = htm;
 |
| | | }
 |
| | | </ClientEvent> |
| | | <Property name="packages">font-awesome,css-common</Property> |
| | | <DataSet id="dsMain"> |
| | | <Property name="dataProvider">deptPR#getData</Property> |
| | | <Property name="dataType">[dtMain]</Property> |
| | | <Property name="loadMode">manual</Property> |
| | | </DataSet> |
| | | <Container> |
| | | <Property name="className">c-param</Property> |
| | |
| | | <RowSelectorColumn/> |
| | | <RowNumColumn/> |
| | | <DataColumn name="id"> |
| | | <ClientEvent name="onRenderCell">renderId(arg);</ClientEvent> |
| | | <Property name="property">id</Property> |
| | | <Property name="align">center</Property> |
| | | <Property name="width">160</Property> |