FormPanel.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  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. defaultItems: [{
  25. xtype: 'hidden',
  26. name: 'id',
  27. fieldLabel: 'id',
  28. allowBlank: true,
  29. columnWidth: 0
  30. }, {
  31. xtype: 'hidden',
  32. name: 'pi_ioid',
  33. fieldLabel: 'pi_ioid'
  34. }, {
  35. xtype: "hidden",
  36. name: "pi_class",
  37. fieldLabel: "单据类型",
  38. readOnly: true,
  39. allowBlank: true,
  40. columnWidth: 0.25
  41. }, {
  42. xtype: "hidden",
  43. name: "pi_vendid",
  44. fieldLabel: "供应商ID",
  45. allowBlank: true,
  46. hidden: true,
  47. columnWidth: 0.0
  48. }, {
  49. xtype: 'hidden',
  50. name: 'pi_vendcode',
  51. fieldLabel: '供应商编号'
  52. }, {
  53. xtype: 'vendorDbfindTrigger',
  54. name: 'pi_vendname',
  55. fieldLabel: '供应商名称',
  56. allowBlank: false,
  57. }, {
  58. xtype: "datefield",
  59. name: "pi_date",
  60. fieldLabel: "单据日期",
  61. allowBlank: false,
  62. columnWidth: 0.25,
  63. defaultValue: new Date()
  64. }, {
  65. xtype: "hidden",
  66. name: "pi_puid",
  67. fieldLabel: "采购单id",
  68. allowBlank: true,
  69. columnWidth: 0.25
  70. }, {
  71. xtype: "hidden",
  72. name: "pi_pucode",
  73. fieldLabel: "采购单号",
  74. allowBlank: true,
  75. columnWidth: 0.25
  76. }, {
  77. name: "detailGridField",
  78. xtype: "detailGridField",
  79. storeModel: 'saas.model.purchase.ProdOutDetail',
  80. deleteDetailUrl: '/api/purchase/prodinout/deleteDetail',
  81. detnoColumn: 'pd_pdno',
  82. columns: [{
  83. text: "id",
  84. dataIndex: "id",
  85. xtype: "numbercolumn",
  86. hidden: true
  87. }, {
  88. text: "物料id",
  89. dataIndex: "pd_prodid",
  90. xtype: "numbercolumn",
  91. hidden: true
  92. }, {
  93. text: "物料编号",
  94. width: 150.0,
  95. dataIndex: "pd_prodcode",
  96. xtype: "",
  97. items: null,
  98. allowBlank: false,
  99. editor: {
  100. displayField: "display",
  101. editable: true,
  102. format: "",
  103. hideTrigger: false,
  104. maxLength: 100.0,
  105. minValue: null,
  106. positiveNum: false,
  107. queryMode: "local",
  108. store: null,
  109. valueField: "value",
  110. xtype: "productMultiDbfindTrigger"
  111. }
  112. }, {
  113. text: 'model映射需要',
  114. dataIndex: 'productDTO',
  115. hidden: true,
  116. }, {
  117. text: "品牌",
  118. width: 100.0,
  119. dataIndex: "pr_brand",
  120. ignore: true,
  121. renderer: function (v, m, r) {
  122. if (!v) {
  123. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  124. }
  125. return v;
  126. }
  127. }, {
  128. text: "物料名称",
  129. width: 150.0,
  130. dataIndex: "pr_detail",
  131. ignore: true,
  132. renderer: function (v, m, r) {
  133. if (!v) {
  134. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  135. }
  136. return v;
  137. }
  138. }, {
  139. text: "型号",
  140. width: 200.0,
  141. dataIndex: "pr_orispeccode",
  142. ignore: true,
  143. renderer: function (v, m, r) {
  144. if (!v) {
  145. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  146. }
  147. return v;
  148. }
  149. }, {
  150. text: "规格",
  151. width: 200,
  152. dataIndex: "pr_spec",
  153. ignore: true,
  154. renderer: function (v, m, r) {
  155. if (!v) {
  156. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  157. }
  158. return v;
  159. }
  160. }, {
  161. text: "仓库id",
  162. dataIndex: "pd_whid",
  163. xtype: "numbercolumn",
  164. hidden: true
  165. }, {
  166. text: "仓库编号",
  167. dataIndex: "pd_whcode",
  168. hidden: true
  169. }, {
  170. text: "仓库",
  171. dataIndex: "pd_whname",
  172. width: 80.0,
  173. allowBlank: false,
  174. editor: {
  175. displayField: "display",
  176. editable: true,
  177. format: "",
  178. hideTrigger: false,
  179. maxLength: 100.0,
  180. minValue: null,
  181. positiveNum: false,
  182. queryMode: "local",
  183. store: null,
  184. valueField: "value",
  185. xtype: "warehouseDbfindTrigger"
  186. }
  187. }, {
  188. text: "数量",
  189. dataIndex: "pd_outqty",
  190. width: 110.0,
  191. xtype: 'numbercolumn',
  192. allowBlank: false,
  193. editor: {
  194. xtype: "numberfield",
  195. decimalPrecision: 3,
  196. minValue: 0
  197. },
  198. renderer: function (v) {
  199. return saas.util.BaseUtil.numberFormat(v, 3, false);
  200. },
  201. summaryType: 'sum',
  202. summaryRenderer: function (v) {
  203. return saas.util.BaseUtil.numberFormat(v, 3, false);
  204. }
  205. }, {
  206. text: "单位",
  207. width: 65.0,
  208. dataIndex: "pr_unit",
  209. ignore: true,
  210. renderer: function (v, m, r) {
  211. if (!v) {
  212. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  213. }
  214. return v;
  215. }
  216. }, {
  217. text: "单价(元)",
  218. xtype: 'numbercolumn',
  219. dataIndex: "pd_netprice",
  220. width: 120,
  221. editor: {
  222. xtype: "numberfield",
  223. decimalPrecision: 4,
  224. minValue: 0
  225. },
  226. renderer: function (v) {
  227. return saas.util.BaseUtil.numberFormat(v, 4, true);
  228. },
  229. }, {
  230. text: "含税单价(元)",
  231. xtype: 'numbercolumn',
  232. dataIndex: "pd_orderprice",
  233. editor: {
  234. xtype: "numberfield",
  235. decimalPrecision: 4,
  236. minValue: 0
  237. },
  238. width: 120,
  239. renderer: function (v) {
  240. return saas.util.BaseUtil.numberFormat(v, 4, true);
  241. },
  242. listeners: {
  243. edit: function (value, grid) {
  244. var r = grid.getSelection()[0],
  245. pd_taxrate = r.get('pd_taxrate');
  246. var v = value / (1 + pd_taxrate / 100);
  247. r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
  248. }
  249. }
  250. }, {
  251. text: "金额(元)",
  252. xtype: 'numbercolumn',
  253. dataIndex: "pd_nettotal",
  254. width: 120,
  255. renderer: function (v) {
  256. return saas.util.BaseUtil.numberFormat(v, 2, true);
  257. },
  258. summaryType: 'sum',
  259. summaryRenderer: function (v) {
  260. return saas.util.BaseUtil.numberFormat(v, 2, true);
  261. }
  262. }, {
  263. text: "税率(%)",
  264. xtype: 'numbercolumn',
  265. dataIndex: "pd_taxrate",
  266. width: 80,
  267. editor: {
  268. xtype: "numberfield",
  269. decimalPrecision: 0,
  270. minValue: 0,
  271. maxValue: 100
  272. },
  273. renderer: function (v) {
  274. return saas.util.BaseUtil.numberFormat(v, 2, false);
  275. },
  276. }, {
  277. text: "税额(元)",
  278. xtype: 'numbercolumn',
  279. dataIndex: "pd_taxamount",
  280. width: 120,
  281. renderer: function (v) {
  282. return saas.util.BaseUtil.numberFormat(v, 2, true);
  283. },
  284. summaryType: 'sum',
  285. summaryRenderer: function (v) {
  286. return saas.util.BaseUtil.numberFormat(v, 2, true);
  287. }
  288. }, {
  289. text: "价税合计(元)",
  290. xtype: 'numbercolumn',
  291. dataIndex: "pd_ordertotal",
  292. width: 120,
  293. renderer: function (v) {
  294. return saas.util.BaseUtil.numberFormat(v, 2, true);
  295. },
  296. summaryType: 'sum',
  297. summaryRenderer: function (v) {
  298. return saas.util.BaseUtil.numberFormat(v, 2, true);
  299. }
  300. }, {
  301. text: "验收明细id",
  302. dataIndex: "pd_ioid",
  303. hidden: true
  304. }, {
  305. text: "关联验收单号",
  306. dataIndex: "iocode",
  307. width: 150.0,
  308. ignore: true
  309. }, {
  310. text: "备注",
  311. dataIndex: "pd_remark",
  312. width: 250,
  313. items: null,
  314. editor: {
  315. xtype: "textfield"
  316. },
  317. }]
  318. }, {
  319. xtype: "textfield",
  320. name: "pi_remark",
  321. fieldLabel: "备注",
  322. columnWidth: 1
  323. }, {
  324. xtype: "textfield",
  325. name: "pi_currency",
  326. fieldLabel: "币别",
  327. readOnly: true,
  328. defaultValue: 'RMB'
  329. }, {
  330. xtype: "textfield",
  331. name: "pi_nettotal",
  332. fieldLabel: "金额(元)",
  333. allowBlank: true,
  334. readOnly: true,
  335. columnWidth: 0.25
  336. }, {
  337. xtype: "textfield",
  338. name: "pi_total",
  339. fieldLabel: "价税合计(元)",
  340. allowBlank: true,
  341. readOnly: true,
  342. columnWidth: 0.25
  343. }, {
  344. xtype: "hidden",
  345. name: "pi_buyercode",
  346. fieldLabel: "采购员编号"
  347. }, {
  348. xtype: "employeeDbfindTrigger",
  349. name: "pi_buyername",
  350. fieldLabel: "采购员",
  351. columnWidth: 0.25
  352. }, {
  353. xtype: "hidden",
  354. name: "pi_buyerid",
  355. fieldLabel: "采购员ID"
  356. }, {
  357. xtype: "hidden",
  358. name: "creatorId",
  359. fieldLabel: "录入人ID",
  360. readOnly: true
  361. }, {
  362. xtype: "textfield",
  363. name: "creatorName",
  364. fieldLabel: "录入人",
  365. readOnly: true
  366. }, {
  367. xtype: "datefield",
  368. name: "createTime",
  369. fieldLabel: "录入日期",
  370. readOnly: true,
  371. defaultValue: new Date()
  372. }, {
  373. xtype: "hidden",
  374. name: "updaterId",
  375. fieldLabel: "更新人ID",
  376. readOnly: true
  377. }, {
  378. xtype: "hidden",
  379. name: "updaterName",
  380. fieldLabel: "更新人",
  381. readOnly: true
  382. }, {
  383. xtype: "hidden",
  384. name: "updateTime",
  385. fieldLabel: "更新日期",
  386. readOnly: true,
  387. defaultValue: new Date()
  388. }, {
  389. xtype: "textfield",
  390. name: "pi_auditman",
  391. fieldLabel: "审核人",
  392. readOnly: true
  393. }, {
  394. xtype: "datefield",
  395. name: "pi_auditdate",
  396. fieldLabel: "审核日期",
  397. readOnly: true
  398. }]
  399. });