FormPanel.js 11 KB

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