ChildForm.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  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.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:/^1(3|4|5|7|8)\d{9}$/,
  319. regexText:'请输入正确的手机号码',
  320. listeners:{
  321. change:function(f,a,b){
  322. if(a==''){
  323. f._lastCheckValue = ''
  324. }
  325. },
  326. blur:function(f,a,b,c){
  327. var form = f.ownerCt;
  328. if(f.value&&f.value!=''&&f.isValid()&&f._lastCheckValue!=f.value){
  329. f._lastCheckValue = f.value;
  330. form.setLoading(true);
  331. Ext.Ajax.request({
  332. url: '/api/account/account/checkMobile?mobile='+f.value,
  333. method: 'GET',
  334. headers:{
  335. 'Access-Control-Allow-Origin': '*',
  336. "Content-Type": 'application/json;charset=UTF-8',
  337. },
  338. success: function (response) {
  339. form.setLoading(false);
  340. var localJson = Ext.decode(response.responseText);
  341. if(localJson.success){
  342. if(localJson.data.hasRegister){
  343. saas.util.BaseUtil.showSuccessToast('校验成功:手机号已在优软云注册');
  344. }else{
  345. saas.util.BaseUtil.showErrorToast('校验失败:手机号未在优软云注册');
  346. f.setValue('');
  347. }
  348. }else{
  349. saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
  350. f.setValue('');
  351. }
  352. },
  353. failure: function (response) {
  354. if(response.responseText){
  355. var localJson = Ext.decode(response.responseText);
  356. saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
  357. f.setValue('');
  358. }else{
  359. saas.util.BaseUtil.showErrorToast('手机号校验接口连接超时');
  360. f.setValue('');
  361. }
  362. }
  363. });
  364. }
  365. }
  366. }
  367. },{
  368. xtype:'textfield',
  369. fieldLabel: '真实姓名',
  370. name: 'realname',
  371. allowBlank:false,
  372. maxLength: 30,
  373. },{
  374. xtype:'textfield',
  375. fieldLabel: '邮箱',
  376. name: 'email',
  377. allowBlank:true,
  378. beforeLabelTextTpl: "",
  379. regex:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
  380. regexText:'请输入正确的邮箱',
  381. maxLength: 30,
  382. listeners:{
  383. blur:function(f,a,b,c){
  384. var form = f.ownerCt;
  385. if(f.value&&f.value!=''&&f.isValid()&&f._lastCheckValue!=f.value){
  386. form.setLoading(true);
  387. f._lastCheckValue = f.value
  388. Ext.Ajax.request({
  389. url: '/api/account/account/checkEmail?email='+f.value,
  390. method: 'GET',
  391. headers:{
  392. 'Access-Control-Allow-Origin': '*',
  393. "Content-Type": 'application/json;charset=UTF-8'
  394. },
  395. success: function (response) {
  396. form.setLoading(false);
  397. var localJson = Ext.decode(response.responseText);
  398. if(localJson.success){
  399. if(!localJson.data){
  400. saas.util.BaseUtil.showSuccessToast('校验成功:邮箱未注册');
  401. }else{
  402. saas.util.BaseUtil.showErrorToast('校验失败:该邮箱已被注册');
  403. f.setValue('');
  404. }
  405. }else{
  406. saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
  407. }
  408. },
  409. failure: function (response) {
  410. if(response.responseText){
  411. var localJson = Ext.decode(response.responseText);
  412. saas.util.BaseUtil.showErrorToast('校验失败:'+localJson.message);
  413. }else{
  414. saas.util.BaseUtil.showErrorToast('邮箱校验接口连接超时');
  415. }
  416. }
  417. });
  418. }
  419. }
  420. }
  421. },{
  422. xtype:'datamulticombo',
  423. dataUrl:'/api/account/role/list',
  424. fieldLabel: '关联角色',
  425. name: 'roleIds',
  426. allowBlank:false,
  427. maxLength: 30,
  428. }]
  429. },
  430. warehouse:{
  431. items:[{
  432. xtype:'hidden',
  433. name:'id'
  434. },{
  435. xtype:'textfield',
  436. fieldLabel: '仓库编号',
  437. name: 'wh_code',
  438. autoCode:true,
  439. allowBlank:false,
  440. maxLength: 20
  441. },{
  442. xtype:'textfield',
  443. fieldLabel: '仓库名称',
  444. name: 'wh_description',
  445. allowBlank:false,
  446. maxLength: 20
  447. },{
  448. xtype:'combo',
  449. fieldLabel: '仓库类型',
  450. name: 'wh_type',
  451. allowBlank:false,
  452. displayField : "display",
  453. editable:false,
  454. hideTrigger : false,
  455. maxLength : 100.0,
  456. minValue : null,
  457. positiveNum : false,
  458. queryMode : "local",
  459. valueField : "value",
  460. store:{
  461. fields: ['display', 'value'],
  462. data : [
  463. {"display":"良品仓", "value":'良品仓'},
  464. {"display":"不良品仓", "value":'不良品仓'}
  465. ]
  466. }
  467. },{
  468. readOnly:true,
  469. xtype:'textfield',
  470. fieldLabel: '仓库状态',
  471. name: 'wh_status',
  472. value:'已启用',
  473. maxLength: 20
  474. },{
  475. xtype:'hidden',
  476. fieldLabel: '仓库状态码',
  477. name: 'wh_statuscode',
  478. value:'OPEN'
  479. }]
  480. },
  481. employee:{
  482. items:[{
  483. xtype:'hidden',
  484. name:'id'
  485. },{
  486. xtype:'textfield',
  487. fieldLabel: '人员编号',
  488. autoCode:true,
  489. name: 'em_code',
  490. allowBlank:false,
  491. maxLength: 20
  492. },{
  493. xtype:'textfield',
  494. fieldLabel: '人员名称',
  495. name: 'em_name',
  496. allowBlank:false,
  497. maxLength: 20
  498. },{
  499. xtype:'textfield',
  500. fieldLabel: '联系电话',
  501. name: 'em_mobile',
  502. allowBlank:false,
  503. maxLength: 20
  504. },{
  505. xtype:'textfield',
  506. fieldLabel: '邮箱',
  507. name: 'em_email',
  508. allowBlank:true,
  509. beforeLabelTextTpl: '',
  510. maxLength: 20
  511. },{
  512. value:'正式',
  513. xtype:'combo',
  514. fieldLabel: '人员状态',
  515. name: 'em_class',
  516. allowBlank:false,
  517. displayField : "display",
  518. editable:false,
  519. hideTrigger : false,
  520. maxLength : 100.0,
  521. minValue : null,
  522. positiveNum : false,
  523. queryMode : "local",
  524. valueField : "value",
  525. store:{
  526. fields: ['display', 'value'],
  527. data : [
  528. {"display":"正式", "value":'正式'},
  529. {"display":"离职", "value":'离职'}
  530. ]
  531. }
  532. },]
  533. },
  534. maxnumbers:{
  535. items:[{
  536. xtype:'hidden',
  537. name:'id'
  538. },{
  539. xtype:'textfield',
  540. fieldLabel: '单据名称',
  541. name: 'mn_name',
  542. allowBlank:false,
  543. editable:false,
  544. readOnly:true,
  545. maxLength: 20
  546. },{
  547. xtype:'textfield',
  548. fieldLabel: '单据前缀',
  549. name: 'mn_leadcode',
  550. beforeLabelTextTpl: '',
  551. allowBlank:true,
  552. maxLength: 20
  553. },{
  554. xtype:'combo',
  555. fieldLabel: '单据规则',
  556. name: 'mn_rule',
  557. displayField : "display",
  558. editable:false,
  559. hideTrigger : false,
  560. maxLength : 100.0,
  561. minValue : null,
  562. positiveNum : false,
  563. queryMode : "local",
  564. valueField : "value",
  565. store:{
  566. fields: ['display', 'value'],
  567. data : [
  568. {"display":"年月日", "value":'yyyymmdd'},
  569. {"display":"年月", "value":'yyyymm'},
  570. {"display":"无", "value":'无'}
  571. ]
  572. }
  573. },{
  574. xtype:'numberfield',
  575. hideTrigger : true,
  576. fieldLabel: '流水长度',
  577. name: 'mn_number',
  578. minValue : 0,
  579. allowBlank:false,
  580. mouseWheelEnabled: false
  581. }]
  582. }
  583. },
  584. setFormItems:function() {
  585. var me = this, kind = me.dataKind;
  586. var conf = {
  587. xtype: 'form',
  588. bodyPadding: 10,
  589. border: false,
  590. autoScroll:true,
  591. modelValidation: true,
  592. layout: {
  593. type: 'vbox',
  594. align: 'stretch'
  595. },
  596. defaults: {
  597. labelAlign:'right',
  598. beforeLabelTextTpl: "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
  599. xtype: 'textfield'
  600. },
  601. buttons: [{
  602. text: '保存',
  603. formBind:true,
  604. handler: me.onSave,
  605. scope:me
  606. }, {
  607. text: '取消',
  608. handler: me.onCancel,
  609. scope:me
  610. }]
  611. };
  612. return Ext.apply(conf, me.etc[kind]);
  613. },
  614. onSave:function(){
  615. var me = this;
  616. var belong = this.belong;
  617. me.setLoading(true);
  618. var form=this.down('form');
  619. var combo = this._combo;
  620. var params = {};
  621. var names = belong.columns.map(column => column.dataIndex);
  622. //账户资料特殊保存逻辑
  623. if(me.dataKind=='accountinformation'){
  624. me.accountinformation();
  625. return;
  626. }
  627. //账户资料新增特殊保存逻辑
  628. if(me.dataKind=='accountadd'){
  629. me.accountadd();
  630. return;
  631. }
  632. Ext.Array.each(names,function(name) {
  633. if(name){
  634. var dataField = form.down('[name='+name+']');
  635. if(dataField){
  636. var value = dataField.getValue();
  637. if(Ext.isDate(value)) {
  638. value = Ext.Date.format(value, 'Y-m-d H:i:s');
  639. }
  640. params[name] = value;
  641. params._value = value;
  642. }
  643. }
  644. });
  645. var idField = form.down('[name='+belong.keyField+']');
  646. params[belong.keyField] = idField.value || 0;
  647. //保存接口
  648. saas.util.BaseUtil.request({
  649. url: belong.reqUrl,
  650. params: JSON.stringify(params),
  651. method: 'POST'
  652. })
  653. .then(function(localJson) {
  654. me.setLoading(false);
  655. if(localJson.success){
  656. var grid = form.ownerCt._parent ? form.ownerCt._parent.lookup('document-kind-Grid') : null;
  657. if(grid){
  658. grid.store.load();
  659. }
  660. if(combo){
  661. combo.store.load(function() {
  662. typeof combo.setValue == 'function' && combo.setValue(params._value);
  663. });
  664. }
  665. saas.util.BaseUtil.showSuccessToast('保存成功');
  666. form.ownerCt.close();
  667. }
  668. })
  669. .catch(function(res) {
  670. me.setLoading(false);
  671. console.error(res);
  672. saas.util.BaseUtil.showErrorToast('保存失败: ' + res.message);
  673. });
  674. },
  675. onCancel:function(){
  676. this.hide();
  677. },
  678. accountinformation:function(){
  679. var me = this;
  680. var belong = this.belong;
  681. me.setLoading(true);
  682. var form=this.down('form');
  683. var combo = this._combo;
  684. var params = {};
  685. var names = belong.columns.map(column => column.dataIndex);
  686. Ext.Array.each(names,function(name) {
  687. if(name){
  688. var dataField = form.down('[name='+name+']');
  689. if(dataField&&dataField.value){
  690. params[name] = dataField.value;
  691. params._value = dataField.value;
  692. }
  693. }
  694. });
  695. //更改参数
  696. var o = '';
  697. Ext.Array.each(params.roleNames,function(item) {
  698. o+=item.value+','
  699. });
  700. o = o.substring(0,o.length-1);
  701. if(o==""){
  702. saas.util.BaseUtil.showErrorToast('关联角色未选择,无法保存!')
  703. }
  704. var _params = {
  705. accountId:Number(params['accountId']),
  706. roleIds:o,
  707. };
  708. //保存接口
  709. saas.util.BaseUtil.request({
  710. url: belong.reqUrl,
  711. params: _params,
  712. method: 'POST',
  713. headers:{
  714. 'Access-Control-Allow-Origin': '*',
  715. "Content-Type":'application/x-www-form-urlencoded'
  716. }
  717. })
  718. .then(function(localJson) {
  719. me.setLoading(false);
  720. if(localJson.success){
  721. saas.util.BaseUtil.showSuccessToast('保存成功');
  722. form.ownerCt._parent.store.load()
  723. form.ownerCt.close();
  724. }
  725. })
  726. .catch(function(res) {
  727. me.setLoading(false);
  728. console.error(res);
  729. saas.util.BaseUtil.showErrorToast('保存失败: ' + res.message);
  730. });
  731. },
  732. accountadd:function(){
  733. var me = this;
  734. var belong = this.belong;
  735. me.setLoading(true);
  736. var form=this.down('form');
  737. var combo = this._combo;
  738. var params = {};
  739. var names = belong.columns.map(column => column.dataIndex);
  740. Ext.Array.each(names,function(name) {
  741. if(name){
  742. var dataField = form.down('[name='+name+']');
  743. if(dataField&&dataField.value){
  744. params[name] = dataField.value;
  745. params._value = dataField.value;
  746. }
  747. }
  748. });
  749. //更改参数
  750. var o = '';
  751. var dataField = form.down('[name=roleIds]');
  752. Ext.Array.each(dataField.value,function(item) {
  753. o+=item.value+','
  754. });
  755. o = o.substring(0,o.length-1);
  756. params['username'] = params['mobile'];
  757. params['type'] = 1;
  758. params['roleIds'] = o;
  759. //保存接口
  760. saas.util.BaseUtil.request({
  761. url: belong.reqUrl,
  762. params: JSON.stringify(params),
  763. method: 'POST'
  764. })
  765. .then(function(localJson) {
  766. me.setLoading(false);
  767. if(localJson.success){
  768. form.ownerCt._parent.store.load();
  769. saas.util.BaseUtil.showSuccessToast('保存成功');
  770. form.ownerCt.close();
  771. }
  772. })
  773. .catch(function(res) {
  774. me.setLoading(false);
  775. console.error(res);
  776. saas.util.BaseUtil.showErrorToast('保存失败: ' + res.message);
  777. });
  778. }
  779. });