123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- define(function (require) {
- return function (context) {
- var $dlg, $form;
- //获取平台列表
- function getSysList() {
- var _datas = [];
- $.yvan.ajax({
- url: api('/sys/system/query'),
- data: {status: 1},
- method: 'post',
- async: false,
- success: function (data) {
- if (data.data != null && data.data != undefined) {
- for (var i = 0; i < data.data.length; i++) {
- _datas.push({
- "id": data.data[i].sysId,
- "text": data.data[i].sysName
- })
- }
- }
- }
- });
- return _datas;
- }
- return {
- xtype: 'dialog',
- dialogId: 'dialogWf',
- title: '业务流程信息',
- width: 620,
- height: 300,
- onOpen: function () {
- $dlg = $(this);
- if (context.isEdit) {
- $.yvan.ajax({
- loadingMask: false,
- url: api('/sys/wf/getById'),
- type: 'GET',
- data: {
- wfId: context.wfId
- },
- success: function (data) {
- $dlg.find('form');
- $form.formSet(data.data);
- }
- });
- } else {
- $form.formSet({
- status: '1',
- sysId: context.sysId
- });
- }
- },
- center: {
- items: {
- xtype: 'formgroup',
- onRender: function () {
- $form = $(this);
- },
- items: [
- [
- {
- name: 'sysId',
- label: '所属平台',
- xtype: 'yvselect',
- required: true,
- disabled: context.isEdit ? "disabled" : "",
- data: getSysList()
- },
- {
- name: 'status',
- label: '启用状态',
- xtype: 'yvselect',
- required: true,
- data: $.yvan.sysDict('status').combo()
- },
- ],
- [
- {name: 'wfId', xtype: 'hidden'},
- {name: 'wfName', label: '流程名称', required: true},
- {name: 'wfCode', label: '流程编码', required: true}
- ],
- [
- {
- name: 'wfDesp', label: '流程说明', span: 2, height: '60px', multiline: true
- }
- ]
- ]
- }
- },
- buttons: [
- {
- text: "提交", iconCls: "fa fa-save", onClick: function () {
- $.yvan.postForm($form, {
- url: (context.isEdit ? api('/sys/wf/update') : api('/sys/wf/insert')),
- success: function () {
- $.yvan.msg('操作成功');
- if (context.isEdit) {
- $dlg.window('close');
- }
- if ($.type(context.confirm) === 'function') {
- context.confirm();
- }
- },
- error: function (data) {
- }
- });
- }
- }, {
- text: "关闭", iconCls: "fa fa-times", onClick: function () {
- $dlg.dialog('close');
- }
- }
- ]
- };
- };
- });
|