FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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. _relationColumn: 'pd_piid',
  15. _readUrl:'/api/purchase/prodinout/read/',
  16. _saveUrl:'/api/purchase/prodinout/save',
  17. _auditUrl:'/api/purchase/prodinout/audit',
  18. _unAuditUrl:'/api/purchase/prodinout/unAudit/',
  19. _deleteUrl:'/api/purchase/prodinout/delete/',
  20. // _relationColumn: 'pd_piid',
  21. // _readUrl:'http://localhost:8800/prodinout/read/',
  22. // _saveUrl:'http://localhost:8800/prodinout/save',
  23. // _auditUrl:'http://localhost:8800/prodinout/audit',
  24. // _deleteUrl:'http://localhost:8800/prodinout/delete/',
  25. initId:0,
  26. toolBtns: [],
  27. defaultItems: [{
  28. xtype: 'hidden',
  29. name: 'id',
  30. bind: '{id}',
  31. fieldLabel: 'id',
  32. allowBlank: true,
  33. columnWidth: 0
  34. },{
  35. xtype : "textfield",
  36. name : "pi_class",
  37. bind : "{pi_class}",
  38. fieldLabel : "单据类型",
  39. readOnly:true,
  40. allowBlank : true,
  41. columnWidth : 0.25
  42. }, {
  43. xtype : "hidden",
  44. name : "pi_vendid",
  45. bind : "{pi_vendid}",
  46. fieldLabel : "供应商ID",
  47. allowBlank : true,
  48. hidden:true,
  49. columnWidth : 0.0
  50. },{
  51. xtype: 'hidden',
  52. name: 'pi_vendcode',
  53. bind: '{pi_vendcode}',
  54. fieldLabel: '供应商编号'
  55. }, {
  56. xtype: 'dbfindtrigger',
  57. name: 'pi_vendname',
  58. bind: '{pi_vendname}',
  59. fieldLabel: '供应商名称',
  60. allowBlank : false,
  61. },{
  62. xtype : "datefield",
  63. name : "pi_date",
  64. bind : "{pi_date}",
  65. fieldLabel : "单据日期",
  66. allowBlank : false,
  67. columnWidth : 0.25,
  68. defaultValue: new Date()
  69. },{
  70. xtype : "textfield",
  71. name : "pi_total",
  72. bind : "{pi_total}",
  73. fieldLabel : "总额",
  74. allowBlank : true,
  75. readOnly: true,
  76. columnWidth : 0.25
  77. }, {
  78. xtype : "hidden",
  79. name : "pi_puid",
  80. bind : "{pi_puid}",
  81. fieldLabel : "采购单id",
  82. allowBlank : true,
  83. columnWidth : 0.25
  84. },{
  85. xtype : "hidden",
  86. name : "pi_pucode",
  87. bind : "{pi_pucode}",
  88. fieldLabel : "采购单号",
  89. allowBlank : true,
  90. columnWidth : 0.25
  91. }, {
  92. name : "detailGridField",
  93. xtype : "detailGridField",
  94. storeModel:'saas.model.purchase.ProdIODetail',
  95. // deleteDetailUrl:'http://localhost:8800/prodinout/deleteDetail/',
  96. deleteDetailUrl:'/api/purchase/prodinout/deleteDetail/',
  97. detnoColumn: 'pd_pdno',
  98. columns : [
  99. {
  100. text : "id",
  101. dataIndex : "id",
  102. xtype : "numbercolumn",
  103. hidden:true
  104. },{
  105. text : "物料id",
  106. dataIndex : "pd_prodid",
  107. xtype : "numbercolumn",
  108. hidden:true
  109. },
  110. {
  111. text : "物料编号",
  112. width : 200.0,
  113. dataIndex : "pd_prodcode",
  114. xtype : "",
  115. items : null,
  116. allowBlank : false,
  117. editor : {
  118. displayField : "display",
  119. editable : true,
  120. format : "",
  121. hideTrigger : false,
  122. maxLength : 100.0,
  123. minValue : null,
  124. positiveNum : false,
  125. queryMode : "local",
  126. store : null,
  127. valueField : "value",
  128. xtype : "multidbfindtrigger"
  129. }
  130. },{
  131. text: 'model映射需要',
  132. dataIndex: 'productDTO',
  133. hidden: true,
  134. },
  135. {
  136. text : "名称",
  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. {
  147. text : "规格",
  148. dataIndex : "pr_spec",
  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. {
  158. text : "数量",
  159. dataIndex : "pd_outqty",
  160. xtype: 'numbercolumn',
  161. allowBlank : false,
  162. editor : {
  163. xtype : "numberfield",
  164. decimalPrecision: 8,
  165. minValue:0
  166. },
  167. renderer : function(v) {
  168. var arr = (v + '.').split('.');
  169. var xr = (new Array(arr[1].length)).fill('0');
  170. var format = '0.' + xr.join();
  171. return Ext.util.Format.number(v, format);
  172. },
  173. summaryType: 'sum',
  174. summaryRenderer: function(v) {
  175. var arr = (v + '.').split('.');
  176. var xr = (new Array(arr[1].length)).fill('0');
  177. var format = '0.' + xr.join();
  178. return Ext.util.Format.number(v, format);
  179. }
  180. },
  181. // {
  182. // text : "已转数",
  183. // dataIndex : "pd_yqty",
  184. // width : 120.0,
  185. // xtype : "numbercolumn",
  186. // format:'0',
  187. // items : null,
  188. // summaryType: 'sum'
  189. // },
  190. {
  191. text : "仓库id",
  192. dataIndex : "pd_whid",
  193. xtype : "numbercolumn",
  194. hidden:true
  195. },
  196. {
  197. text : "仓库编号",
  198. dataIndex : "pd_whcode",
  199. hidden:true
  200. },
  201. {
  202. text : "仓库",
  203. dataIndex : "pd_whname",
  204. width : 120.0,
  205. allowBlank : false,
  206. editor : {
  207. displayField : "display",
  208. editable : true,
  209. format : "",
  210. hideTrigger : false,
  211. maxLength : 100.0,
  212. minValue : null,
  213. positiveNum : false,
  214. queryMode : "local",
  215. store : null,
  216. valueField : "value",
  217. xtype : "dbfindtrigger"
  218. }
  219. },
  220. {
  221. text : "单价",
  222. xtype: 'numbercolumn',
  223. editor : {
  224. xtype : "numberfield",
  225. decimalPrecision: 8,
  226. minValue:0
  227. },
  228. dataIndex : "pd_orderprice",
  229. width : 120.0,
  230. renderer : function(v) {
  231. var arr = (v + '.').split('.');
  232. var xr = (new Array(arr[1].length)).fill('0');
  233. var format = '0,000.' + xr.join();
  234. return Ext.util.Format.number(v, format);
  235. },
  236. },{
  237. text : "税率",
  238. xtype: 'numbercolumn',
  239. dataIndex : "pd_taxrate",
  240. width : 120.0,
  241. editor : {
  242. xtype : "numberfield",
  243. decimalPrecision: 0,
  244. minValue: 0,
  245. maxValue: 100
  246. }
  247. },
  248. {
  249. text : "含税金额",
  250. xtype: 'numbercolumn',
  251. dataIndex : "pd_total",
  252. width : 120.0,
  253. editor : {
  254. xtype : "numberfield",
  255. decimalPrecision: 2,
  256. editable : false
  257. },
  258. renderer : function(v) {
  259. var arr = (v + '.').split('.');
  260. var xr = (new Array(arr[1].length)).fill('0');
  261. var format = '0,000.' + xr.join();
  262. return Ext.util.Format.number(v, format);
  263. },
  264. summaryType: 'sum',
  265. summaryRenderer: function(v) {
  266. var arr = (v + '.').split('.');
  267. var xr = (new Array(arr[1].length)).fill('0');
  268. var format = '0,000.' + xr.join();
  269. return Ext.util.Format.number(v, format);
  270. }
  271. },
  272. {
  273. text : "未税金额",
  274. xtype: 'numbercolumn',
  275. dataIndex : "pd_nettotal",
  276. editor : {
  277. xtype : "numberfield",
  278. decimalPrecision: 2,
  279. editable : false
  280. },
  281. renderer : function(v) {
  282. var arr = (v + '.').split('.');
  283. var xr = (new Array(arr[1].length)).fill('0');
  284. var format = '0,000.' + xr.join();
  285. return Ext.util.Format.number(v, format);
  286. },
  287. summaryType: 'sum',
  288. summaryRenderer: function(v) {
  289. var arr = (v + '.').split('.');
  290. var xr = (new Array(arr[1].length)).fill('0');
  291. var format = '0,000.' + xr.join();
  292. return Ext.util.Format.number(v, format);
  293. }
  294. },
  295. {
  296. text : "采购单明细id",
  297. dataIndex : "pd_orderid",
  298. width : 120.0,
  299. hidden:true
  300. },
  301. {
  302. text : "采购单号",
  303. dataIndex : "pd_ordercode",
  304. width : 120.0
  305. },{
  306. text : "采购序号",
  307. dataIndex : "pd_orderdetno",
  308. xtype : "numbercolumn",
  309. format: '0000',
  310. renderer: function(v) {
  311. return v ? v : null;
  312. }
  313. }
  314. ]
  315. },{
  316. xtype : "textfield",
  317. name : "pi_remark",
  318. fieldLabel : "备注",
  319. columnWidth : 1
  320. }, {
  321. xtype : "textfield",
  322. name : "pi_recordman",
  323. fieldLabel : "录入人",
  324. readOnly:true
  325. }, {
  326. xtype : "datefield",
  327. name : "createTime",
  328. fieldLabel : "录入日期",
  329. readOnly:true
  330. }, {
  331. xtype : "textfield",
  332. name : "pi_auditman",
  333. fieldLabel : "审核人",
  334. readOnly:true
  335. }, {
  336. xtype : "datefield",
  337. name : "pi_auditdate",
  338. fieldLabel : "审核日期",
  339. readOnly:true
  340. }]
  341. });