FormPanel.js 11 KB

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