FormPanel.js 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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. allowBlank : false,
  119. editor : {
  120. displayField : "display",
  121. editable : true,
  122. format : "",
  123. hideTrigger : false,
  124. maxLength : 100.0,
  125. minValue : null,
  126. positiveNum : false,
  127. queryMode : "local",
  128. store : null,
  129. valueField : "value",
  130. xtype : "multidbfindtrigger"
  131. }
  132. },
  133. {
  134. text : "名称",
  135. dataIndex : "pr_detail",
  136. ignore:true,
  137. renderer: function (v, m, r) {
  138. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  139. }
  140. },
  141. {
  142. text : "规格",
  143. dataIndex : "pr_spec",
  144. ignore:true,
  145. renderer: function (v, m, r) {
  146. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  147. }
  148. },
  149. {
  150. text : "数量",
  151. dataIndex : "pd_inqty",
  152. width : 120.0,
  153. allowBlank : false,
  154. editor : {
  155. xtype : "numberfield",
  156. decimalPrecision: 8,
  157. minValue:0
  158. },
  159. renderer : function(v) {
  160. var arr = (v + '.').split('.');
  161. var xr = (new Array(arr[1].length)).fill('0');
  162. var format = '0.' + xr.join();
  163. return Ext.util.Format.number(v, format);
  164. },
  165. summaryType: 'sum',
  166. summaryRenderer: function(v) {
  167. var arr = (v + '.').split('.');
  168. var xr = (new Array(arr[1].length)).fill('0');
  169. var format = '0.' + xr.join();
  170. return Ext.util.Format.number(v, format);
  171. }
  172. },{
  173. text : "仓库id",
  174. dataIndex : "pd_whid",
  175. xtype : "numbercolumn",
  176. hidden:true
  177. },
  178. {
  179. text : "仓库编号",
  180. dataIndex : "pd_whcode",
  181. hidden:true
  182. },
  183. {
  184. text : "仓库",
  185. dataIndex : "pd_whname",
  186. width : 120.0,
  187. allowBlank : false,
  188. editor : {
  189. displayField : "display",
  190. editable : true,
  191. format : "",
  192. hideTrigger : false,
  193. maxLength : 100.0,
  194. minValue : null,
  195. positiveNum : false,
  196. queryMode : "local",
  197. store : null,
  198. valueField : "value",
  199. xtype : "dbfindtrigger"
  200. }
  201. },
  202. {
  203. text : "单价",
  204. dataIndex : "pd_orderprice",
  205. width : 120.0,
  206. editor : {
  207. xtype : "numberfield",
  208. decimalPrecision: 8,
  209. minValue:0
  210. },
  211. renderer : function(v) {
  212. var arr = (v + '.').split('.');
  213. var xr = (new Array(arr[1].length)).fill('0');
  214. var format = '0,000.' + xr.join();
  215. return Ext.util.Format.number(v, format);
  216. },
  217. },
  218. {
  219. text : "含税金额",
  220. dataIndex : "pd_total",
  221. width : 120.0,
  222. editor : {
  223. xtype : "numberfield",
  224. decimalPrecision: 2,
  225. editable:false
  226. },
  227. renderer : function(v) {
  228. var arr = (v + '.').split('.');
  229. var xr = (new Array(arr[1].length)).fill('0');
  230. var format = '0,000.' + xr.join();
  231. return Ext.util.Format.number(v, format);
  232. },
  233. summaryType: 'sum',
  234. summaryRenderer: function(v) {
  235. var arr = (v + '.').split('.');
  236. var xr = (new Array(arr[1].length)).fill('0');
  237. var format = '0,000.' + xr.join();
  238. return Ext.util.Format.number(v, format);
  239. }
  240. }, {
  241. text : "税率",
  242. dataIndex : "pd_taxrate",
  243. editor : {
  244. xtype : "numberfield",
  245. decimalPrecision: 0,
  246. minValue: 0,
  247. maxValue: 100
  248. }
  249. },
  250. {
  251. text : "未税金额",
  252. dataIndex : "pd_nettotal",
  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. },{
  274. xtype : "textfield",
  275. name : "pi_recordman",
  276. fieldLabel : "录入人",
  277. readOnly:true
  278. }, {
  279. xtype : "datefield",
  280. name : "createTime",
  281. fieldLabel : "录入日期",
  282. readOnly:true
  283. }, {
  284. xtype : "textfield",
  285. name : "pi_auditman",
  286. fieldLabel : "审核人",
  287. readOnly:true
  288. }, {
  289. xtype : "datefield",
  290. name : "pi_auditdate",
  291. fieldLabel : "审核日期",
  292. readOnly:true
  293. }]
  294. });