FormPanel.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. Ext.define('saas.view.stock.otherIn.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'stock-otherin-formpanel',
  4. controller: 'stock-otherin-formpanel',
  5. viewModel: 'stock-otherin-formpanel',
  6. viewName: 'stock-otherin-formpanel',
  7. caller:'OtherIn',
  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: 'hidden',
  49. name: 'pi_custname',
  50. fieldLabel: '客户名称'
  51. },{
  52. xtype : "hidden",
  53. name : "pi_vendid",
  54. fieldLabel : "供应商ID",
  55. allowBlank : true,
  56. columnWidth : 0.0
  57. },{
  58. xtype: 'hidden',
  59. name: 'pi_vendcode',
  60. fieldLabel: '供应商编号'
  61. }, {
  62. xtype: 'vendorDbfindTrigger',
  63. name: 'pi_vendname',
  64. fieldLabel: '供应商名称',
  65. allowBlank : true,
  66. },{
  67. xtype : "datefield",
  68. name : "pi_date",
  69. fieldLabel : "单据日期",
  70. allowBlank : false,
  71. columnWidth : 0.25,
  72. defaultValue: new Date()
  73. },{
  74. xtype : "textfield",
  75. name : "pi_total",
  76. fieldLabel : "总额",
  77. allowBlank : true,
  78. readOnly: true,
  79. columnWidth : 0.25
  80. }, {
  81. name : "detailGridField",
  82. xtype : "detailGridField",
  83. storeModel:'saas.model.purchase.ProdIODetail',
  84. deleteDetailUrl:'/api/storage/prodinout/deleteDetail',
  85. detnoColumn: 'pd_pdno',
  86. columns : [
  87. {
  88. text : "id",
  89. dataIndex : "id",
  90. xtype : "numbercolumn",
  91. hidden:true
  92. },{
  93. text : "物料id",
  94. dataIndex : "pd_prodid",
  95. xtype : "numbercolumn",
  96. hidden:true
  97. },
  98. {
  99. text : "物料编号",
  100. width : 150.0,
  101. dataIndex : "pd_prodcode",
  102. xtype : "",
  103. items : null,
  104. allowBlank : false,
  105. editor : {
  106. displayField : "display",
  107. editable : true,
  108. format : "",
  109. hideTrigger : false,
  110. maxLength : 100.0,
  111. minValue : null,
  112. positiveNum : false,
  113. queryMode : "local",
  114. store : null,
  115. valueField : "value",
  116. xtype : "productMultiDbfindTrigger"
  117. }
  118. },{
  119. text: 'model映射需要',
  120. dataIndex: 'productDTO',
  121. hidden: true,
  122. },
  123. {
  124. text : "品牌",
  125. width : 150.0,
  126. dataIndex : "pr_brand",
  127. ignore:true,
  128. renderer: function (v, m, r) {
  129. if(!v){
  130. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  131. }
  132. return v;
  133. }
  134. },
  135. {
  136. text : "名称",
  137. width : 200.0,
  138. dataIndex : "pr_detail",
  139. ignore:true,
  140. renderer: function (v, m, r) {
  141. if(!v){
  142. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  143. }
  144. return v;
  145. }
  146. },
  147. {
  148. text : "型号",
  149. width : 200.0,
  150. dataIndex : "pr_orispeccode",
  151. ignore:true,
  152. renderer: function (v, m, r) {
  153. if(!v){
  154. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  155. }
  156. return v;
  157. }
  158. },{
  159. text : "规格",
  160. width : 150,
  161. dataIndex : "pr_spec",
  162. ignore:true,
  163. renderer: function (v, m, r) {
  164. if(!v){
  165. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  166. }
  167. return v;
  168. }
  169. },{
  170. text : "数量",
  171. xtype: 'numbercolumn',
  172. dataIndex : "pd_inqty",
  173. width : 110.0,
  174. allowBlank : false,
  175. editor : {
  176. xtype : "numberfield",
  177. decimalPrecision: 3,
  178. minValue:0
  179. },
  180. renderer : function(v) {
  181. var arr = (v + '.').split('.');
  182. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  183. var format = '0.' + xr.join('');
  184. return Ext.util.Format.number(v, format);
  185. },
  186. summaryType: 'sum',
  187. summaryRenderer: function(v) {
  188. var arr = (v + '.').split('.');
  189. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  190. var format = '0.' + xr.join('');
  191. return Ext.util.Format.number(v, format);
  192. }
  193. },{
  194. text : "单位",
  195. width : 80.0,
  196. dataIndex : "pr_unit",
  197. ignore:true,
  198. renderer: function (v, m, r) {
  199. if(!v){
  200. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  201. }
  202. return v;
  203. }
  204. },{
  205. text : "单价(元)",
  206. xtype: 'numbercolumn',
  207. dataIndex : "pd_orderprice",
  208. width : 110.0,
  209. editor : {
  210. xtype : "numberfield",
  211. decimalPrecision: 8,
  212. minValue:0
  213. },
  214. renderer : function(v) {
  215. var arr = (v + '.').split('.');
  216. var xr = (new Array(arr[1].length)).fill('0');
  217. var format = '0,000.' + xr.join('');
  218. return Ext.util.Format.number(v, format);
  219. },
  220. },{
  221. text : "仓库id",
  222. dataIndex : "pd_whid",
  223. xtype : "numbercolumn",
  224. hidden:true
  225. },
  226. {
  227. text : "仓库编号",
  228. dataIndex : "pd_whcode",
  229. hidden:true
  230. },
  231. {
  232. text : "仓库",
  233. dataIndex : "pd_whname",
  234. width : 150.0,
  235. allowBlank : false,
  236. editor : {
  237. displayField : "display",
  238. editable : true,
  239. format : "",
  240. hideTrigger : false,
  241. maxLength : 100.0,
  242. minValue : null,
  243. positiveNum : false,
  244. queryMode : "local",
  245. store : null,
  246. valueField : "value",
  247. xtype : "warehouseDbfindTrigger"
  248. }
  249. }, {
  250. text : "税率",
  251. xtype: 'numbercolumn',
  252. dataIndex : "pd_taxrate",
  253. width : 80.0,
  254. editor : {
  255. xtype : "numberfield",
  256. decimalPrecision: 0,
  257. minValue: 0,
  258. maxValue: 100
  259. },
  260. renderer : function(v) {
  261. return Ext.util.Format.number(v, '0');
  262. }
  263. },
  264. {
  265. text : "含税金额",
  266. xtype: 'numbercolumn',
  267. dataIndex : "pd_ordertotal",
  268. width : 150.0,
  269. // editor : {
  270. // xtype : "numberfield",
  271. // decimalPrecision: 2,
  272. // editable:false
  273. // },
  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. {
  289. text : "未税金额",
  290. xtype: 'numbercolumn',
  291. dataIndex : "pd_nettotal",
  292. width : 150.0,
  293. // editor : {
  294. // xtype : "numberfield",
  295. // decimalPrecision: 2,
  296. // editable:false
  297. // },
  298. renderer : function(v) {
  299. var arr = (v + '.').split('.');
  300. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  301. var format = '0,000.' + xr.join('');
  302. return Ext.util.Format.number(v, format);
  303. },
  304. summaryType: 'sum',
  305. summaryRenderer: function(v) {
  306. var arr = (v + '.').split('.');
  307. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  308. var format = '0,000.' + xr.join('');
  309. return Ext.util.Format.number(v, format);
  310. }
  311. },{
  312. text : "备注",
  313. dataIndex : "pd_remark",
  314. width : 250,
  315. items : null,
  316. editor : {
  317. xtype : "textfield"
  318. },
  319. }
  320. ]
  321. },{
  322. xtype : "textfield",
  323. name : "pi_remark",
  324. fieldLabel : "备注",
  325. columnWidth : 1
  326. },{
  327. xtype : "hidden",
  328. name : "creatorId",
  329. fieldLabel : "录入人ID",
  330. readOnly:true
  331. },
  332. {
  333. xtype : "textfield",
  334. name : "creatorName",
  335. fieldLabel : "录入人",
  336. readOnly:true
  337. }, {
  338. xtype : "datefield",
  339. name : "createTime",
  340. fieldLabel : "录入日期",
  341. readOnly:true,
  342. defaultValue: new Date()
  343. },{
  344. xtype : "hidden",
  345. name : "updaterId",
  346. fieldLabel : "更新人ID",
  347. readOnly:true
  348. },{
  349. xtype : "hidden",
  350. name : "updaterName",
  351. fieldLabel : "更新人",
  352. readOnly:true
  353. }, {
  354. xtype : "hidden",
  355. name : "updateTime",
  356. fieldLabel : "更新日期",
  357. readOnly:true,
  358. defaultValue: new Date()
  359. }, {
  360. xtype : "textfield",
  361. name : "pi_auditman",
  362. fieldLabel : "审核人",
  363. readOnly:true
  364. }, {
  365. xtype : "datefield",
  366. name : "pi_auditdate",
  367. fieldLabel : "审核日期",
  368. readOnly:true
  369. }]
  370. });