FormPanel.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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. bind: {
  27. hidden: '{pi_statuscode!="AUDITED"}'
  28. }
  29. }],
  30. defaultItems: [{
  31. xtype: 'hidden',
  32. name: 'id',
  33. fieldLabel: 'id'
  34. }, {
  35. xtype : "textfield",
  36. name : "pi_class",
  37. fieldLabel : "单据类型",
  38. readOnly:true,
  39. allowBlank : false,
  40. defaultValue:'出货单'
  41. }, {
  42. xtype : "hidden",
  43. name : "pi_custid",
  44. fieldLabel : "客户ID"
  45. }, {
  46. xtype : "hidden",
  47. name : "pi_custcode",
  48. fieldLabel : "客户编号"
  49. }, {
  50. xtype : "dbfindtrigger",
  51. name : "pi_custname",
  52. fieldLabel : "客户名称",
  53. allowBlank:false,
  54. }, {
  55. xtype : "datefield",
  56. name : "pi_date",
  57. fieldLabel : "单据日期",
  58. allowBlank : false,
  59. columnWidth : 0.25,
  60. defaultValue: new Date()
  61. }, {
  62. xtype : "textfield",
  63. name : "pi_address",
  64. fieldLabel : "交货地址",
  65. columnWidth : 0.5
  66. }, {
  67. name : "detailGridField",
  68. xtype : "detailGridField",
  69. detnoColumn: 'pd_pdno',
  70. storeModel:'saas.model.sale.ProdIODetail',
  71. deleteDetailUrl:'/api/sale/prodinout/deleteDetail/',
  72. columns : [
  73. {
  74. text : "id",
  75. dataIndex : "id",
  76. xtype : "numbercolumn",
  77. width:0
  78. }, {
  79. text : "物料id",
  80. dataIndex : "pd_prodid",
  81. width : 0
  82. }, {
  83. text : "物料编号",
  84. width : 200.0,
  85. dataIndex : "pd_prodcode",
  86. xtype : "",
  87. items : null,
  88. allowBlank:false,
  89. editor : {
  90. displayField : "display",
  91. editable : true,
  92. format : "",
  93. hideTrigger : false,
  94. maxLength : 100.0,
  95. minValue : null,
  96. positiveNum : false,
  97. queryMode : "local",
  98. store : null,
  99. valueField : "value",
  100. xtype : "multidbfindtrigger"
  101. }
  102. },{
  103. text: 'model映射需要',
  104. dataIndex: 'productDTO',
  105. hidden: true,
  106. }, {
  107. text : "名称",
  108. dataIndex : "pr_detail",
  109. ignore:true,
  110. width : 150.0,
  111. renderer: function (v, m, r) {
  112. if(!v){
  113. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  114. }
  115. return v;
  116. }
  117. }, {
  118. text : "规格",
  119. dataIndex : "pr_spec",
  120. ignore:true,
  121. width : 150.0,
  122. renderer: function (v, m, r) {
  123. if(!v){
  124. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  125. }
  126. return v;
  127. }
  128. }, {
  129. text : "出货数量",
  130. xtype: 'numbercolumn',
  131. dataIndex : "pd_outqty",
  132. width : 120.0,
  133. allowBlank:false,
  134. editor : {
  135. xtype : "numberfield",
  136. decimalPrecision: 8,
  137. minValue:0
  138. },
  139. renderer : function(v) {
  140. var arr = (v + '.').split('.');
  141. var xr = (new Array(arr[1].length)).fill('0');
  142. var format = '0.' + xr.join();
  143. return Ext.util.Format.number(v, format);
  144. },
  145. summaryType: 'sum',
  146. summaryRenderer: function(v) {
  147. var arr = (v + '.').split('.');
  148. var xr = (new Array(arr[1].length)).fill('0');
  149. var format = '0.' + xr.join();
  150. return Ext.util.Format.number(v, format);
  151. }
  152. }, {
  153. text : "仓库ID",
  154. dataIndex : "pd_whid",
  155. width : 0
  156. }, {
  157. text : "仓库",
  158. dataIndex : "pd_whcode",
  159. hidden :true
  160. }, {
  161. text : "仓库",
  162. dataIndex : "pd_whname",
  163. width : 120.0,
  164. items : null,
  165. allowBlank:false,
  166. editor : {
  167. displayField : "display",
  168. editable : true,
  169. format : "",
  170. hideTrigger : false,
  171. maxLength : 100.0,
  172. minValue : null,
  173. positiveNum : false,
  174. queryMode : "local",
  175. store : null,
  176. valueField : "value",
  177. xtype : "dbfindtrigger"
  178. }
  179. },
  180. {
  181. text : "单价",
  182. xtype: 'numbercolumn',
  183. dataIndex : "pd_sendprice",
  184. width : 120.0,
  185. editor : {
  186. xtype : "numberfield",
  187. decimalPrecision: 8,
  188. minValue:0
  189. },
  190. renderer : function(v) {
  191. var arr = (v + '.').split('.');
  192. var xr = (new Array(arr[1].length)).fill('0');
  193. var format = '0,000.' + xr.join();
  194. return Ext.util.Format.number(v, format);
  195. },
  196. },
  197. {
  198. text : "含税金额",
  199. xtype: 'numbercolumn',
  200. dataIndex : "pd_ordertotal",
  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. text : "税率",
  217. xtype: 'numbercolumn',
  218. dataIndex : "pd_taxrate",
  219. width : 120.0,
  220. editor : {
  221. xtype : "numberfield",
  222. decimalPrecision: 0,
  223. minValue: 0,
  224. maxValue: 100
  225. }
  226. },
  227. {
  228. text : "未税金额",
  229. xtype: 'numbercolumn',
  230. dataIndex : "pd_nettotal",
  231. renderer : function(v) {
  232. var arr = (v + '.').split('.');
  233. var xr = (new Array(arr[1].length)).fill('0');
  234. var format = '0,000.' + xr.join();
  235. return Ext.util.Format.number(v, format);
  236. },
  237. summaryType: 'sum',
  238. summaryRenderer: function(v) {
  239. var arr = (v + '.').split('.');
  240. var xr = (new Array(arr[1].length)).fill('0');
  241. var format = '0,000.' + xr.join();
  242. return Ext.util.Format.number(v, format);
  243. }
  244. },
  245. {
  246. text : "销售单号",
  247. dataIndex : "pd_ordercode",
  248. width : 200.0
  249. },{
  250. text : "销售序号",
  251. dataIndex : "pd_orderdetno",
  252. xtype : "numbercolumn",
  253. width : 120.0,
  254. format: '0',
  255. renderer: function(v) {
  256. return v ? v : null;
  257. }
  258. }
  259. ]
  260. }, {
  261. xtype : "textfield",
  262. name : "pi_total",
  263. fieldLabel : "单据金额",
  264. readOnly: true
  265. }, {
  266. xtype : "textfield",
  267. name : "pi_remark",
  268. fieldLabel : "备注",
  269. columnWidth : 0.75
  270. }, {
  271. xtype : "textfield",
  272. name : "pi_recordman",
  273. fieldLabel : "录入人",
  274. readOnly:true
  275. }, {
  276. xtype : "datefield",
  277. name : "pi_recorddate",
  278. fieldLabel : "录入日期",
  279. readOnly:true,
  280. defaultValue: new Date()
  281. }, {
  282. xtype : "textfield",
  283. name : "pi_auditman",
  284. fieldLabel : "审核人",
  285. readOnly:true
  286. }, {
  287. xtype : "datefield",
  288. name : "pi_auditdate",
  289. fieldLabel : "审核日期",
  290. readOnly:true
  291. }]
  292. });