FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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. _auditmanField: 'pi_auditman',
  15. _auditdateField:'pi_auditdate',
  16. _relationColumn: 'pd_piid',
  17. _readUrl:'/api/storage/prodinout/read',
  18. _saveUrl:'/api/storage/prodinout/save',
  19. _auditUrl:'/api/storage/prodinout/audit',
  20. _unAuditUrl: '/api/storage/prodinout/unAudit',
  21. _deleteUrl:'/api/storage/prodinout/delete',
  22. initId:0,
  23. toolBtns: [],
  24. defaultItems: [{
  25. xtype: 'hidden',
  26. name: 'id',
  27. bind: '{id}',
  28. fieldLabel: 'id',
  29. allowBlank: true,
  30. columnWidth: 0
  31. },{
  32. xtype : "textfield",
  33. name : "pi_class",
  34. bind : "{pi_class}",
  35. fieldLabel : "单据类型",
  36. readOnly:true,
  37. allowBlank : true,
  38. columnWidth : 0.25
  39. },{
  40. xtype : "hidden",
  41. name : "pi_custid",
  42. bind : "{pi_custid}",
  43. fieldLabel : "客户ID",
  44. allowBlank : true,
  45. columnWidth : 0.0
  46. },{
  47. xtype: 'hidden',
  48. name: 'pi_custcode',
  49. bind: '{pi_custcode}',
  50. fieldLabel: '客户编号'
  51. }, {
  52. xtype: 'hidden',
  53. name: 'pi_custname',
  54. bind: '{pi_custname}',
  55. fieldLabel: '客户名称'
  56. },{
  57. xtype : "hidden",
  58. name : "pi_vendid",
  59. fieldLabel : "供应商ID",
  60. allowBlank : true,
  61. columnWidth : 0.0
  62. },{
  63. xtype: 'hidden',
  64. name: 'pi_vendcode',
  65. fieldLabel: '供应商编号'
  66. }, {
  67. xtype: 'vendorDbfindTrigger',
  68. name: 'pi_vendname',
  69. fieldLabel: '供应商名称',
  70. allowBlank : true,
  71. },{
  72. xtype : "datefield",
  73. name : "pi_date",
  74. bind : "{pi_date}",
  75. fieldLabel : "单据日期",
  76. allowBlank : false,
  77. columnWidth : 0.25,
  78. defaultValue: new Date()
  79. },{
  80. xtype : "textfield",
  81. name : "pi_total",
  82. bind : "{pi_total}",
  83. fieldLabel : "总额",
  84. allowBlank : true,
  85. readOnly: true,
  86. columnWidth : 0.25
  87. }, {
  88. name : "detailGridField",
  89. xtype : "detailGridField",
  90. storeModel:'saas.model.purchase.ProdIODetail',
  91. deleteDetailUrl:'/api/storage/prodinout/deleteDetail',
  92. detnoColumn: 'pd_pdno',
  93. columns : [
  94. {
  95. text : "id",
  96. dataIndex : "id",
  97. xtype : "numbercolumn",
  98. hidden:true
  99. },{
  100. text : "物料id",
  101. dataIndex : "pd_prodid",
  102. xtype : "numbercolumn",
  103. hidden:true
  104. },
  105. {
  106. text : "物料编号",
  107. width : 150.0,
  108. dataIndex : "pd_prodcode",
  109. xtype : "",
  110. items : null,
  111. allowBlank : false,
  112. editor : {
  113. displayField : "display",
  114. editable : true,
  115. format : "",
  116. hideTrigger : false,
  117. maxLength : 100.0,
  118. minValue : null,
  119. positiveNum : false,
  120. queryMode : "local",
  121. store : null,
  122. valueField : "value",
  123. xtype : "productMultiDbfindTrigger"
  124. }
  125. },{
  126. text: 'model映射需要',
  127. dataIndex: 'productDTO',
  128. hidden: true,
  129. },
  130. {
  131. text : "名称",
  132. dataIndex : "pr_detail",
  133. width : 200.0,
  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. dataIndex : "pr_spec",
  145. width : 150.0,
  146. ignore:true,
  147. renderer: function (v, m, r) {
  148. if(!v){
  149. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  150. }
  151. return v;
  152. }
  153. },
  154. {
  155. text : "数量",
  156. xtype: 'numbercolumn',
  157. dataIndex : "pd_inqty",
  158. width : 110.0,
  159. allowBlank : false,
  160. editor : {
  161. xtype : "numberfield",
  162. decimalPrecision: 3,
  163. minValue:0
  164. },
  165. renderer : function(v) {
  166. var arr = (v + '.').split('.');
  167. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  168. var format = '0.' + xr.join();
  169. return Ext.util.Format.number(v, format);
  170. },
  171. summaryType: 'sum',
  172. summaryRenderer: function(v) {
  173. var arr = (v + '.').split('.');
  174. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  175. var format = '0.' + xr.join();
  176. return Ext.util.Format.number(v, format);
  177. }
  178. },{
  179. text : "仓库id",
  180. dataIndex : "pd_whid",
  181. xtype : "numbercolumn",
  182. hidden:true
  183. },
  184. {
  185. text : "仓库编号",
  186. dataIndex : "pd_whcode",
  187. hidden:true
  188. },
  189. {
  190. text : "仓库",
  191. dataIndex : "pd_whname",
  192. width : 150.0,
  193. allowBlank : false,
  194. editor : {
  195. displayField : "display",
  196. editable : true,
  197. format : "",
  198. hideTrigger : false,
  199. maxLength : 100.0,
  200. minValue : null,
  201. positiveNum : false,
  202. queryMode : "local",
  203. store : null,
  204. valueField : "value",
  205. xtype : "warehouseDbfindTrigger"
  206. }
  207. },
  208. {
  209. text : "单价",
  210. xtype: 'numbercolumn',
  211. dataIndex : "pd_orderprice",
  212. width : 110.0,
  213. editor : {
  214. xtype : "numberfield",
  215. decimalPrecision: 8,
  216. minValue:0
  217. },
  218. renderer : function(v) {
  219. var arr = (v + '.').split('.');
  220. var xr = (new Array(arr[1].length)).fill('0');
  221. var format = '0,000.' + xr.join();
  222. return Ext.util.Format.number(v, format);
  223. },
  224. },
  225. {
  226. text : "含税金额",
  227. xtype: 'numbercolumn',
  228. dataIndex : "pd_total",
  229. width : 110.0,
  230. editor : {
  231. xtype : "numberfield",
  232. decimalPrecision: 2,
  233. editable:false
  234. },
  235. renderer : function(v) {
  236. var arr = (v + '.').split('.');
  237. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  238. var format = '0,000.' + xr.join();
  239. return Ext.util.Format.number(v, format);
  240. },
  241. summaryType: 'sum',
  242. summaryRenderer: function(v) {
  243. var arr = (v + '.').split('.');
  244. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  245. var format = '0,000.' + xr.join();
  246. return Ext.util.Format.number(v, format);
  247. }
  248. }, {
  249. text : "税率",
  250. xtype: 'numbercolumn',
  251. dataIndex : "pd_taxrate",
  252. width : 80.0,
  253. editor : {
  254. xtype : "numberfield",
  255. decimalPrecision: 0,
  256. minValue: 0,
  257. maxValue: 100
  258. },
  259. renderer : function(v) {
  260. return Ext.util.Format.number(v, '0');
  261. }
  262. },
  263. {
  264. text : "未税金额",
  265. xtype: 'numbercolumn',
  266. dataIndex : "pd_nettotal",
  267. width : 110.0,
  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 > 2 ? 2 : 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 > 2 ? 2 : arr[1].length)).fill('0');
  283. var format = '0,000.' + xr.join();
  284. return Ext.util.Format.number(v, format);
  285. }
  286. },{
  287. text : "备注",
  288. dataIndex : "pd_remark",
  289. width : 250,
  290. items : null,
  291. editor : {
  292. xtype : "textfield"
  293. },
  294. }
  295. ]
  296. },{
  297. xtype : "textfield",
  298. name : "pi_remark",
  299. fieldLabel : "备注",
  300. columnWidth : 1
  301. },{
  302. xtype : "hidden",
  303. name : "creatorId",
  304. fieldLabel : "录入人ID",
  305. readOnly:true
  306. },
  307. {
  308. xtype : "textfield",
  309. name : "creatorName",
  310. fieldLabel : "录入人",
  311. readOnly:true
  312. }, {
  313. xtype : "datefield",
  314. name : "createTime",
  315. fieldLabel : "录入日期",
  316. readOnly:true,
  317. defaultValue: new Date()
  318. },{
  319. xtype : "hidden",
  320. name : "updaterId",
  321. fieldLabel : "更新人ID",
  322. readOnly:true
  323. },{
  324. xtype : "hidden",
  325. name : "updaterName",
  326. fieldLabel : "更新人",
  327. readOnly:true
  328. }, {
  329. xtype : "hidden",
  330. name : "updateTime",
  331. fieldLabel : "更新日期",
  332. readOnly:true,
  333. defaultValue: new Date()
  334. }, {
  335. xtype : "textfield",
  336. name : "pi_auditman",
  337. fieldLabel : "审核人",
  338. readOnly:true
  339. }, {
  340. xtype : "datefield",
  341. name : "pi_auditdate",
  342. fieldLabel : "审核日期",
  343. readOnly:true
  344. }]
  345. });