/ / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / /标题:接收——Auto雷竞技app-Assign工作指令/ /作者:侥幸校准/ /日期:2017-05-19 / / / /这数据检查工作指令/ /分配给技术人员根据工作区域字段/ /定义资产的类型。/ / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / * SQL函数:getuser选择nUserUID cUsername从用户那里lActive < > 0和lDeleted = 0 * / / /这个变量包含了之间的映射/团队/ /用户名和他们负责的学科。/ /注意,用户可以与多个学科有关。/ /学科应该匹配的条目类型。应该注意/ /下拉列表。var科技=[{用户名:“Admin”,纪律:“电子”},{用户名:“Admin”,纪律:“压力”},{用户名:“用户”,纪律:“机械”});var matchFound = false;/ /获取工作区域价值var应该= Model.cArea;/ /遍历技术变量,比较与应该注意(var = 0;我< tech.length;我+ +){/ /如果找到匹配项,设置国旗和调用setAssignedTech()函数如果(cArea.toLowerCase() = =技术[我].discipline.toLowerCase ()) {matchFound = true; setAssignedTech(tech[i].username); break; } } // If a match was not found, process the record. If a match is found, the pass // status is provided within the setAssignedTech() function. if (matchFound == false) { pass(); } function setAssignedTech(nameParam) { DataCheck.ExecuteSQL('getUsers', function(result) { // Compare the provided username with the list of usernames in the DB for (var j = 0; j < result.length; j++) { // If a match is found, update the cached memory on the page with // an explicit Assigned Technician value if (result[j].cUsername.toLowerCase() == nameParam.toLowerCase()) { $.ajax({ url:'/Receiving/UpdateMemoryCallSheet/', type: 'post', data: 'nAssetUID=' + Model.nAssetUID + '&nAssignedTechUID=' + result[j].nUserUID, async: false }); pass(); return; } } // If a matching user in the DB is not found, process anyways pass(); }); }