FormPanel.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'purchase-purchaseout-formpanel',
  4. controller: 'purchase-purchaseout-formpanel',
  5. viewModel: 'purchase-purchaseout-formpanel',
  6. viewName: 'purchase-purchaseout-formpanel',
  7. caller: 'PurchaseOut',
  8. //字段属性
  9. _title: '采购验退单',
  10. _idField: 'id',
  11. _codeField: 'pi_inoutno',
  12. _statusField: 'pi_status',
  13. _statusCodeField: 'pi_statuscode',
  14. _auditmanField: 'pi_auditman',
  15. _auditdateField: 'pi_auditdate',
  16. _relationColumn: 'pd_piid',
  17. _readUrl: '/api/purchase/prodinout/read',
  18. _saveUrl: '/api/purchase/prodinout/save',
  19. _auditUrl: '/api/purchase/prodinout/audit',
  20. _unAuditUrl: '/api/purchase/prodinout/unAudit',
  21. _deleteUrl: '/api/purchase/prodinout/delete',
  22. initId: 0,
  23. toolBtns: [],
  24. initComponent: function () {
  25. Ext.apply(this, {
  26. defaultItems: [{
  27. xtype: 'hidden',
  28. name: 'id',
  29. fieldLabel: 'id',
  30. allowBlank: true,
  31. columnWidth: 0
  32. }, {
  33. xtype: 'hidden',
  34. name: 'pi_ioid',
  35. fieldLabel: 'pi_ioid'
  36. }, {
  37. xtype: "hidden",
  38. name: "pi_class",
  39. fieldLabel: "单据类型",
  40. readOnly: true,
  41. allowBlank: true,
  42. columnWidth: 0.25
  43. }, {
  44. xtype: "hidden",
  45. name: "pi_vendid",
  46. fieldLabel: "供应商ID",
  47. allowBlank: true,
  48. hidden: true,
  49. columnWidth: 0.0
  50. }, {
  51. xtype: 'hidden',
  52. name: 'pi_vendcode',
  53. fieldLabel: '供应商编号'
  54. }, {
  55. xtype: 'vendorDbfindTrigger',
  56. name: 'pi_vendname',
  57. fieldLabel: '供应商名称',
  58. allowBlank: false,
  59. }, {
  60. xtype: "datefield",
  61. name: "pi_date",
  62. fieldLabel: "单据日期",
  63. allowBlank: false,
  64. columnWidth: 0.25,
  65. defaultValue: new Date()
  66. }, {
  67. xtype: 'condbfindtrigger',
  68. fieldLabel: '币别汇率',
  69. allowBlank: false,
  70. dbType: 'currencyDbfindTrigger',
  71. dbfinds: [{
  72. from: 'cr_name', to: 'pi_currency'
  73. }, {
  74. from: 'cr_rate', to: 'pi_rate'
  75. }],
  76. defaultValue: {
  77. pi_currency: 'RMB',
  78. pi_rate: 1
  79. },
  80. supFieldConfig: {
  81. xtype: 'numberfield',
  82. readOnly: false,
  83. defaultReadOnly: false,
  84. defaultValue: 1,
  85. decimalPrecision: 6,
  86. vtype: 'positiveNumber'
  87. }
  88. // }, {
  89. // xtype: "currencyDbfindTrigger",
  90. // name: "pi_currency",
  91. // fieldLabel: "币别",
  92. // defaultValue: 'RMB'
  93. // }, {
  94. // xtype: "numberfield",
  95. // name: "pi_rate",
  96. // fieldLabel: "汇率",
  97. // defaultValue: 1,
  98. // decimalPrecision: 6,
  99. // vtype: 'positiveNumber'
  100. }, {
  101. xtype: "hidden",
  102. name: "pi_puid",
  103. fieldLabel: "采购单id",
  104. allowBlank: true,
  105. columnWidth: 0.25
  106. }, {
  107. xtype: "hidden",
  108. name: "pi_pucode",
  109. fieldLabel: "采购单号",
  110. allowBlank: true,
  111. columnWidth: 0.25
  112. }, {
  113. name: "detailGridField",
  114. xtype: "detailGridField",
  115. storeModel: 'saas.model.purchase.ProdOutDetail',
  116. deleteDetailUrl: '/api/purchase/prodinout/deleteDetail',
  117. detnoColumn: 'pd_pdno',
  118. columns: [{
  119. text: "id",
  120. dataIndex: "id",
  121. xtype: "numbercolumn",
  122. hidden: true
  123. }, {
  124. text: "物料id",
  125. dataIndex: "pd_prodid",
  126. xtype: "numbercolumn",
  127. hidden: true
  128. }, {
  129. text: "物料编号",
  130. width: 150.0,
  131. dataIndex: "pd_prodcode",
  132. xtype: "",
  133. items: null,
  134. allowBlank: false,
  135. editor: {
  136. displayField: "display",
  137. editable: true,
  138. format: "",
  139. hideTrigger: false,
  140. maxLength: 100.0,
  141. minValue: null,
  142. positiveNum: false,
  143. queryMode: "local",
  144. store: null,
  145. valueField: "value",
  146. xtype: "productMultiDbfindTrigger"
  147. }
  148. }, {
  149. text: 'model映射需要',
  150. dataIndex: 'productDTO',
  151. hidden: true,
  152. }, {
  153. text: "品牌",
  154. width: 100.0,
  155. dataIndex: "pr_brand",
  156. ignore: true,
  157. renderer: function (v, m, r) {
  158. if (!v) {
  159. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  160. }
  161. return v;
  162. }
  163. }, {
  164. text: "物料名称",
  165. width: 150.0,
  166. dataIndex: "pr_detail",
  167. ignore: true,
  168. renderer: function (v, m, r) {
  169. if (!v) {
  170. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  171. }
  172. return v;
  173. }
  174. }, {
  175. text: "型号",
  176. width: 200.0,
  177. dataIndex: "pr_orispeccode",
  178. ignore: true,
  179. renderer: function (v, m, r) {
  180. if (!v) {
  181. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  182. }
  183. return v;
  184. }
  185. }, {
  186. text: "规格",
  187. width: 200,
  188. dataIndex: "pr_spec",
  189. ignore: true,
  190. renderer: function (v, m, r) {
  191. if (!v) {
  192. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  193. }
  194. return v;
  195. }
  196. }, {
  197. text: "仓库id",
  198. dataIndex: "pd_whid",
  199. xtype: "numbercolumn",
  200. hidden: true
  201. }, {
  202. text: "仓库编号",
  203. dataIndex: "pd_whcode",
  204. hidden: true
  205. }, {
  206. text: "仓库",
  207. dataIndex: "pd_whname",
  208. width: 110.0,
  209. allowBlank: false,
  210. editor: {
  211. displayField: "display",
  212. editable: true,
  213. format: "",
  214. hideTrigger: false,
  215. maxLength: 100.0,
  216. minValue: null,
  217. positiveNum: false,
  218. queryMode: "local",
  219. store: null,
  220. valueField: "value",
  221. xtype: "warehouseDbfindTrigger"
  222. }
  223. }, {
  224. text: "数量",
  225. dataIndex: "pd_outqty",
  226. width: 110.0,
  227. xtype: 'numbercolumn',
  228. allowBlank: false,
  229. editor: {
  230. xtype: "numberfield",
  231. decimalPrecision: 3,
  232. minValue: 0
  233. },
  234. renderer: function(v, m, r) {
  235. return saas.util.BaseUtil.numberFormat(v, 3, false);
  236. },
  237. summaryType: 'sum',
  238. summaryRenderer: function(v, d, f, m) {
  239. return saas.util.BaseUtil.numberFormat(v, 3, false);
  240. }
  241. }, {
  242. text: "单位",
  243. width: 65.0,
  244. dataIndex: "pr_unit",
  245. ignore: true,
  246. renderer: function (v, m, r) {
  247. if (!v) {
  248. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  249. }
  250. return v;
  251. }
  252. }, {
  253. text: "单价(元)",
  254. xtype: 'numbercolumn',
  255. dataIndex: "pd_netprice",
  256. width: 120,
  257. editor: {
  258. xtype: "numberfield",
  259. decimalPrecision: 4,
  260. minValue: 0
  261. },
  262. renderer: function(v, m, r) {
  263. return saas.util.BaseUtil.numberFormat(v, 4, true);
  264. },
  265. }, {
  266. text: "含税单价(元)",
  267. xtype: 'numbercolumn',
  268. dataIndex: "pd_orderprice",
  269. editor: {
  270. xtype: "numberfield",
  271. decimalPrecision: 4,
  272. minValue: 0
  273. },
  274. width: 120,
  275. renderer: function(v, m, r) {
  276. return saas.util.BaseUtil.numberFormat(v, 4, true);
  277. },
  278. listeners: {
  279. edit: function (value, grid) {
  280. var r = grid.getSelection()[0],
  281. pd_taxrate = r.get('pd_taxrate');
  282. var v = value / (1 + pd_taxrate / 100);
  283. r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
  284. }
  285. }
  286. }, {
  287. text: "金额(元)",
  288. xtype: 'numbercolumn',
  289. dataIndex: "pd_nettotal",
  290. width: 120,
  291. renderer: function(v, m, r) {
  292. return saas.util.BaseUtil.numberFormat(v, 2, true);
  293. },
  294. summaryType: 'sum',
  295. summaryRenderer: function(v, d, f, m) {
  296. return saas.util.BaseUtil.numberFormat(v, 2, true);
  297. }
  298. }, {
  299. text: "税率(%)",
  300. xtype: 'numbercolumn',
  301. dataIndex: "pd_taxrate",
  302. width: 80,
  303. editor: {
  304. xtype: "numberfield",
  305. decimalPrecision: 0,
  306. minValue: 0,
  307. maxValue: 100
  308. },
  309. renderer: function(v, m, r) {
  310. return saas.util.BaseUtil.numberFormat(v, 2, false);
  311. },
  312. }, {
  313. text: "税额(元)",
  314. xtype: 'numbercolumn',
  315. dataIndex: "pd_taxamount",
  316. width: 120,
  317. renderer: function(v, m, r) {
  318. return saas.util.BaseUtil.numberFormat(v, 2, true);
  319. },
  320. summaryType: 'sum',
  321. summaryRenderer: function(v, d, f, m) {
  322. return saas.util.BaseUtil.numberFormat(v, 2, true);
  323. }
  324. }, {
  325. text: "价税合计(元)",
  326. xtype: 'numbercolumn',
  327. dataIndex: "pd_ordertotal",
  328. width: 120,
  329. renderer: function(v, m, r) {
  330. return saas.util.BaseUtil.numberFormat(v, 2, true);
  331. },
  332. summaryType: 'sum',
  333. summaryRenderer: function(v, d, f, m) {
  334. return saas.util.BaseUtil.numberFormat(v, 2, true);
  335. }
  336. }, {
  337. text: "验收明细id",
  338. dataIndex: "pd_ioid",
  339. hidden: true
  340. }, {
  341. text: "关联验收单号",
  342. dataIndex: "iocode",
  343. width: 150.0,
  344. ignore: true
  345. }, {
  346. text: "备注",
  347. dataIndex: "pd_remark",
  348. width: 250,
  349. items: null,
  350. editor: {
  351. xtype: "textfield"
  352. },
  353. }, {
  354. dataIndex: "pd_text1",
  355. text: "自定义字段1",
  356. width: 100,
  357. hidden: true,
  358. initHidden: false,
  359. editor: {
  360. xtype: "textfield"
  361. },
  362. }, {
  363. dataIndex: "pd_text2",
  364. text: "自定义字段2",
  365. width: 100,
  366. hidden: true,
  367. initHidden: false,
  368. editor: {
  369. xtype: "textfield"
  370. },
  371. }, {
  372. dataIndex: "pd_text3",
  373. text: "自定义字段3",
  374. width: 100,
  375. hidden: true,
  376. initHidden: false,
  377. editor: {
  378. xtype: "textfield"
  379. },
  380. }, {
  381. dataIndex: "pd_text4",
  382. text: "自定义字段4",
  383. width: 100,
  384. hidden: true,
  385. initHidden: false,
  386. editor: {
  387. xtype: "textfield"
  388. },
  389. }, {
  390. dataIndex: "pd_text5",
  391. text: "自定义字段5",
  392. width: 100,
  393. hidden: true,
  394. initHidden: false,
  395. editor: {
  396. xtype: "textfield"
  397. },
  398. }]
  399. }, {
  400. xtype: "textfield",
  401. name: "pi_remark",
  402. fieldLabel: "备注",
  403. columnWidth: 1
  404. }, {
  405. xtype: "numberfield",
  406. name: "pi_nettotal",
  407. fieldLabel: "金额(元)",
  408. allowBlank: true,
  409. readOnly: true,
  410. thousandSeparator: ',',
  411. columnWidth: 0.25
  412. }, {
  413. xtype: "numberfield",
  414. name: "pi_total",
  415. fieldLabel: "价税合计(元)",
  416. allowBlank: true,
  417. readOnly: true,
  418. thousandSeparator: ',',
  419. columnWidth: 0.25
  420. }, {
  421. xtype: "hidden",
  422. name: "pi_buyercode",
  423. fieldLabel: "采购员编号"
  424. }, {
  425. xtype: "employeeDbfindTrigger",
  426. name: "pi_buyername",
  427. fieldLabel: "采购员",
  428. columnWidth: 0.25
  429. }, {
  430. xtype: "hidden",
  431. name: "pi_buyerid",
  432. fieldLabel: "采购员ID"
  433. }, {
  434. xtype: "hidden",
  435. name: "creatorId",
  436. fieldLabel: "录入人ID",
  437. readOnly: true
  438. }, {
  439. xtype: "textfield",
  440. name: "creatorName",
  441. fieldLabel: "录入人",
  442. readOnly: true
  443. }, {
  444. xtype: "datefield",
  445. name: "createTime",
  446. fieldLabel: "录入日期",
  447. readOnly: true,
  448. defaultValue: new Date()
  449. }, {
  450. xtype: "hidden",
  451. name: "updaterId",
  452. fieldLabel: "更新人ID",
  453. readOnly: true
  454. }, {
  455. xtype: "hidden",
  456. name: "updaterName",
  457. fieldLabel: "更新人",
  458. readOnly: true
  459. }, {
  460. xtype: "hidden",
  461. name: "updateTime",
  462. fieldLabel: "更新日期",
  463. readOnly: true,
  464. defaultValue: new Date()
  465. }, {
  466. xtype: "textfield",
  467. name: "pi_auditman",
  468. fieldLabel: "审核人",
  469. readOnly: true
  470. }, {
  471. xtype: "datefield",
  472. name: "pi_auditdate",
  473. fieldLabel: "审核日期",
  474. readOnly: true
  475. }, {
  476. xtype: "textfield",
  477. name: "pi_text1",
  478. fieldLabel: "自定义字段1",
  479. hidden: true,
  480. initHidden: false
  481. }, {
  482. xtype: "textfield",
  483. name: "pi_text2",
  484. fieldLabel: "自定义字段2",
  485. hidden: true,
  486. initHidden: false
  487. }, {
  488. xtype: "textfield",
  489. name: "pi_text3",
  490. fieldLabel: "自定义字段3",
  491. hidden: true,
  492. initHidden: false
  493. }, {
  494. xtype: "textfield",
  495. name: "pi_text4",
  496. fieldLabel: "自定义字段4",
  497. hidden: true,
  498. initHidden: false
  499. }, {
  500. xtype: "textfield",
  501. name: "pi_text5",
  502. fieldLabel: "自定义字段5",
  503. hidden: true,
  504. initHidden: false
  505. }]
  506. });
  507. this.callParent(arguments);
  508. },
  509. });