FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  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. {
  145. text: "数量",
  146. xtype: 'numbercolumn',
  147. dataIndex: "pd_outqty",
  148. allowBlank : false,
  149. width: 110.0,
  150. editor : {
  151. xtype : "numberfield",
  152. decimalPrecision: 8,
  153. minValue:0
  154. },
  155. renderer : function(v) {
  156. var arr = (v + '.').split('.');
  157. var xr = (new Array(arr[1].length)).fill('0');
  158. var format = '0.' + xr.join('');
  159. return Ext.util.Format.number(v, format);
  160. },
  161. summaryType: 'sum',
  162. summaryRenderer: function(v) {
  163. var arr = (v + '.').split('.');
  164. var xr = (new Array(arr[1].length)).fill('0');
  165. var format = '0.' + xr.join('');
  166. return Ext.util.Format.number(v, format);
  167. }
  168. },{
  169. text : "单位",
  170. width : 80.0,
  171. dataIndex : "pr_unit",
  172. ignore:true,
  173. renderer: function (v, m, r) {
  174. if(!v){
  175. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  176. }
  177. return v;
  178. }
  179. },{
  180. text: "单价(元)",
  181. xtype: 'numbercolumn',
  182. dataIndex: "pd_orderprice",
  183. width : 110.0,
  184. editor : {
  185. xtype : "numberfield",
  186. decimalPrecision: 8,
  187. minValue:0
  188. },
  189. renderer : function(v) {
  190. var arr = (v + '.').split('.');
  191. var xr = (new Array(arr[1].length)).fill('0');
  192. var format = '0,000.' + xr.join('');
  193. return Ext.util.Format.number(v, format);
  194. }
  195. },{
  196. text: "仓库id",
  197. dataIndex: "pd_whid",
  198. xtype: "numbercolumn",
  199. hidden: true
  200. },
  201. {
  202. text: "仓库编号",
  203. dataIndex: "pd_whcode",
  204. hidden: true
  205. },
  206. {
  207. text: "仓库",
  208. dataIndex: "pd_whname",
  209. width: 150.0,
  210. allowBlank : false,
  211. editor: {
  212. displayField: "display",
  213. editable: true,
  214. format: "",
  215. hideTrigger: false,
  216. maxLength: 100.0,
  217. minValue: null,
  218. positiveNum: false,
  219. queryMode: "local",
  220. store: null,
  221. valueField: "value",
  222. xtype: "warehouseDbfindTrigger"
  223. }
  224. },
  225. {
  226. text: "税率",
  227. xtype: 'numbercolumn',
  228. dataIndex: "pd_taxrate",
  229. width : 80.0,
  230. editor : {
  231. xtype : "numberfield",
  232. decimalPrecision: 0,
  233. minValue: 0,
  234. maxValue: 100
  235. },
  236. renderer : function(v) {
  237. return Ext.util.Format.number(v, '0');
  238. }
  239. },
  240. {
  241. text: "含税金额(元)",
  242. xtype: 'numbercolumn',
  243. dataIndex: "pd_ordertotal",
  244. width: 150.0,
  245. renderer : function(v) {
  246. var arr = (v + '.').split('.');
  247. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  248. var format = '0,000.' + xr.join('');
  249. return Ext.util.Format.number(v, format);
  250. },
  251. summaryType: 'sum',
  252. summaryRenderer: function(v) {
  253. var arr = (v + '.').split('.');
  254. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  255. var format = '0,000.' + xr.join('');
  256. return Ext.util.Format.number(v, format);
  257. }
  258. },
  259. {
  260. text: "未税金额(元)",
  261. xtype: 'numbercolumn',
  262. dataIndex: "pd_nettotal",
  263. width : 150.0,
  264. renderer : function(v) {
  265. var arr = (v + '.').split('.');
  266. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  267. var format = '0,000.' + xr.join('');
  268. return Ext.util.Format.number(v, format);
  269. },
  270. summaryType: 'sum',
  271. summaryRenderer: function(v) {
  272. var arr = (v + '.').split('.');
  273. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  274. var format = '0,000.' + xr.join('');
  275. return Ext.util.Format.number(v, format);
  276. }
  277. },{
  278. text : "备注",
  279. dataIndex : "pd_remark",
  280. width : 250,
  281. items : null,
  282. editor : {
  283. xtype : "textfield"
  284. },
  285. }
  286. ]
  287. },{
  288. xtype : "textfield",
  289. name : "pi_remark",
  290. fieldLabel : "备注",
  291. columnWidth : 1
  292. },{
  293. xtype : "hidden",
  294. name : "creatorId",
  295. fieldLabel : "录入人ID",
  296. readOnly:true
  297. },
  298. {
  299. xtype : "textfield",
  300. name : "creatorName",
  301. fieldLabel : "录入人",
  302. readOnly:true
  303. }, {
  304. xtype : "datefield",
  305. name : "createTime",
  306. fieldLabel : "录入日期",
  307. readOnly:true,
  308. defaultValue: new Date()
  309. },{
  310. xtype : "hidden",
  311. name : "updaterId",
  312. fieldLabel : "更新人ID",
  313. readOnly:true
  314. },{
  315. xtype : "hidden",
  316. name : "updaterName",
  317. fieldLabel : "更新人",
  318. readOnly:true
  319. }, {
  320. xtype : "hidden",
  321. name : "updateTime",
  322. fieldLabel : "更新日期",
  323. readOnly:true,
  324. defaultValue: new Date()
  325. }, {
  326. xtype : "textfield",
  327. name : "pi_auditman",
  328. fieldLabel : "审核人",
  329. readOnly:true
  330. }, {
  331. xtype : "datefield",
  332. name : "pi_auditdate",
  333. fieldLabel : "审核日期",
  334. readOnly:true
  335. }]
  336. });