FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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: 'dbfindtrigger',
  66. name: 'pi_vendname',
  67. fieldLabel: '供应商名称',
  68. allowBlank : false,
  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:'http://localhost:9000/prodinout/deleteDetail/',
  90. deleteDetailUrl:'/api/storage/prodinout/deleteDetail/',
  91. detnoColumn: 'pd_pdno',
  92. columns : [
  93. {
  94. text : "id",
  95. dataIndex : "id",
  96. xtype : "numbercolumn",
  97. hidden:true
  98. },{
  99. text : "物料id",
  100. dataIndex : "pd_prodid",
  101. xtype : "numbercolumn",
  102. hidden:true
  103. },
  104. {
  105. text : "物料编号",
  106. width : 200.0,
  107. dataIndex : "pd_prodcode",
  108. xtype : "",
  109. items : null,
  110. allowBlank : false,
  111. editor : {
  112. displayField : "display",
  113. editable : true,
  114. format : "",
  115. hideTrigger : false,
  116. maxLength : 100.0,
  117. minValue : null,
  118. positiveNum : false,
  119. queryMode : "local",
  120. store : null,
  121. valueField : "value",
  122. xtype : "multidbfindtrigger"
  123. }
  124. },{
  125. text: 'model映射需要',
  126. dataIndex: 'productDTO',
  127. hidden: true,
  128. },
  129. {
  130. text : "名称",
  131. dataIndex : "pr_detail",
  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. ignore:true,
  144. renderer: function (v, m, r) {
  145. if(!v){
  146. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  147. }
  148. return v;
  149. }
  150. },
  151. {
  152. text : "数量",
  153. xtype: 'numbercolumn',
  154. dataIndex : "pd_inqty",
  155. width : 120.0,
  156. allowBlank : false,
  157. editor : {
  158. xtype : "numberfield",
  159. decimalPrecision: 3,
  160. minValue:0
  161. },
  162. renderer : function(v) {
  163. var arr = (v + '.').split('.');
  164. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  165. var format = '0.' + xr.join();
  166. return Ext.util.Format.number(v, format);
  167. },
  168. summaryType: 'sum',
  169. summaryRenderer: function(v) {
  170. var arr = (v + '.').split('.');
  171. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  172. var format = '0.' + xr.join();
  173. return Ext.util.Format.number(v, format);
  174. }
  175. },{
  176. text : "仓库id",
  177. dataIndex : "pd_whid",
  178. xtype : "numbercolumn",
  179. hidden:true
  180. },
  181. {
  182. text : "仓库编号",
  183. dataIndex : "pd_whcode",
  184. hidden:true
  185. },
  186. {
  187. text : "仓库",
  188. dataIndex : "pd_whname",
  189. width : 120.0,
  190. allowBlank : false,
  191. editor : {
  192. displayField : "display",
  193. editable : true,
  194. format : "",
  195. hideTrigger : false,
  196. maxLength : 100.0,
  197. minValue : null,
  198. positiveNum : false,
  199. queryMode : "local",
  200. store : null,
  201. valueField : "value",
  202. xtype : "dbfindtrigger"
  203. }
  204. },
  205. {
  206. text : "单价",
  207. xtype: 'numbercolumn',
  208. dataIndex : "pd_orderprice",
  209. width : 120.0,
  210. editor : {
  211. xtype : "numberfield",
  212. decimalPrecision: 8,
  213. minValue:0
  214. },
  215. renderer : function(v) {
  216. var arr = (v + '.').split('.');
  217. var xr = (new Array(arr[1].length)).fill('0');
  218. var format = '0,000.' + xr.join();
  219. return Ext.util.Format.number(v, format);
  220. },
  221. },
  222. {
  223. text : "含税金额",
  224. xtype: 'numbercolumn',
  225. dataIndex : "pd_total",
  226. width : 120.0,
  227. editor : {
  228. xtype : "numberfield",
  229. decimalPrecision: 2,
  230. editable:false
  231. },
  232. renderer : function(v) {
  233. var arr = (v + '.').split('.');
  234. var xr = (new Array(arr[1].length)).fill('0');
  235. var format = '0,000.' + xr.join();
  236. return Ext.util.Format.number(v, format);
  237. },
  238. summaryType: 'sum',
  239. summaryRenderer: function(v) {
  240. var arr = (v + '.').split('.');
  241. var xr = (new Array(arr[1].length)).fill('0');
  242. var format = '0,000.' + xr.join();
  243. return Ext.util.Format.number(v, format);
  244. }
  245. }, {
  246. text : "税率",
  247. xtype: 'numbercolumn',
  248. dataIndex : "pd_taxrate",
  249. editor : {
  250. xtype : "numberfield",
  251. decimalPrecision: 0,
  252. minValue: 0,
  253. maxValue: 100
  254. }
  255. },
  256. {
  257. text : "未税金额",
  258. xtype: 'numbercolumn',
  259. dataIndex : "pd_nettotal",
  260. editor : {
  261. xtype : "numberfield",
  262. decimalPrecision: 2,
  263. editable:false
  264. },
  265. renderer : function(v) {
  266. var arr = (v + '.').split('.');
  267. var xr = (new Array(arr[1].length)).fill('0');
  268. var format = '0,000.' + xr.join();
  269. return Ext.util.Format.number(v, format);
  270. },
  271. summaryType: 'sum',
  272. summaryRenderer: function(v) {
  273. var arr = (v + '.').split('.');
  274. var xr = (new Array(arr[1].length)).fill('0');
  275. var format = '0,000.' + xr.join();
  276. return Ext.util.Format.number(v, format);
  277. }
  278. },{
  279. text : "备注",
  280. dataIndex : "pd_remark",
  281. width : 250,
  282. items : null,
  283. editor : {
  284. xtype : "textfield"
  285. },
  286. }
  287. ]
  288. },{
  289. xtype : "hidden",
  290. name : "creatorId",
  291. fieldLabel : "录入人ID",
  292. readOnly:true
  293. },
  294. {
  295. xtype : "textfield",
  296. name : "creatorName",
  297. fieldLabel : "录入人",
  298. readOnly:true
  299. }, {
  300. xtype : "datefield",
  301. name : "createTime",
  302. fieldLabel : "录入日期",
  303. readOnly:true,
  304. defaultValue: new Date()
  305. },{
  306. xtype : "hidden",
  307. name : "updaterId",
  308. fieldLabel : "更新人ID",
  309. readOnly:true
  310. },{
  311. xtype : "hidden",
  312. name : "updaterName",
  313. fieldLabel : "更新人",
  314. readOnly:true
  315. }, {
  316. xtype : "hidden",
  317. name : "updateTime",
  318. fieldLabel : "更新日期",
  319. readOnly:true,
  320. defaultValue: new Date()
  321. }, {
  322. xtype : "textfield",
  323. name : "pi_auditman",
  324. fieldLabel : "审核人",
  325. readOnly:true
  326. }, {
  327. xtype : "datefield",
  328. name : "pi_auditdate",
  329. fieldLabel : "审核日期",
  330. readOnly:true
  331. }]
  332. });