Files
PropertyDeployment/resources/Web/MicroCommunityWeb/html/pages/work/jobQuery/jobQuery.js
2025-12-09 20:22:03 +08:00

80 lines
2.7 KiB
JavaScript

(function(vc){
vc.extends({
data: {
cardDetailInfo: {
flowId: '',
userId: '',
domainId: '',
details: []
},
type: ''
},
_initMethod: function(){
let flowId = vc.getParam('flowId');
let type = vc.getParam('type');
$that.type = type;
if(!vc.notNull(flowId)){
vc.toast('非法操作');
vc.jumpToPage('/#/pages/work/jobQuery');
return;
}
$that.cardDetailInfo.flowId = flowId;
// 假数据初始化
let _json = {
"code":0,
"data":[
{
"domainId": type || 'card',
"flowId": flowId,
"userId": "302025081657620862",
"data": "[]" // 可替换为实际假数据
}
]
};
if(_json.data && _json.data.length>0){
$that.cardDetailInfo.domainId = _json.data[0].domainId;
$that.cardDetailInfo.userId = _json.data[0].userId;
$that.cardDetailInfo.details = _json.data.reduce((acc, it) => acc.concat(JSON.parse(it.data)), []);
}
},
methods:{
_goBack: function(){
vc.goBack();
},
_queryJob: function(flowId){
if(!flowId){
vc.toast('FlowId 不存在');
return;
}
vc.http.apiGet('/job.inMemoryStoreCmd', {params:{dataFlowId:flowId}},
function(json,res){
let result = JSON.parse(json);
if(result.data && result.data.length>0){
$that.cardDetailInfo.domainId = result.data[0].domainId;
$that.cardDetailInfo.userId = result.data[0].userId;
$that.cardDetailInfo.details = result.data.reduce((acc, it) => acc.concat(JSON.parse(it.data)), []);
}
},
function(errInfo,error){
console.log(errInfo);
}
)
},
moneyMethodText: function(code){
switch(code){
case '1001': return '现金支付';
case '1002': return '刷卡支付';
case '1003': return '线上支付';
default: return code || '-';
}
}
}
});
})(window.vc);