FormPanel.js 17 KB

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