FormPanel.js 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. Ext.define('saas.view.sale.sale.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'sale-sale-formpanel',
  4. controller: 'sale-sale-formpanel',
  5. viewModel: 'sale-sale-formpanel',
  6. viewName: 'sale-sale-formpanel',
  7. caller:'Sale',
  8. //字段属性
  9. _title:'销售订单',
  10. _idField: 'id',
  11. _codeField: 'sa_code',
  12. _statusField: 'sa_status',
  13. _statusCodeField: 'sa_statuscode',
  14. _relationColumn: 'sd_puid',
  15. _readUrl:'/api/sale/sale/read/',
  16. _saveUrl:'/api/sale/sale/save/',
  17. _auditUrl:'/api/sale/sale/audit/',
  18. _unAuditUrl: '/api/sale/sale/unAudit/',
  19. _deleteUrl:'/api/sale/sale/delete/',
  20. _turnOutUrl:'/api/sale/sale/turnProdOut/',
  21. initId:0,
  22. toolBtns: [{
  23. xtype: 'button',
  24. text: '转出货单',
  25. handler: 'turnOut',
  26. bind: {
  27. hidden: '{sa_statuscode!="AUDITED"}'
  28. }
  29. }],
  30. defaultItems: [{
  31. xtype: 'hidden',
  32. name: 'id',
  33. fieldLabel: 'id'
  34. }, {
  35. xtype : 'hidden',
  36. name : 'sa_custid',
  37. fieldLabel : '客户ID'
  38. }
  39. , {
  40. xtype : 'hidden',
  41. name : 'sa_custcode',
  42. fieldLabel : '客户编号'
  43. }, {
  44. xtype : "dbfindtrigger",
  45. name : "sa_custname",
  46. fieldLabel : "客户名称",
  47. allowBlank : false
  48. }, {
  49. xtype : "datefield",
  50. name : "sa_date",
  51. fieldLabel : "单据日期",
  52. allowBlank : false,
  53. defaultValue: new Date()
  54. }, {
  55. xtype : "textfield",
  56. name : "sa_toplace",
  57. fieldLabel : "交货地址",
  58. columnWidth : 0.5
  59. }, {
  60. name : "detailGridField",
  61. xtype : "detailGridField",
  62. detnoColumn: 'sd_detno',
  63. storeModel:'saas.model.sale.Saledetail',
  64. deleteDetailUrl:'/api/sale/sale/deleteDetail/',
  65. columns : [
  66. {
  67. text : "id",
  68. dataIndex : "id",
  69. xtype : "numbercolumn",
  70. width:0
  71. }, {
  72. text : "物料id",
  73. dataIndex : "sd_prodid",
  74. width : 0
  75. }, {
  76. text : "物料编号",
  77. width : 200.0,
  78. dataIndex : "sd_prodcode",
  79. xtype : "",
  80. items : null,
  81. allowBlank:false,
  82. editor : {
  83. displayField : "display",
  84. editable : true,
  85. format : "",
  86. hideTrigger : false,
  87. maxLength : 100.0,
  88. minValue : null,
  89. positiveNum : false,
  90. queryMode : "local",
  91. store : null,
  92. valueField : "value",
  93. xtype : "multidbfindtrigger"
  94. }
  95. },{
  96. text: 'model映射需要',
  97. dataIndex: 'productDTO',
  98. hidden: true,
  99. }, {
  100. text : "名称",
  101. dataIndex : "pr_detail",
  102. ignore:true,
  103. width : 150.0,
  104. renderer: function (v, m, r) {
  105. if(!v){
  106. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  107. }
  108. return v;
  109. }
  110. }, {
  111. text : "规格",
  112. dataIndex : "pr_spec",
  113. ignore:true,
  114. width : 150.0,
  115. renderer: function (v, m, r) {
  116. if(!v){
  117. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  118. }
  119. return v;
  120. }
  121. }, {
  122. text : "数量",
  123. dataIndex : "sd_qty",
  124. xtype: 'numbercolumn',
  125. allowBlank:false,
  126. editor : {
  127. xtype : "numberfield",
  128. decimalPrecision: 3,
  129. minValue:0
  130. },
  131. renderer : function(v) {
  132. var arr = (v + '.').split('.');
  133. var xr = (new Array(arr[1].length)).fill('0');
  134. var format = '0.' + xr.join();
  135. return Ext.util.Format.number(v, format);
  136. },
  137. summaryType: 'sum',
  138. summaryRenderer: function(v) {
  139. var arr = (v + '.').split('.');
  140. var xr = (new Array(arr[1].length)).fill('0');
  141. var format = '0.' + xr.join();
  142. return Ext.util.Format.number(v, format);
  143. }
  144. }, {
  145. text : "已转数",
  146. xtype: 'numbercolumn',
  147. dataIndex : "sd_yqty",
  148. width : 120.0,
  149. hidden : true,
  150. editor : {
  151. xtype : "numberfield",
  152. decimalPrecision: 3
  153. },
  154. renderer : function(v) {
  155. var arr = (v + '.').split('.');
  156. var xr = (new Array(arr[1].length)).fill('0');
  157. var format = '0.' + xr.join();
  158. return Ext.util.Format.number(v, format);
  159. },
  160. summaryType: 'sum',
  161. summaryRenderer: function(v) {
  162. var arr = (v + '.').split('.');
  163. var xr = (new Array(arr[1].length)).fill('0');
  164. var format = '0.' + xr.join();
  165. return Ext.util.Format.number(v, format);
  166. }
  167. },
  168. {
  169. text : "单价",
  170. xtype: 'numbercolumn',
  171. dataIndex : "sd_price",
  172. width : 120.0,
  173. editor : {
  174. xtype : "numberfield",
  175. decimalPrecision: 3,
  176. minValue:0
  177. },
  178. renderer : function(v) {
  179. var arr = (v + '.').split('.');
  180. var xr = (new Array(arr[1].length)).fill('0');
  181. var format = '0,000.' + xr.join();
  182. return Ext.util.Format.number(v, format);
  183. },
  184. },
  185. {
  186. text : "税率",
  187. xtype: 'numbercolumn',
  188. dataIndex : "sd_taxrate",
  189. width : 120.0,
  190. editor : {
  191. xtype : "numberfield",
  192. decimalPrecision: 0,
  193. minValue: 0,
  194. maxValue: 100
  195. },
  196. },
  197. {
  198. text : "含税金额",
  199. xtype: 'numbercolumn',
  200. dataIndex : "sd_total",
  201. width : 120.0,
  202. renderer : function(v) {
  203. var arr = (v + '.').split('.');
  204. var xr = (new Array(arr[1].length)).fill('0');
  205. var format = '0,000.' + xr.join();
  206. return Ext.util.Format.number(v, format);
  207. },
  208. summaryType: 'sum',
  209. summaryRenderer: function(v) {
  210. var arr = (v + '.').split('.');
  211. var xr = (new Array(arr[1].length)).fill('0');
  212. var format = '0,000.' + xr.join();
  213. return Ext.util.Format.number(v, format);
  214. }
  215. },
  216. {
  217. text : "未税金额",
  218. xtype: 'numbercolumn',
  219. dataIndex : "sd_nettotal",
  220. renderer : function(v) {
  221. var arr = (v + '.').split('.');
  222. var xr = (new Array(arr[1].length)).fill('0');
  223. var format = '0,000.' + xr.join();
  224. return Ext.util.Format.number(v, format);
  225. },
  226. summaryType: 'sum',
  227. summaryRenderer: function(v) {
  228. var arr = (v + '.').split('.');
  229. var xr = (new Array(arr[1].length)).fill('0');
  230. var format = '0,000.' + xr.join();
  231. return Ext.util.Format.number(v, format);
  232. }
  233. },{
  234. text : "交货日期",
  235. dataIndex : "sd_delivery",
  236. xtype:'datecolumn',
  237. editor : {
  238. xtype : "datefield",
  239. editable : true,
  240. hideTrigger : false
  241. }
  242. },{
  243. text : "关联采购订单",
  244. dataIndex : "sd_pucode",
  245. width : 120.0,
  246. items : null,
  247. ignore:true
  248. },{
  249. text : "备注",
  250. dataIndex : "sd_remark",
  251. width : 250,
  252. items : null,
  253. editor : {
  254. xtype : "textfield"
  255. },
  256. }
  257. ]
  258. }, {
  259. xtype : "textfield",
  260. name : "sa_total",
  261. fieldLabel : "单据金额",
  262. readOnly:true
  263. }, {
  264. xtype : "textfield",
  265. name : "sa_remark",
  266. fieldLabel : "备注",
  267. columnWidth : 0.75
  268. }, {
  269. xtype : 'textfield',
  270. name : 'sa_sendstatus',
  271. fieldLabel : '出货状态',
  272. hidden : true,
  273. readOnly:true
  274. }, {
  275. xtype : "textfield",
  276. name : "sa_recorder",
  277. fieldLabel : "录入人",
  278. readOnly:true
  279. }, {
  280. xtype : "datefield",
  281. name : "sa_recorddate",
  282. fieldLabel : "录入日期",
  283. readOnly:true,
  284. defaultValue: new Date()
  285. }, {
  286. xtype : "textfield",
  287. name : "sa_auditman",
  288. fieldLabel : "审核人",
  289. readOnly:true
  290. }, {
  291. xtype : "datefield",
  292. name : "sa_auditdate",
  293. fieldLabel : "审核日期",
  294. readOnly:true
  295. }
  296. ]
  297. });