FormPanel.js 12 KB

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