FormPanel.js 11 KB

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