FormPanel.js 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. Ext.define('saas.view.stock.otherIn.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'stock-otherin-formpanel',
  4. controller: 'stock-otherin-formpanel',
  5. viewModel: 'stock-otherin-formpanel',
  6. viewName: 'stock-otherin-formpanel',
  7. caller:'OtherIn',
  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/storage/prodinout/read/',
  16. _saveUrl:'/api/storage/prodinout/save',
  17. _auditUrl:'/api/storage/prodinout/audit',
  18. _unAuditUrl: '/api/storage/prodinout/unAudit/',
  19. _deleteUrl:'/api/storage/prodinout/delete/',
  20. // _relationColumn: 'pd_piid',
  21. // _readUrl:'http://localhost:9000/prodinout/read/',
  22. // _saveUrl:'http://localhost:9000/prodinout/save',
  23. // _auditUrl:'http://localhost:9000/prodinout/audit',
  24. // _unAuditUrl:'http://localhost:9000/prodinout/unAudit',
  25. // _deleteUrl:'http://localhost:9000/prodinout/delete/',
  26. initId:0,
  27. toolBtns: [],
  28. defaultItems: [{
  29. xtype: 'hidden',
  30. name: 'id',
  31. bind: '{id}',
  32. fieldLabel: 'id',
  33. allowBlank: true,
  34. columnWidth: 0
  35. },{
  36. xtype : "textfield",
  37. name : "pi_class",
  38. bind : "{pi_class}",
  39. fieldLabel : "单据类型",
  40. readOnly:true,
  41. allowBlank : true,
  42. columnWidth : 0.25
  43. }, {
  44. xtype : "hidden",
  45. name : "pi_vendid",
  46. bind : "{pi_vendid}",
  47. fieldLabel : "供应商ID",
  48. allowBlank : 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. },{
  61. xtype : "hidden",
  62. name : "pi_custid",
  63. bind : "{pi_custid}",
  64. fieldLabel : "客户ID",
  65. allowBlank : true,
  66. columnWidth : 0.0
  67. },{
  68. xtype: 'hidden',
  69. name: 'pi_custcode',
  70. bind: '{pi_custcode}',
  71. fieldLabel: '客户编号'
  72. }, {
  73. xtype: 'dbfindtrigger',
  74. name: 'pi_custname',
  75. bind: '{pi_custname}',
  76. fieldLabel: '客户名称'
  77. },{
  78. xtype : "datefield",
  79. name : "pi_date",
  80. bind : "{pi_date}",
  81. fieldLabel : "单据日期",
  82. allowBlank : false,
  83. columnWidth : 0.25,
  84. defaultValue: new Date()
  85. },{
  86. xtype : "textfield",
  87. name : "pi_total",
  88. bind : "{pi_total}",
  89. fieldLabel : "总额",
  90. allowBlank : true,
  91. readOnly: true,
  92. columnWidth : 0.25
  93. }, {
  94. name : "detailGridField",
  95. xtype : "detailGridField",
  96. storeModel:'saas.model.purchase.ProdIODetail',
  97. // deleteDetailUrl:'http://localhost:9000/prodinout/deleteDetail/',
  98. deleteDetailUrl:'/api/storage/prodinout/deleteDetail/',
  99. detnoColumn: 'pd_pdno',
  100. columns : [
  101. {
  102. text : "id",
  103. dataIndex : "id",
  104. xtype : "numbercolumn",
  105. hidden:true
  106. },{
  107. text : "物料id",
  108. dataIndex : "pd_prodid",
  109. xtype : "numbercolumn",
  110. hidden:true
  111. },
  112. {
  113. text : "物料编号",
  114. width : 200.0,
  115. dataIndex : "pd_prodcode",
  116. xtype : "",
  117. items : null,
  118. editor : {
  119. displayField : "display",
  120. editable : true,
  121. format : "",
  122. hideTrigger : false,
  123. maxLength : 100.0,
  124. minValue : null,
  125. positiveNum : false,
  126. queryMode : "local",
  127. store : null,
  128. valueField : "value",
  129. xtype : "multidbfindtrigger"
  130. }
  131. },
  132. {
  133. text : "名称",
  134. dataIndex : "pr_detail",
  135. ignore:true,
  136. renderer: function (v, m, r) {
  137. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  138. }
  139. },
  140. {
  141. text : "规格",
  142. dataIndex : "pr_spec",
  143. ignore:true,
  144. renderer: function (v, m, r) {
  145. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  146. }
  147. },
  148. {
  149. text : "数量",
  150. dataIndex : "pd_inqty",
  151. width : 120.0,
  152. editor : {
  153. xtype : "numberfield",
  154. decimalPrecision: 8,
  155. minValue:0
  156. },
  157. renderer : function(v) {
  158. var arr = (v + '.').split('.');
  159. var xr = (new Array(arr[1].length)).fill('0');
  160. var format = '0.' + xr.join();
  161. return Ext.util.Format.number(v, format);
  162. },
  163. summaryType: 'sum',
  164. summaryRenderer: function(v) {
  165. var arr = (v + '.').split('.');
  166. var xr = (new Array(arr[1].length)).fill('0');
  167. var format = '0.' + xr.join();
  168. return Ext.util.Format.number(v, format);
  169. }
  170. },{
  171. text : "仓库id",
  172. dataIndex : "pd_whid",
  173. xtype : "numbercolumn",
  174. hidden:true
  175. },
  176. {
  177. text : "仓库编号",
  178. dataIndex : "pd_whcode",
  179. hidden:true
  180. },
  181. {
  182. text : "仓库",
  183. dataIndex : "pd_whname",
  184. width : 120.0,
  185. allowBlank : false,
  186. editor : {
  187. displayField : "display",
  188. editable : true,
  189. format : "",
  190. hideTrigger : false,
  191. maxLength : 100.0,
  192. minValue : null,
  193. positiveNum : false,
  194. queryMode : "local",
  195. store : null,
  196. valueField : "value",
  197. xtype : "dbfindtrigger"
  198. }
  199. },
  200. {
  201. text : "单价",
  202. dataIndex : "pd_orderprice",
  203. width : 120.0,
  204. editor : {
  205. xtype : "numberfield",
  206. decimalPrecision: 8,
  207. minValue:0
  208. },
  209. renderer : function(v) {
  210. var arr = (v + '.').split('.');
  211. var xr = (new Array(arr[1].length)).fill('0');
  212. var format = '0,000.' + xr.join();
  213. return Ext.util.Format.number(v, format);
  214. },
  215. },
  216. {
  217. text : "含税金额",
  218. dataIndex : "pd_total",
  219. width : 120.0,
  220. editor : {
  221. xtype : "numberfield",
  222. decimalPrecision: 2
  223. },
  224. renderer : function(v) {
  225. var arr = (v + '.').split('.');
  226. var xr = (new Array(arr[1].length)).fill('0');
  227. var format = '0,000.' + xr.join();
  228. return Ext.util.Format.number(v, format);
  229. },
  230. summaryType: 'sum',
  231. summaryRenderer: function(v) {
  232. var arr = (v + '.').split('.');
  233. var xr = (new Array(arr[1].length)).fill('0');
  234. var format = '0,000.' + xr.join();
  235. return Ext.util.Format.number(v, format);
  236. }
  237. }, {
  238. text : "税率",
  239. dataIndex : "pd_taxrate",
  240. editor : {
  241. xtype : "numberfield",
  242. decimalPrecision: 0,
  243. minValue: 0,
  244. maxValue: 100
  245. }
  246. },
  247. {
  248. text : "未含税金额",
  249. dataIndex : "pd_nettotal",
  250. editor : {
  251. xtype : "numberfield",
  252. decimalPrecision: 2
  253. },
  254. renderer : function(v) {
  255. var arr = (v + '.').split('.');
  256. var xr = (new Array(arr[1].length)).fill('0');
  257. var format = '0,000.' + xr.join();
  258. return Ext.util.Format.number(v, format);
  259. },
  260. summaryType: 'sum',
  261. summaryRenderer: function(v) {
  262. var arr = (v + '.').split('.');
  263. var xr = (new Array(arr[1].length)).fill('0');
  264. var format = '0,000.' + xr.join();
  265. return Ext.util.Format.number(v, format);
  266. }
  267. }
  268. ]
  269. }, {
  270. xtype : "datefield",
  271. name : "createTime",
  272. bind : "{createTime}",
  273. fieldLabel : "创建时间",
  274. allowBlank : true,
  275. columnWidth : 0.25
  276. }, {
  277. xtype : "datefield",
  278. name : "updateTime",
  279. bind : "{updateTime}",
  280. fieldLabel : "更新时间",
  281. allowBlank : true,
  282. columnWidth : 0.25
  283. }, {
  284. xtype : "textfield",
  285. readOnly : true,
  286. editable : false,
  287. name : "pi_status",
  288. bind : "{pi_status}",
  289. fieldLabel : "单据状态",
  290. allowBlank : true,
  291. columnWidth : 0.25
  292. }, {
  293. xtype : "hidden",
  294. readOnly : true,
  295. editable : false,
  296. name : "pi_statuscode",
  297. bind : "{pi_statuscode}",
  298. fieldLabel : "单据状态码",
  299. allowBlank : true,
  300. columnWidth : 0.0
  301. }]
  302. });