FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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 : "textfield",
  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. editor : {
  117. displayField : "display",
  118. editable : true,
  119. format : "",
  120. hideTrigger : false,
  121. maxLength : 100.0,
  122. minValue : null,
  123. positiveNum : false,
  124. queryMode : "local",
  125. store : null,
  126. valueField : "value",
  127. xtype : "multidbfindtrigger"
  128. }
  129. },
  130. {
  131. text : "名称",
  132. dataIndex : "pr_detail",
  133. ignore:true,
  134. renderer: function (v, m, r) {
  135. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  136. }
  137. },
  138. {
  139. text : "规格",
  140. dataIndex : "pr_spec",
  141. ignore:true,
  142. renderer: function (v, m, r) {
  143. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  144. }
  145. },
  146. {
  147. text : "数量",
  148. dataIndex : "pd_outqty",
  149. editor : {
  150. xtype : "numberfield",
  151. decimalPrecision: 8,
  152. minValue:0
  153. },
  154. renderer : function(v) {
  155. var arr = (v + '.').split('.');
  156. var xr = (new Array(arr[1].length)).fill('0');
  157. var format = '0.' + xr.join();
  158. return Ext.util.Format.number(v, format);
  159. },
  160. summaryType: 'sum',
  161. summaryRenderer: function(v) {
  162. var arr = (v + '.').split('.');
  163. var xr = (new Array(arr[1].length)).fill('0');
  164. var format = '0.' + xr.join();
  165. return Ext.util.Format.number(v, format);
  166. }
  167. },
  168. // {
  169. // text : "已转数",
  170. // dataIndex : "pd_yqty",
  171. // width : 120.0,
  172. // xtype : "numbercolumn",
  173. // format:'0',
  174. // items : null,
  175. // summaryType: 'sum'
  176. // },
  177. {
  178. text : "仓库id",
  179. dataIndex : "pd_whid",
  180. xtype : "numbercolumn",
  181. hidden:true
  182. },
  183. {
  184. text : "仓库编号",
  185. dataIndex : "pd_whcode",
  186. hidden:true
  187. },
  188. {
  189. text : "仓库",
  190. dataIndex : "pd_whname",
  191. width : 120.0,
  192. allowBlank : false,
  193. editor : {
  194. displayField : "display",
  195. editable : true,
  196. format : "",
  197. hideTrigger : false,
  198. maxLength : 100.0,
  199. minValue : null,
  200. positiveNum : false,
  201. queryMode : "local",
  202. store : null,
  203. valueField : "value",
  204. xtype : "dbfindtrigger"
  205. }
  206. },
  207. {
  208. text : "单价",
  209. editor : {
  210. xtype : "numberfield",
  211. decimalPrecision: 8,
  212. minValue:0
  213. },
  214. dataIndex : "pd_orderprice",
  215. width : 120.0,
  216. renderer : function(v) {
  217. var arr = (v + '.').split('.');
  218. var xr = (new Array(arr[1].length)).fill('0');
  219. var format = '0,000.' + xr.join();
  220. return Ext.util.Format.number(v, format);
  221. },
  222. },{
  223. text : "税率",
  224. dataIndex : "pd_taxrate",
  225. width : 120.0,
  226. editor : {
  227. xtype : "numberfield",
  228. decimalPrecision: 0,
  229. minValue: 0,
  230. maxValue: 100
  231. }
  232. },
  233. {
  234. text : "含税金额",
  235. dataIndex : "pd_total",
  236. width : 120.0,
  237. editor : {
  238. xtype : "numberfield",
  239. decimalPrecision: 2,
  240. editable : false
  241. },
  242. renderer : function(v) {
  243. var arr = (v + '.').split('.');
  244. var xr = (new Array(arr[1].length)).fill('0');
  245. var format = '0,000.' + xr.join();
  246. return Ext.util.Format.number(v, format);
  247. },
  248. summaryType: 'sum',
  249. summaryRenderer: function(v) {
  250. var arr = (v + '.').split('.');
  251. var xr = (new Array(arr[1].length)).fill('0');
  252. var format = '0,000.' + xr.join();
  253. return Ext.util.Format.number(v, format);
  254. }
  255. },
  256. {
  257. text : "未税金额",
  258. dataIndex : "pd_nettotal",
  259. editor : {
  260. xtype : "numberfield",
  261. decimalPrecision: 2,
  262. editable : false
  263. },
  264. renderer : function(v) {
  265. var arr = (v + '.').split('.');
  266. var xr = (new Array(arr[1].length)).fill('0');
  267. var format = '0,000.' + xr.join();
  268. return Ext.util.Format.number(v, format);
  269. },
  270. summaryType: 'sum',
  271. summaryRenderer: function(v) {
  272. var arr = (v + '.').split('.');
  273. var xr = (new Array(arr[1].length)).fill('0');
  274. var format = '0,000.' + xr.join();
  275. return Ext.util.Format.number(v, format);
  276. }
  277. },
  278. {
  279. text : "采购单明细id",
  280. dataIndex : "pd_orderid",
  281. width : 120.0,
  282. hidden:true
  283. },
  284. {
  285. text : "采购单号",
  286. dataIndex : "pd_ordercode",
  287. width : 120.0
  288. },{
  289. text : "采购序号",
  290. dataIndex : "pd_orderdetno",
  291. xtype : "numbercolumn",
  292. format: '0000',
  293. renderer: function(v) {
  294. return v ? v : null;
  295. }
  296. }
  297. ]
  298. }, {
  299. xtype : "datefield",
  300. name : "createTime",
  301. bind : "{createTime}",
  302. fieldLabel : "创建时间",
  303. allowBlank : true,
  304. columnWidth : 0.25
  305. }, {
  306. xtype : "datefield",
  307. name : "updateTime",
  308. bind : "{updateTime}",
  309. fieldLabel : "更新时间",
  310. allowBlank : true,
  311. columnWidth : 0.25
  312. }, {
  313. xtype : "textfield",
  314. readOnly : true,
  315. editable : false,
  316. name : "pi_status",
  317. bind : "{pi_status}",
  318. fieldLabel : "单据状态",
  319. allowBlank : true,
  320. columnWidth : 0.25
  321. }, {
  322. xtype : "hidden",
  323. readOnly : true,
  324. editable : false,
  325. name : "pi_statuscode",
  326. bind : "{pi_statuscode}",
  327. fieldLabel : "单据状态码",
  328. allowBlank : true,
  329. columnWidth : 0.0
  330. }]
  331. });