FormPanel.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'purchase-purchasein-formpanel',
  4. controller: 'purchase-purchasein-formpanel',
  5. viewModel: 'purchase-purchasein-formpanel',
  6. viewName: 'purchase-purchasein-formpanel',
  7. caller:'PurchaseIn',
  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/purchase/prodinout/read/',
  16. _saveUrl:'/api/purchase/prodinout/save',
  17. _auditUrl:'/api/purchase/prodinout/audit',
  18. _unAuditUrl:'/api/purchase/prodinout/unAudit/',
  19. _deleteUrl:'/api/purchase/prodinout/delete/',
  20. _turnOutUrl:'/api/purchase/prodinout/turnProdOut/',
  21. // _relationColumn: 'pd_piid',
  22. // _readUrl:'http://localhost:8800/prodinout/read/',
  23. // _saveUrl:'http://localhost:8800/prodinout/save',
  24. // _auditUrl:'http://localhost:8800/prodinout/audit',
  25. // _unAuditUrl:'http://localhost:8800/prodinout/unAudit/',
  26. // _deleteUrl:'http://localhost:8800/prodinout/delete/',
  27. // _turnOutUrl:'http://localhost:8800/prodinout/turnProdOut/',
  28. initId:0,
  29. toolBtns: [{
  30. xtype: 'button',
  31. text: '转采购验退单',
  32. bind: {
  33. hidden: '{turnHidden}'
  34. },
  35. handler: 'turnOut'
  36. }],
  37. defaultItems: [{
  38. xtype: 'hidden',
  39. name: 'id',
  40. bind: '{id}',
  41. fieldLabel: 'id',
  42. allowBlank: true,
  43. columnWidth: 0
  44. },{
  45. xtype : "textfield",
  46. name : "pi_class",
  47. bind : "{pi_class}",
  48. fieldLabel : "单据类型",
  49. readOnly:true,
  50. allowBlank : true,
  51. columnWidth : 0.25
  52. }, {
  53. xtype : "hidden",
  54. name : "pi_vendid",
  55. bind : "{pi_vendid}",
  56. fieldLabel : "供应商ID",
  57. allowBlank : true,
  58. columnWidth : 0.0
  59. },{
  60. xtype: 'hidden',
  61. name: 'pi_vendcode',
  62. bind: '{pi_vendcode}',
  63. fieldLabel: '供应商编号'
  64. }, {
  65. xtype: 'dbfindtrigger',
  66. name: 'pi_vendname',
  67. bind: '{pi_vendname}',
  68. fieldLabel: '供应商名称',
  69. allowBlank : false,
  70. },{
  71. xtype : "datefield",
  72. name : "pi_date",
  73. bind : "{pi_date}",
  74. fieldLabel : "单据日期",
  75. allowBlank : false,
  76. columnWidth : 0.25,
  77. defaultValue: new Date()
  78. },{
  79. xtype : "textfield",
  80. name : "pi_total",
  81. bind : "{pi_total}",
  82. fieldLabel : "总额",
  83. allowBlank : true,
  84. readOnly: true,
  85. columnWidth : 0.25
  86. }, {
  87. xtype : "hidden",
  88. name : "pi_puid",
  89. bind : "{pi_puid}",
  90. fieldLabel : "采购单id",
  91. allowBlank : true,
  92. columnWidth : 0.25
  93. },{
  94. xtype : "hidden",
  95. name : "pi_pucode",
  96. bind : "{pi_pucode}",
  97. fieldLabel : "采购单号",
  98. allowBlank : true,
  99. columnWidth : 0.25
  100. }, {
  101. name : "detailGridField",
  102. xtype : "detailGridField",
  103. storeModel:'saas.model.purchase.ProdIODetail',
  104. // deleteDetailUrl:'http://localhost:8800/prodinout/deleteDetail/',
  105. deleteDetailUrl:'/api/purchase/prodinout/deleteDetail/',
  106. detnoColumn: 'pd_pdno',
  107. columns : [
  108. {
  109. text : "id",
  110. dataIndex : "id",
  111. xtype : "numbercolumn",
  112. hidden:true
  113. },{
  114. text : "物料id",
  115. dataIndex : "pd_prodid",
  116. xtype : "numbercolumn",
  117. hidden:true
  118. },
  119. {
  120. text : "物料编号",
  121. width : 200.0,
  122. dataIndex : "pd_prodcode",
  123. xtype : "",
  124. items : null,
  125. allowBlank : false,
  126. editor : {
  127. displayField : "display",
  128. editable : true,
  129. format : "",
  130. hideTrigger : false,
  131. maxLength : 100.0,
  132. minValue : null,
  133. positiveNum : false,
  134. queryMode : "local",
  135. store : null,
  136. valueField : "value",
  137. xtype : "multidbfindtrigger"
  138. }
  139. },{
  140. text: 'model映射需要',
  141. dataIndex: 'productDTO',
  142. hidden: true,
  143. },
  144. {
  145. text : "名称",
  146. dataIndex : "pr_detail",
  147. ignore:true,
  148. renderer: function (v, m, r) {
  149. if(!v){
  150. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  151. }
  152. return v;
  153. }
  154. },
  155. {
  156. text : "规格",
  157. dataIndex : "pr_spec",
  158. ignore:true,
  159. renderer: function (v, m, r) {
  160. if(!v){
  161. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  162. }
  163. return v;
  164. }
  165. },
  166. {
  167. text : "数量",
  168. dataIndex : "pd_inqty",
  169. xtype: 'numbercolumn',
  170. width : 120.0,
  171. allowBlank : false,
  172. editor : {
  173. xtype : "numberfield",
  174. decimalPrecision: 8,
  175. minValue:0
  176. },
  177. renderer : 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. summaryType: 'sum',
  184. summaryRenderer: function(v) {
  185. var arr = (v + '.').split('.');
  186. var xr = (new Array(arr[1].length)).fill('0');
  187. var format = '0.' + xr.join();
  188. return Ext.util.Format.number(v, format);
  189. }
  190. }, {
  191. text : "已转数",
  192. dataIndex : "pd_yqty",
  193. xtype: 'numbercolumn',
  194. hidden:true,
  195. width : 120.0,
  196. editor : {
  197. xtype : "numberfield",
  198. decimalPrecision: 8,
  199. editable : false
  200. },
  201. renderer : function(v) {
  202. var arr = (v + '.').split('.');
  203. var xr = (new Array(arr[1].length)).fill('0');
  204. var format = '0.' + xr.join();
  205. return Ext.util.Format.number(v, format);
  206. },
  207. summaryType: 'sum',
  208. summaryRenderer: function(v) {
  209. var arr = (v + '.').split('.');
  210. var xr = (new Array(arr[1].length)).fill('0');
  211. var format = '0.' + xr.join();
  212. return Ext.util.Format.number(v, format);
  213. }
  214. },{
  215. text : "仓库id",
  216. dataIndex : "pd_whid",
  217. xtype : "numbercolumn",
  218. hidden:true
  219. },
  220. {
  221. text : "仓库编号",
  222. dataIndex : "pd_whcode",
  223. hidden:true
  224. },
  225. {
  226. text : "仓库",
  227. dataIndex : "pd_whname",
  228. width : 120.0,
  229. allowBlank : false,
  230. editor : {
  231. displayField : "display",
  232. editable : true,
  233. format : "",
  234. hideTrigger : false,
  235. maxLength : 100.0,
  236. minValue : null,
  237. positiveNum : false,
  238. queryMode : "local",
  239. store : null,
  240. valueField : "value",
  241. xtype : "dbfindtrigger"
  242. }
  243. },
  244. {
  245. text : "单价",
  246. xtype: 'numbercolumn',
  247. editor : {
  248. xtype : "numberfield",
  249. decimalPrecision: 8,
  250. minValue:0
  251. },
  252. dataIndex : "pd_orderprice",
  253. width : 120.0,
  254. renderer : function(v) {
  255. var arr = (v + '.').split('.');
  256. var xr = (new Array(arr[1].length)).fill('0');
  257. var format = '0,000.' + xr.join();
  258. return Ext.util.Format.number(v, format);
  259. },
  260. }, {
  261. xtype: 'numbercolumn',
  262. text : "税率",
  263. dataIndex : "pd_taxrate",
  264. width : 120.0,
  265. editor : {
  266. xtype : "numberfield",
  267. decimalPrecision: 0,
  268. minValue: 0,
  269. maxValue: 100
  270. }
  271. },{
  272. text : "含税金额",
  273. xtype: 'numbercolumn',
  274. dataIndex : "pd_total",
  275. width : 120.0,
  276. editor : {
  277. xtype : "numberfield",
  278. decimalPrecision: 2,
  279. editable : false
  280. },
  281. renderer : function(v) {
  282. var arr = (v + '.').split('.');
  283. var xr = (new Array(arr[1].length)).fill('0');
  284. var format = '0,000.' + xr.join();
  285. return Ext.util.Format.number(v, format);
  286. },
  287. summaryType: 'sum',
  288. summaryRenderer: function(v) {
  289. var arr = (v + '.').split('.');
  290. var xr = (new Array(arr[1].length)).fill('0');
  291. var format = '0,000.' + xr.join();
  292. return Ext.util.Format.number(v, format);
  293. }
  294. },
  295. {
  296. text : "未税金额",
  297. xtype: 'numbercolumn',
  298. dataIndex : "pd_nettotal",
  299. editor : {
  300. xtype : "numberfield",
  301. decimalPrecision: 2,
  302. editable : false
  303. },
  304. renderer : function(v) {
  305. var arr = (v + '.').split('.');
  306. var xr = (new Array(arr[1].length)).fill('0');
  307. var format = '0,000.' + xr.join();
  308. return Ext.util.Format.number(v, format);
  309. },
  310. summaryType: 'sum',
  311. summaryRenderer: function(v) {
  312. var arr = (v + '.').split('.');
  313. var xr = (new Array(arr[1].length)).fill('0');
  314. var format = '0,000.' + xr.join();
  315. return Ext.util.Format.number(v, format);
  316. }
  317. },
  318. {
  319. text : "采购单明细id",
  320. dataIndex : "pd_orderid",
  321. width : 120.0,
  322. hidden:true
  323. },
  324. {
  325. text : "采购单号",
  326. dataIndex : "pd_ordercode",
  327. width : 120.0
  328. },{
  329. text : "采购序号",
  330. dataIndex : "pd_orderdetno",
  331. xtype : "numbercolumn",
  332. width : 120.0,
  333. format: '0',
  334. renderer: function(v) {
  335. return v ? v : null;
  336. }
  337. }
  338. ]
  339. },{
  340. xtype : "textfield",
  341. name : "pi_remark",
  342. fieldLabel : "备注",
  343. columnWidth : 1
  344. },{
  345. xtype : "textfield",
  346. name : "pi_recordman",
  347. fieldLabel : "录入人",
  348. readOnly:true
  349. }, {
  350. xtype : "datefield",
  351. name : "createTime",
  352. fieldLabel : "录入日期",
  353. readOnly:true
  354. }, {
  355. xtype : "textfield",
  356. name : "pi_auditman",
  357. fieldLabel : "审核人",
  358. readOnly:true
  359. }, {
  360. xtype : "datefield",
  361. name : "pi_auditdate",
  362. fieldLabel : "审核日期",
  363. readOnly:true
  364. }]
  365. });