FormPanel.js 11 KB

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