FormPanel.js 11 KB

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