FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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: 100.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: 150.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: 200,
  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: "仓库id",
  169. dataIndex: "pd_whid",
  170. xtype: "numbercolumn",
  171. hidden: true
  172. }, {
  173. text: "仓库编号",
  174. dataIndex: "pd_whcode",
  175. hidden: true
  176. }, {
  177. text: "仓库",
  178. dataIndex: "pd_whname",
  179. width: 80.0,
  180. allowBlank: false,
  181. editor: {
  182. displayField: "display",
  183. editable: true,
  184. format: "",
  185. hideTrigger: false,
  186. maxLength: 100.0,
  187. minValue: null,
  188. positiveNum: false,
  189. queryMode: "local",
  190. store: null,
  191. valueField: "value",
  192. xtype: "warehouseDbfindTrigger"
  193. }
  194. }, {
  195. text: "数量",
  196. dataIndex: "pd_outqty",
  197. width: 110.0,
  198. xtype: 'numbercolumn',
  199. allowBlank: false,
  200. editor: {
  201. xtype: "numberfield",
  202. decimalPrecision: 3,
  203. minValue: 0
  204. },
  205. renderer: function (v) {
  206. return saas.util.BaseUtil.numberFormat(v, 3, true);
  207. },
  208. summaryType: 'sum',
  209. summaryRenderer: function (v) {
  210. return saas.util.BaseUtil.numberFormat(v, 3, true);
  211. }
  212. }, {
  213. text: "单位",
  214. width: 65.0,
  215. dataIndex: "pr_unit",
  216. ignore: true,
  217. renderer: function (v, m, r) {
  218. if (!v) {
  219. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  220. }
  221. return v;
  222. }
  223. }, {
  224. text: "单价(元)",
  225. xtype: 'numbercolumn',
  226. dataIndex: "pd_netprice",
  227. width: 120,
  228. editor: {
  229. xtype: "numberfield",
  230. decimalPrecision: 4,
  231. minValue: 0
  232. },
  233. renderer: function (v) {
  234. return saas.util.BaseUtil.numberFormat(v, 4, true);
  235. },
  236. }, {
  237. text: "含税单价(元)",
  238. xtype: 'numbercolumn',
  239. dataIndex: "pd_orderprice",
  240. editor: {
  241. xtype: "numberfield",
  242. decimalPrecision: 4,
  243. minValue: 0
  244. },
  245. width: 120,
  246. renderer: function (v) {
  247. return saas.util.BaseUtil.numberFormat(v, 4, true);
  248. },
  249. listeners: {
  250. edit: function (value, grid) {
  251. var r = grid.getSelection()[0],
  252. pd_taxrate = r.get('pd_taxrate');
  253. var v = value / (1 + pd_taxrate / 100);
  254. r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
  255. }
  256. }
  257. }, {
  258. text: "金额(元)",
  259. xtype: 'numbercolumn',
  260. dataIndex: "pd_nettotal",
  261. width: 120,
  262. renderer: function (v) {
  263. return saas.util.BaseUtil.numberFormat(v, 2, true);
  264. },
  265. summaryType: 'sum',
  266. summaryRenderer: function (v) {
  267. return saas.util.BaseUtil.numberFormat(v, 2, true);
  268. }
  269. }, {
  270. text: "税率(%)",
  271. xtype: 'numbercolumn',
  272. dataIndex: "pd_taxrate",
  273. width: 80,
  274. editor: {
  275. xtype: "numberfield",
  276. decimalPrecision: 0,
  277. minValue: 0,
  278. maxValue: 100
  279. },
  280. renderer: function (v) {
  281. return Ext.util.Format.number(v, '0');
  282. },
  283. }, {
  284. text: "税额(元)",
  285. xtype: 'numbercolumn',
  286. dataIndex: "pd_taxamount",
  287. width: 120,
  288. renderer: function (v) {
  289. return saas.util.BaseUtil.numberFormat(v, 2, true);
  290. },
  291. summaryType: 'sum',
  292. summaryRenderer: function (v) {
  293. return saas.util.BaseUtil.numberFormat(v, 2, true);
  294. }
  295. }, {
  296. text: "价税合计(元)",
  297. xtype: 'numbercolumn',
  298. dataIndex: "pd_ordertotal",
  299. width: 120,
  300. renderer: function (v) {
  301. return saas.util.BaseUtil.numberFormat(v, 2, true);
  302. },
  303. summaryType: 'sum',
  304. summaryRenderer: function (v) {
  305. return saas.util.BaseUtil.numberFormat(v, 2, true);
  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: "pd_remark",
  319. width: 250,
  320. items: null,
  321. editor: {
  322. xtype: "textfield"
  323. },
  324. }]
  325. }, {
  326. xtype: "textfield",
  327. name: "pi_remark",
  328. fieldLabel: "备注",
  329. columnWidth: 1
  330. }, {
  331. xtype: "hidden",
  332. name: "creatorId",
  333. fieldLabel: "录入人ID",
  334. readOnly: true
  335. }, {
  336. xtype: "textfield",
  337. name: "creatorName",
  338. fieldLabel: "录入人",
  339. readOnly: true
  340. }, {
  341. xtype: "datefield",
  342. name: "createTime",
  343. fieldLabel: "录入日期",
  344. readOnly: true,
  345. defaultValue: new Date()
  346. }, {
  347. xtype: "hidden",
  348. name: "updaterId",
  349. fieldLabel: "更新人ID",
  350. readOnly: true
  351. }, {
  352. xtype: "hidden",
  353. name: "updaterName",
  354. fieldLabel: "更新人",
  355. readOnly: true
  356. }, {
  357. xtype: "hidden",
  358. name: "updateTime",
  359. fieldLabel: "更新日期",
  360. readOnly: true,
  361. defaultValue: new Date()
  362. }, {
  363. xtype: "textfield",
  364. name: "pi_auditman",
  365. fieldLabel: "审核人",
  366. readOnly: true
  367. }, {
  368. xtype: "datefield",
  369. name: "pi_auditdate",
  370. fieldLabel: "审核日期",
  371. readOnly: true
  372. }]
  373. });