FormPanel.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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. text: 'model映射需要',
  134. dataIndex: 'productDTO',
  135. hidden: true,
  136. },
  137. {
  138. text : "名称",
  139. dataIndex : "pr_detail",
  140. ignore:true,
  141. renderer: function (v, m, r) {
  142. if(!v){
  143. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  144. }
  145. return v;
  146. }
  147. },
  148. {
  149. text : "规格",
  150. dataIndex : "pr_spec",
  151. ignore:true,
  152. renderer: function (v, m, r) {
  153. if(!v){
  154. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  155. }
  156. return v;
  157. }
  158. },
  159. {
  160. text : "数量",
  161. xtype: 'numbercolumn',
  162. dataIndex : "pd_inqty",
  163. width : 120.0,
  164. allowBlank : false,
  165. editor : {
  166. xtype : "numberfield",
  167. decimalPrecision: 8,
  168. minValue:0
  169. },
  170. renderer : function(v) {
  171. var arr = (v + '.').split('.');
  172. var xr = (new Array(arr[1].length)).fill('0');
  173. var format = '0.' + xr.join();
  174. return Ext.util.Format.number(v, format);
  175. },
  176. summaryType: 'sum',
  177. summaryRenderer: function(v) {
  178. var arr = (v + '.').split('.');
  179. var xr = (new Array(arr[1].length)).fill('0');
  180. var format = '0.' + xr.join();
  181. return Ext.util.Format.number(v, format);
  182. }
  183. },{
  184. text : "仓库id",
  185. dataIndex : "pd_whid",
  186. xtype : "numbercolumn",
  187. hidden:true
  188. },
  189. {
  190. text : "仓库编号",
  191. dataIndex : "pd_whcode",
  192. hidden:true
  193. },
  194. {
  195. text : "仓库",
  196. dataIndex : "pd_whname",
  197. width : 120.0,
  198. allowBlank : false,
  199. editor : {
  200. displayField : "display",
  201. editable : true,
  202. format : "",
  203. hideTrigger : false,
  204. maxLength : 100.0,
  205. minValue : null,
  206. positiveNum : false,
  207. queryMode : "local",
  208. store : null,
  209. valueField : "value",
  210. xtype : "dbfindtrigger"
  211. }
  212. },
  213. {
  214. text : "单价",
  215. xtype: 'numbercolumn',
  216. dataIndex : "pd_orderprice",
  217. width : 120.0,
  218. editor : {
  219. xtype : "numberfield",
  220. decimalPrecision: 8,
  221. minValue:0
  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. },
  230. {
  231. text : "含税金额",
  232. xtype: 'numbercolumn',
  233. dataIndex : "pd_total",
  234. width : 120.0,
  235. editor : {
  236. xtype : "numberfield",
  237. decimalPrecision: 2,
  238. editable:false
  239. },
  240. renderer : function(v) {
  241. var arr = (v + '.').split('.');
  242. var xr = (new Array(arr[1].length)).fill('0');
  243. var format = '0,000.' + xr.join();
  244. return Ext.util.Format.number(v, format);
  245. },
  246. summaryType: 'sum',
  247. summaryRenderer: function(v) {
  248. var arr = (v + '.').split('.');
  249. var xr = (new Array(arr[1].length)).fill('0');
  250. var format = '0,000.' + xr.join();
  251. return Ext.util.Format.number(v, format);
  252. }
  253. }, {
  254. text : "税率",
  255. xtype: 'numbercolumn',
  256. dataIndex : "pd_taxrate",
  257. editor : {
  258. xtype : "numberfield",
  259. decimalPrecision: 0,
  260. minValue: 0,
  261. maxValue: 100
  262. }
  263. },
  264. {
  265. text : "未税金额",
  266. xtype: 'numbercolumn',
  267. dataIndex : "pd_nettotal",
  268. editor : {
  269. xtype : "numberfield",
  270. decimalPrecision: 2,
  271. editable:false
  272. },
  273. renderer : function(v) {
  274. var arr = (v + '.').split('.');
  275. var xr = (new Array(arr[1].length)).fill('0');
  276. var format = '0,000.' + xr.join();
  277. return Ext.util.Format.number(v, format);
  278. },
  279. summaryType: 'sum',
  280. summaryRenderer: function(v) {
  281. var arr = (v + '.').split('.');
  282. var xr = (new Array(arr[1].length)).fill('0');
  283. var format = '0,000.' + xr.join();
  284. return Ext.util.Format.number(v, format);
  285. }
  286. }
  287. ]
  288. },{
  289. xtype : "textfield",
  290. name : "pi_recordman",
  291. fieldLabel : "录入人",
  292. readOnly:true
  293. }, {
  294. xtype : "datefield",
  295. name : "createTime",
  296. fieldLabel : "录入日期",
  297. readOnly:true
  298. }, {
  299. xtype : "textfield",
  300. name : "pi_auditman",
  301. fieldLabel : "审核人",
  302. readOnly:true
  303. }, {
  304. xtype : "datefield",
  305. name : "pi_auditdate",
  306. fieldLabel : "审核日期",
  307. readOnly:true
  308. }]
  309. });