FormPanel.js 18 KB

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