FormPanel.js 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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_custid",
  46. bind : "{pi_custid}",
  47. fieldLabel : "客户ID",
  48. allowBlank : true,
  49. columnWidth : 0.0
  50. },{
  51. xtype: 'hidden',
  52. name: 'pi_custcode',
  53. bind: '{pi_custcode}',
  54. fieldLabel: '客户编号'
  55. }, {
  56. xtype: 'dbfindtrigger',
  57. name: 'pi_custname',
  58. bind: '{pi_custname}',
  59. fieldLabel: '客户名称'
  60. },{
  61. xtype : "datefield",
  62. name : "pi_date",
  63. bind : "{pi_date}",
  64. fieldLabel : "单据日期",
  65. allowBlank : false,
  66. columnWidth : 0.25,
  67. defaultValue: new Date()
  68. },{
  69. xtype : "textfield",
  70. name : "pi_total",
  71. bind : "{pi_total}",
  72. fieldLabel : "总额",
  73. allowBlank : true,
  74. readOnly: true,
  75. columnWidth : 0.25
  76. }, {
  77. name : "detailGridField",
  78. xtype : "detailGridField",
  79. storeModel:'saas.model.purchase.ProdIODetail',
  80. // deleteDetailUrl:'http://localhost:9000/prodinout/deleteDetail/',
  81. deleteDetailUrl:'/api/storage/prodinout/deleteDetail/',
  82. detnoColumn: 'pd_pdno',
  83. columns : [
  84. {
  85. text : "id",
  86. dataIndex : "id",
  87. xtype : "numbercolumn",
  88. hidden:true
  89. },{
  90. text : "物料id",
  91. dataIndex : "pd_prodid",
  92. xtype : "numbercolumn",
  93. hidden:true
  94. },
  95. {
  96. text : "物料编号",
  97. width : 200.0,
  98. dataIndex : "pd_prodcode",
  99. xtype : "",
  100. items : null,
  101. allowBlank : false,
  102. editor : {
  103. displayField : "display",
  104. editable : true,
  105. format : "",
  106. hideTrigger : false,
  107. maxLength : 100.0,
  108. minValue : null,
  109. positiveNum : false,
  110. queryMode : "local",
  111. store : null,
  112. valueField : "value",
  113. xtype : "multidbfindtrigger"
  114. }
  115. },{
  116. text: 'model映射需要',
  117. dataIndex: 'productDTO',
  118. hidden: true,
  119. },
  120. {
  121. text : "名称",
  122. dataIndex : "pr_detail",
  123. ignore:true,
  124. renderer: function (v, m, r) {
  125. if(!v){
  126. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  127. }
  128. return v;
  129. }
  130. },
  131. {
  132. text : "规格",
  133. dataIndex : "pr_spec",
  134. ignore:true,
  135. renderer: function (v, m, r) {
  136. if(!v){
  137. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  138. }
  139. return v;
  140. }
  141. },
  142. {
  143. text : "数量",
  144. xtype: 'numbercolumn',
  145. dataIndex : "pd_inqty",
  146. width : 120.0,
  147. allowBlank : false,
  148. editor : {
  149. xtype : "numberfield",
  150. decimalPrecision: 8,
  151. minValue:0
  152. },
  153. renderer : function(v) {
  154. var arr = (v + '.').split('.');
  155. var xr = (new Array(arr[1].length)).fill('0');
  156. var format = '0.' + xr.join();
  157. return Ext.util.Format.number(v, format);
  158. },
  159. summaryType: 'sum',
  160. summaryRenderer: function(v) {
  161. var arr = (v + '.').split('.');
  162. var xr = (new Array(arr[1].length)).fill('0');
  163. var format = '0.' + xr.join();
  164. return Ext.util.Format.number(v, format);
  165. }
  166. },{
  167. text : "仓库id",
  168. dataIndex : "pd_whid",
  169. xtype : "numbercolumn",
  170. hidden:true
  171. },
  172. {
  173. text : "仓库编号",
  174. dataIndex : "pd_whcode",
  175. hidden:true
  176. },
  177. {
  178. text : "仓库",
  179. dataIndex : "pd_whname",
  180. width : 120.0,
  181. allowBlank : false,
  182. editor : {
  183. displayField : "display",
  184. editable : true,
  185. format : "",
  186. hideTrigger : false,
  187. maxLength : 100.0,
  188. minValue : null,
  189. positiveNum : false,
  190. queryMode : "local",
  191. store : null,
  192. valueField : "value",
  193. xtype : "dbfindtrigger"
  194. }
  195. },
  196. {
  197. text : "单价",
  198. xtype: 'numbercolumn',
  199. dataIndex : "pd_orderprice",
  200. width : 120.0,
  201. editor : {
  202. xtype : "numberfield",
  203. decimalPrecision: 8,
  204. minValue:0
  205. },
  206. renderer : function(v) {
  207. var arr = (v + '.').split('.');
  208. var xr = (new Array(arr[1].length)).fill('0');
  209. var format = '0,000.' + xr.join();
  210. return Ext.util.Format.number(v, format);
  211. },
  212. },
  213. {
  214. text : "含税金额",
  215. xtype: 'numbercolumn',
  216. dataIndex : "pd_total",
  217. width : 120.0,
  218. editor : {
  219. xtype : "numberfield",
  220. decimalPrecision: 2,
  221. editable:false
  222. },
  223. renderer : function(v) {
  224. var arr = (v + '.').split('.');
  225. var xr = (new Array(arr[1].length)).fill('0');
  226. var format = '0,000.' + xr.join();
  227. return Ext.util.Format.number(v, format);
  228. },
  229. summaryType: 'sum',
  230. summaryRenderer: 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. editor : {
  241. xtype : "numberfield",
  242. decimalPrecision: 0,
  243. minValue: 0,
  244. maxValue: 100
  245. }
  246. },
  247. {
  248. text : "未税金额",
  249. xtype: 'numbercolumn',
  250. dataIndex : "pd_nettotal",
  251. editor : {
  252. xtype : "numberfield",
  253. decimalPrecision: 2,
  254. editable:false
  255. },
  256. renderer : function(v) {
  257. var arr = (v + '.').split('.');
  258. var xr = (new Array(arr[1].length)).fill('0');
  259. var format = '0,000.' + xr.join();
  260. return Ext.util.Format.number(v, format);
  261. },
  262. summaryType: 'sum',
  263. summaryRenderer: function(v) {
  264. var arr = (v + '.').split('.');
  265. var xr = (new Array(arr[1].length)).fill('0');
  266. var format = '0,000.' + xr.join();
  267. return Ext.util.Format.number(v, format);
  268. }
  269. }
  270. ]
  271. },{
  272. xtype : "textfield",
  273. name : "pi_recordman",
  274. fieldLabel : "录入人",
  275. readOnly:true
  276. }, {
  277. xtype : "datefield",
  278. name : "createTime",
  279. fieldLabel : "录入日期",
  280. readOnly:true
  281. }, {
  282. xtype : "textfield",
  283. name : "pi_auditman",
  284. fieldLabel : "审核人",
  285. readOnly:true
  286. }, {
  287. xtype : "datefield",
  288. name : "pi_auditdate",
  289. fieldLabel : "审核日期",
  290. readOnly:true
  291. }]
  292. });