FormPanel.js 11 KB

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