|
楼主 |
发表于 2017-6-6 10:45:08
|
显示全部楼层
本帖最后由 qweasdzxc 于 2017-6-6 10:46 编辑
改成下面也不行啊!
你直接告诉我要怎么改啊,我也参考过了,老让我参考我也不知道到底什么地方错。
- if (row && '草稿' == row.val("fApprovedState")) {
- this.advanceFlow();
-
- // var url =
- // '$UI/SAM/assetManage/process/assetin/mainActivity.a?process=/SAM/assetManage/process/assetin/assetinProcess&activity=mainActivity&oppType=edit&sData1='+row.getID();
- // justep.Shell.showPage({url:url, title: '资产入库单'});
- // this.startFlow();
- } else {
- _this.comp("messageDialog").show({
- message : "操作无效!"
- });
- }
- Model.prototype.startFlow = function() {
- var p = this.comp("process1");
- var mainData = this.comp("mainData");
- p.start("/SAM/assetManage/process/assetin/assetinProcess", mainData.getValue("fName") + "资产入库", mainData.getCurrentRowID(), null);
- };
- Model.prototype.advanceFlow = function() {
- var dList = this.comp("mainData");
- var sData1 = dList.getCurrentRowID();
- var context = this.getContext();
- // 定义action参数,请求taskDataAction获取当前环节的数据信息
- var param = new biz.Request.ActionParam();
- var taskRows = "";
- param.setString("sData1", sData1);
- biz.Request.sendBizRequest({
- "context" : context,
- "action" : "taskDataAction",
- "parameters" : param,
- "callback" : function(callbackData) {
- if (callbackData.state) {
- taskRows = callbackData.response.rows;
- } else
- alert("任务数据获取失败");
- }
- });
- // 当有数据返回时获取第一条的信息进行处理
- if (taskRows.length > 0) {
- var title = taskRows[0].sActivityName.value;// 获得当前环节名称,作为页面的标题
- var taskID = taskRows[0].task.value;// 获得任务ID,url中的参数
- var url = taskRows[0].sEURL.value;// 获得当前环节的url
- var status = taskRows[0].sStatusID.value;
- var executorFID = taskRows[0].sExecutorFID.value;
- var executorPersonID = taskRows[0].sExecutorPersonID.value;
- url = url + "?task=" + taskID + "&_pagePattern=write";// _pagePattern=write是必须的,表示要处理这个任务
- if (executorPersonID === context.getCurrentPersonID()) {// 如果执行者是否当前人
- justep.Shell.showPage({
- url : url,
- title : title
- }); // 调用justep.Shell.showPage方法打开流程当前环节对应的w文件
- } else {
- var sFIDs = context.getAllPersonMemberFIDs()
- if (status === "tesReady" && (sFIDs.toString().indexOf(executorFID) > -1)) {// 判断执行者是否是当前操作者的所有人员成员所在的组织
- var executor = "";
- var params = new biz.Request.ActionParam();
- params.setString("task", taskID);
- params.setString("executor", executorFID);
- var options = {};
- options.context = this.getContext();
- options.action = "executeTaskAction";
- options.parameters = params;
- options.directExecute = true;
- options.callback = function(options) {
- if (options.state) {
- executor = options.response;
- } else {
- options.ignoreError = false;
- }
- };
- biz.Request.sendBizRequest(options);
- justep.Shell.showPage({
- url : url,
- title : title,
- executor : executor || ""
- });
- } else {
- alert("任务应由其他人处理");
- }
- }
- } else {
- this.startFlow();
- }
- };
复制代码
|
|