ChildForm.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. /**
  2. * Created by zhouy on 2018/10/18.
  3. */
  4. Ext.define('KitchenSink.view.binding.ChildForm', {
  5. extend: 'Ext.window.Window',
  6. xtype: 'document-kind-childwin',
  7. cls:'x-window-dbfind',
  8. layout: 'fit',
  9. modal: true,
  10. width: 500,
  11. //工具类
  12. height: 280,
  13. listeners:{
  14. show:function(w){
  15. //自动适应窗口
  16. var items = w.down('form').items.items;
  17. var count = 0;
  18. var codeField;
  19. Ext.Array.each(items,function(item) {
  20. if(item.xtype!='hidden'){
  21. count++;
  22. }
  23. if(item.autoCode){
  24. codeField = item.name
  25. }
  26. });
  27. if(count!=0&&count<4){
  28. w.setHeight(114+40*count)
  29. }
  30. if(w.record){
  31. w.down('form').loadRecord(w.record);
  32. }else{
  33. //判断是否有code字段
  34. if(codeField){
  35. w.setLoading(true);
  36. //取后台编号
  37. var caller = w._parent.caller;
  38. saas.util.BaseUtil.request({
  39. url: '/api/commons/number/getMaxnumber',
  40. headers: {
  41. "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
  42. },
  43. params: {
  44. caller:caller
  45. },
  46. method: 'POST',
  47. }).then(function(res) {
  48. w.setLoading(false);
  49. if(res.success){
  50. w.down('[name='+codeField+']').setValue(res.data);
  51. }else {
  52. saas.util.BaseUtil.showErrorToast(res.message);
  53. }
  54. }).catch(function(res) {
  55. saas.util.BaseUtil.showErrorToast(res.message);
  56. w.setLoading(true);
  57. })
  58. }
  59. }
  60. }
  61. },
  62. initComponent:function(){
  63. var me=this;
  64. Ext.apply(me,{
  65. items:me.setFormItems()
  66. });
  67. me.callParent();
  68. },
  69. etc:{
  70. customerkind:{
  71. items:[{
  72. xtype:'hidden',
  73. name:'id'
  74. },{
  75. xtype:'textfield',
  76. name:'ck_name',
  77. allowBlank:false,
  78. fieldLabel:'客户类型',
  79. maxLength: 20
  80. }]
  81. },
  82. vendorkind:{
  83. items:[{
  84. xtype:'hidden',
  85. name:'id'
  86. },{
  87. xtype:'textfield',
  88. name:'vk_name',
  89. allowBlank:false,
  90. fieldLabel:'供应商类型',
  91. maxLength: 20
  92. }]
  93. },
  94. productkind:{
  95. items:[{
  96. xtype:'hidden',
  97. name:'id'
  98. },{
  99. xtype:'textfield',
  100. name:'pt_name',
  101. allowBlank:false,
  102. fieldLabel:'物料类型',
  103. maxLength: 20
  104. }]
  105. },
  106. personpower:{
  107. items:[{
  108. xtype:'hidden',
  109. name:'id'
  110. },{
  111. xtype:'textfield',
  112. name:'name',
  113. allowBlank:false,
  114. fieldLabel:'角色名称',
  115. maxLength: 20
  116. },{
  117. xtype:'textfield',
  118. name:'description',
  119. allowBlank:false,
  120. fieldLabel:'角色描述',
  121. maxLength: 20
  122. },{
  123. xtype:'textfield',
  124. hidden:true,
  125. name:'code',
  126. allowBlank:true,
  127. fieldLabel:'角色编号',
  128. maxLength: 20
  129. }]
  130. },
  131. bankinformation:{
  132. items:[{
  133. xtype:'hidden',
  134. name:'id'
  135. },{
  136. xtype:'textfield',
  137. name:'bk_bankcode',
  138. allowBlank:false,
  139. fieldLabel:'账户编号',
  140. autoCode:true,
  141. maxLength: 20
  142. },{
  143. xtype:'textfield',
  144. name:'bk_bankname',
  145. allowBlank:false,
  146. fieldLabel:'账户名称',
  147. maxLength: 20
  148. },{
  149. xtype:'numberfield',
  150. name:'bk_beginamount',
  151. allowBlank:false,
  152. fieldLabel:'期初金额',
  153. hideTrigger: true,
  154. mouseWheelEnabled: false,
  155. minValue: 0,
  156. maxLength:15,
  157. decimalPrecision:2,
  158. enforceMaxLength:true
  159. },
  160. // {
  161. // xtype:'numberfield',
  162. // name:'bk_thisamount',
  163. // allowBlank:true,
  164. // fieldLabel:'当前余额',
  165. // hideTrigger: true,
  166. // mouseWheelEnabled: false,
  167. // beforeLabelTextTpl:'',
  168. // minValue: 0
  169. // }
  170. // ,
  171. {
  172. xtype:'combo',
  173. name:'bk_type',
  174. allowBlank:false,
  175. editable:false,
  176. fieldLabel:'账户类别',
  177. store: [
  178. '现金',
  179. '银行'
  180. ]
  181. },{
  182. xtype:'datefield',
  183. name:'bk_date',
  184. fieldLabel:'建账日期',
  185. format:'Y-m-d',
  186. listeners:{
  187. beforerender:function(d){
  188. d.setValue(new Date())
  189. }
  190. }
  191. }, {
  192. xtype:'textfield',
  193. name:'bk_remark',
  194. allowBlank:true,
  195. fieldLabel:'备注',
  196. beforeLabelTextTpl:''
  197. }]
  198. },
  199. productbrand:{
  200. items:[{
  201. xtype:'hidden',
  202. name:'id'
  203. },{
  204. xtype:'textfield',
  205. name:'pb_name',
  206. allowBlank:false,
  207. fieldLabel:'物料品牌',
  208. maxLength: 20
  209. }]
  210. },
  211. productunit:{
  212. items:[{
  213. xtype:'hidden',
  214. name:'id'
  215. },{
  216. xtype:'textfield',
  217. name:'pu_name',
  218. allowBlank:false,
  219. fieldLabel:'计量单位',
  220. maxLength: 20
  221. }]
  222. },
  223. inoutkind:{
  224. items:[{
  225. xtype:'hidden',
  226. name:'id'
  227. },{
  228. xtype:'textfield',
  229. name:'ft_name',
  230. allowBlank:false,
  231. fieldLabel:'收支名称',
  232. maxLength: 20
  233. },{
  234. xtype:'combo',
  235. name:'ft_kind',
  236. allowBlank:false,
  237. fieldLabel:'收支类型',
  238. hideTrigger : false,
  239. maxLength : 100.0,
  240. minValue : null,
  241. positiveNum : false,
  242. queryMode : "local",
  243. valueField : "value",
  244. xtype : "combo",
  245. editable:false,
  246. displayField : "display",
  247. store:{
  248. fields: ['display', 'value'],
  249. data : [
  250. {"display":"收入", "value":'收入'},
  251. {"display":"支出", "value":'支出'}
  252. ]
  253. }
  254. }]
  255. },
  256. address:{
  257. items:[{
  258. xtype:'hidden',
  259. name:'id'
  260. },{
  261. xtype:'textfield',
  262. name:'ad_address',
  263. allowBlank:false,
  264. fieldLabel:'地址详情',
  265. maxLength: 200
  266. }]
  267. },
  268. accountinformation:{
  269. items:[{
  270. xtype:'hidden',
  271. name:'accountId',
  272. hidden:true,
  273. },{
  274. xtype:'textfield',
  275. fieldLabel: '真实姓名',
  276. name: 'realname',
  277. readOnly:true,
  278. editable:false,
  279. allowBlank:true,
  280. maxLength: 30,
  281. beforeLabelTextTpl: "",
  282. },{
  283. xtype:'datamulticombo',
  284. dataUrl:'/api/account/role/list',
  285. fieldLabel: '关联角色',
  286. name: 'roleNames',
  287. allowBlank:true,
  288. maxLength: 20,
  289. beforeLabelTextTpl: "",
  290. },{
  291. xtype:'textfield',
  292. fieldLabel: '联系电话',
  293. name: 'mobile',
  294. readOnly:true,
  295. editable:false,
  296. allowBlank:true,
  297. maxLength: 30,
  298. beforeLabelTextTpl: "",
  299. },{
  300. xtype:'textfield',
  301. fieldLabel: '邮箱',
  302. name: 'email',
  303. readOnly:true,
  304. editable:false,
  305. allowBlank:true,
  306. maxLength: 30,
  307. beforeLabelTextTpl: "",
  308. }]
  309. },
  310. accountadd:{
  311. items:[{
  312. xtype:'textfield',
  313. fieldLabel: '联系号码',
  314. name: 'mobile',
  315. hideTrigger:true,
  316. allowBlank:false,
  317. maxLength: 30,
  318. regex:/^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/,
  319. regexText:'请输入正确的手机号码',
  320. listeners:{
  321. blur:function(f,a,b,c){
  322. var form = f.ownerCt;
  323. if(f.value&&f.value!=''&&f.isValid()&&f._lastCheckValue!=f.value){
  324. form.setLoading(true);
  325. f._lastCheckValue = f.value
  326. Ext.Ajax.request({
  327. url: '/api/account/account/checkMobile?mobile='+f.value,
  328. method: 'GET',
  329. headers:{
  330. 'Access-Control-Allow-Origin': '*',
  331. "Content-Type": 'application/json;charset=UTF-8'
  332. },
  333. success: function (response) {
  334. form.setLoading(false);
  335. var localJson = Ext.decode(response.responseText);
  336. if(localJson.success){
  337. if(localJson.data.hasRegister){
  338. saas.util.BaseUtil.showSuccessToast('校验成功:手机号已在优软云注册');
  339. }else{
  340. saas.util.BaseUtil.showErrorToast('校验失败:手机号未在优软云注册');
  341. f.setValue('');
  342. }
  343. }else{
  344. saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
  345. f.setValue('');
  346. }
  347. },
  348. failure: function (response) {
  349. if(response.responseText){
  350. var localJson = Ext.decode(response.responseText);
  351. saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
  352. f.setValue('');
  353. }else{
  354. saas.util.BaseUtil.showErrorToast('手机号校验接口连接超时');
  355. f.setValue('');
  356. }
  357. }
  358. });
  359. }
  360. }
  361. }
  362. },{
  363. xtype:'textfield',
  364. fieldLabel: '真实姓名',
  365. name: 'realname',
  366. allowBlank:false,
  367. maxLength: 30,
  368. },{
  369. xtype:'textfield',
  370. fieldLabel: '邮箱',
  371. name: 'email',
  372. allowBlank:true,
  373. beforeLabelTextTpl: "",
  374. regex:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
  375. regexText:'请输入正确的邮箱',
  376. maxLength: 30,
  377. listeners:{
  378. blur:function(f,a,b,c){
  379. var form = f.ownerCt;
  380. if(f.value&&f.value!=''&&f.isValid()&&f._lastCheckValue!=f.value){
  381. form.setLoading(true);
  382. f._lastCheckValue = f.value
  383. Ext.Ajax.request({
  384. url: '/api/account/account/checkEmail?email='+f.value,
  385. method: 'GET',
  386. headers:{
  387. 'Access-Control-Allow-Origin': '*',
  388. "Content-Type": 'application/json;charset=UTF-8'
  389. },
  390. success: function (response) {
  391. form.setLoading(false);
  392. var localJson = Ext.decode(response.responseText);
  393. if(localJson.success){
  394. if(!localJson.data){
  395. saas.util.BaseUtil.showSuccessToast('校验成功:邮箱未注册');
  396. }else{
  397. saas.util.BaseUtil.showErrorToast('校验失败:该邮箱已被注册');
  398. f.setValue('');
  399. }
  400. }else{
  401. saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
  402. }
  403. },
  404. failure: function (response) {
  405. if(response.responseText){
  406. var localJson = Ext.decode(response.responseText);
  407. saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
  408. }else{
  409. saas.util.BaseUtil.showErrorToast('邮箱校验接口连接超时');
  410. }
  411. }
  412. });
  413. }
  414. }
  415. }
  416. },{
  417. xtype:'datamulticombo',
  418. dataUrl:'/api/account/role/list',
  419. fieldLabel: '关联角色',
  420. name: 'roleIds',
  421. allowBlank:false,
  422. maxLength: 30,
  423. }]
  424. },
  425. warehouse:{
  426. items:[{
  427. xtype:'hidden',
  428. name:'id'
  429. },{
  430. xtype:'textfield',
  431. fieldLabel: '仓库编号',
  432. name: 'wh_code',
  433. autoCode:true,
  434. allowBlank:false,
  435. maxLength: 20
  436. },{
  437. xtype:'textfield',
  438. fieldLabel: '仓库名称',
  439. name: 'wh_description',
  440. allowBlank:false,
  441. maxLength: 20
  442. },{
  443. xtype:'combo',
  444. fieldLabel: '仓库类型',
  445. name: 'wh_type',
  446. allowBlank:false,
  447. displayField : "display",
  448. editable:false,
  449. hideTrigger : false,
  450. maxLength : 100.0,
  451. minValue : null,
  452. positiveNum : false,
  453. queryMode : "local",
  454. valueField : "value",
  455. store:{
  456. fields: ['display', 'value'],
  457. data : [
  458. {"display":"良品仓", "value":'良品仓'},
  459. {"display":"不良品仓", "value":'不良品仓'}
  460. ]
  461. }
  462. },{
  463. readOnly:true,
  464. xtype:'textfield',
  465. fieldLabel: '仓库状态',
  466. name: 'wh_status',
  467. value:'已开启',
  468. maxLength: 20
  469. },{
  470. xtype:'hidden',
  471. fieldLabel: '仓库状态码',
  472. name: 'wh_statuscode',
  473. value:'OPEN'
  474. }]
  475. },
  476. employee:{
  477. items:[{
  478. xtype:'hidden',
  479. name:'id'
  480. },{
  481. xtype:'textfield',
  482. fieldLabel: '人员编号',
  483. autoCode:true,
  484. name: 'em_code',
  485. allowBlank:false,
  486. maxLength: 20
  487. },{
  488. xtype:'textfield',
  489. fieldLabel: '人员名称',
  490. name: 'em_name',
  491. allowBlank:false,
  492. maxLength: 20
  493. },{
  494. xtype:'textfield',
  495. fieldLabel: '联系电话',
  496. name: 'em_mobile',
  497. allowBlank:true,
  498. beforeLabelTextTpl: '',
  499. maxLength: 20
  500. },{
  501. xtype:'textfield',
  502. fieldLabel: '邮箱',
  503. name: 'em_email',
  504. allowBlank:true,
  505. beforeLabelTextTpl: '',
  506. maxLength: 20
  507. },{
  508. value:'正式',
  509. xtype:'combo',
  510. fieldLabel: '人员状态',
  511. name: 'em_class',
  512. allowBlank:false,
  513. displayField : "display",
  514. editable:false,
  515. hideTrigger : false,
  516. maxLength : 100.0,
  517. minValue : null,
  518. positiveNum : false,
  519. queryMode : "local",
  520. valueField : "value",
  521. store:{
  522. fields: ['display', 'value'],
  523. data : [
  524. {"display":"正式", "value":'正式'},
  525. {"display":"离职", "value":'离职'}
  526. ]
  527. }
  528. },]
  529. },
  530. maxnumbers:{
  531. items:[{
  532. xtype:'hidden',
  533. name:'id'
  534. },{
  535. xtype:'textfield',
  536. fieldLabel: '单据名称',
  537. name: 'mn_name',
  538. allowBlank:false,
  539. editable:false,
  540. readOnly:true,
  541. maxLength: 20
  542. },{
  543. xtype:'textfield',
  544. fieldLabel: '单据前缀',
  545. name: 'mn_leadcode',
  546. beforeLabelTextTpl: '',
  547. allowBlank:true,
  548. maxLength: 20
  549. },{
  550. xtype:'combo',
  551. fieldLabel: '单据规则',
  552. name: 'mn_rule',
  553. displayField : "display",
  554. editable:false,
  555. hideTrigger : false,
  556. maxLength : 100.0,
  557. minValue : null,
  558. positiveNum : false,
  559. queryMode : "local",
  560. valueField : "value",
  561. store:{
  562. fields: ['display', 'value'],
  563. data : [
  564. {"display":"年月日", "value":'yyyymmdd'},
  565. {"display":"年月", "value":'yyyymm'},
  566. {"display":"无", "value":'无'}
  567. ]
  568. }
  569. },{
  570. xtype:'numberfield',
  571. hideTrigger : true,
  572. fieldLabel: '流水长度',
  573. name: 'mn_number',
  574. minValue : 0,
  575. allowBlank:false,
  576. mouseWheelEnabled: false
  577. }]
  578. }
  579. },
  580. setFormItems:function() {
  581. var me = this, kind = me.dataKind;
  582. var conf = {
  583. xtype: 'form',
  584. bodyPadding: 10,
  585. border: false,
  586. autoScroll:true,
  587. modelValidation: true,
  588. layout: {
  589. type: 'vbox',
  590. align: 'stretch'
  591. },
  592. defaults: {
  593. labelAlign:'right',
  594. beforeLabelTextTpl: "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
  595. xtype: 'textfield'
  596. },
  597. buttons: [{
  598. text: '保存',
  599. formBind:true,
  600. handler: me.onSave,
  601. scope:me
  602. }, {
  603. text: '取消',
  604. handler: me.onCancel,
  605. scope:me
  606. }]
  607. };
  608. return Ext.apply(conf, me.etc[kind]);
  609. },
  610. onSave:function(){
  611. var me = this;
  612. var belong = this.belong;
  613. me.setLoading(true);
  614. var form=this.down('form');
  615. var combo = this._combo;
  616. var params = {};
  617. var names = belong.columns.map(column => column.dataIndex);
  618. //账户资料特殊保存逻辑
  619. if(me.dataKind=='accountinformation'){
  620. me.accountinformation();
  621. return;
  622. }
  623. //账户资料新增特殊保存逻辑
  624. if(me.dataKind=='accountadd'){
  625. me.accountadd();
  626. return;
  627. }
  628. Ext.Array.each(names,function(name) {
  629. if(name){
  630. var dataField = form.down('[name='+name+']');
  631. if(dataField){
  632. var value = dataField.getValue();
  633. if(Ext.isDate(value)) {
  634. value = Ext.Date.format(value, 'Y-m-d H:i:s');
  635. }
  636. params[name] = value;
  637. params._value = value;
  638. }
  639. }
  640. });
  641. var idField = form.down('[name='+belong.keyField+']');
  642. params[belong.keyField] = idField.value || 0;
  643. //保存接口
  644. saas.util.BaseUtil.request({
  645. url: belong.reqUrl,
  646. params: JSON.stringify(params),
  647. method: 'POST'
  648. })
  649. .then(function(localJson) {
  650. me.setLoading(false);
  651. if(localJson.success){
  652. var grid = form.ownerCt._parent ? form.ownerCt._parent.lookup('document-kind-Grid') : null;
  653. if(grid){
  654. grid.store.load();
  655. }
  656. if(combo){
  657. combo.store.load(function() {
  658. typeof combo.setValue == 'function' && combo.setValue(params._value);
  659. });
  660. }
  661. saas.util.BaseUtil.showSuccessToast('保存成功');
  662. form.ownerCt.close();
  663. }
  664. })
  665. .catch(function(res) {
  666. me.setLoading(false);
  667. console.error(res);
  668. saas.util.BaseUtil.showErrorToast('保存失败: ' + res.message);
  669. });
  670. },
  671. onCancel:function(){
  672. this.hide();
  673. },
  674. accountinformation:function(){
  675. var me = this;
  676. var belong = this.belong;
  677. me.setLoading(true);
  678. var form=this.down('form');
  679. var combo = this._combo;
  680. var params = {};
  681. var names = belong.columns.map(column => column.dataIndex);
  682. Ext.Array.each(names,function(name) {
  683. if(name){
  684. var dataField = form.down('[name='+name+']');
  685. if(dataField&&dataField.value){
  686. params[name] = dataField.value;
  687. params._value = dataField.value;
  688. }
  689. }
  690. });
  691. //更改参数
  692. var o = '';
  693. Ext.Array.each(params.roleNames,function(item) {
  694. o+=item.value+','
  695. });
  696. o = o.substring(0,o.length-1);
  697. if(o==""){
  698. saas.util.BaseUtil.showErrorToast('关联角色未选择,无法保存!')
  699. }
  700. var _params = {
  701. accountId:Number(params['accountId']),
  702. roleIds:o,
  703. };
  704. //保存接口
  705. saas.util.BaseUtil.request({
  706. url: belong.reqUrl,
  707. params: _params,
  708. method: 'POST',
  709. headers:{
  710. 'Access-Control-Allow-Origin': '*',
  711. "Content-Type":'application/x-www-form-urlencoded'
  712. }
  713. })
  714. .then(function(localJson) {
  715. me.setLoading(false);
  716. if(localJson.success){
  717. saas.util.BaseUtil.showSuccessToast('保存成功');
  718. form.ownerCt._parent.store.load()
  719. form.ownerCt.close();
  720. }
  721. })
  722. .catch(function(res) {
  723. me.setLoading(false);
  724. console.error(res);
  725. saas.util.BaseUtil.showErrorToast('保存失败: ' + res.message);
  726. });
  727. },
  728. accountadd:function(){
  729. var me = this;
  730. var belong = this.belong;
  731. me.setLoading(true);
  732. var form=this.down('form');
  733. var combo = this._combo;
  734. var params = {};
  735. var names = belong.columns.map(column => column.dataIndex);
  736. Ext.Array.each(names,function(name) {
  737. if(name){
  738. var dataField = form.down('[name='+name+']');
  739. if(dataField&&dataField.value){
  740. params[name] = dataField.value;
  741. params._value = dataField.value;
  742. }
  743. }
  744. });
  745. //更改参数
  746. var o = '';
  747. var dataField = form.down('[name=roleIds]');
  748. Ext.Array.each(dataField.value,function(item) {
  749. o+=item.value+','
  750. });
  751. o = o.substring(0,o.length-1);
  752. params['username'] = params['mobile'];
  753. params['type'] = 1;
  754. params['roleIds'] = o;
  755. //保存接口
  756. saas.util.BaseUtil.request({
  757. url: belong.reqUrl,
  758. params: JSON.stringify(params),
  759. method: 'POST'
  760. })
  761. .then(function(localJson) {
  762. me.setLoading(false);
  763. if(localJson.success){
  764. form.ownerCt._parent.store.load();
  765. saas.util.BaseUtil.showSuccessToast('保存成功');
  766. form.ownerCt.close();
  767. }
  768. })
  769. .catch(function(res) {
  770. me.setLoading(false);
  771. console.error(res);
  772. saas.util.BaseUtil.showErrorToast('保存失败: ' + res.message);
  773. });
  774. }
  775. });