FormPanel.js 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'stock-appropriationinout-formpanel',
  4. controller: 'stock-appropriationinout-formpanel',
  5. viewModel: 'stock-appropriationinout-formpanel',
  6. viewName: 'stock-appropriationinout-formpanel',
  7. caller:'AppropriationInOut',
  8. //字段属性
  9. _title:'调拨单',
  10. _idField: 'id',
  11. _codeField: 'pi_inoutno',
  12. _statusField: 'pi_status',
  13. _statusCodeField: 'pi_statuscode',
  14. _relationColumn: 'pd_piid',
  15. _readUrl:'/api/storage/prodinout/read/',
  16. _saveUrl:'/api/storage/prodinout/save',
  17. _auditUrl:'/api/storage/prodinout/audit',
  18. _unAuditUrl: '/api/storage/prodinout/unAudit/',
  19. _deleteUrl:'/api/storage/prodinout/delete/',
  20. initId:0,
  21. toolBtns: [],
  22. defaultItems: [{
  23. xtype: 'hidden',
  24. name: 'id',
  25. fieldLabel: 'id',
  26. allowBlank: true,
  27. columnWidth: 0
  28. },{
  29. xtype : "textfield",
  30. name : "pi_class",
  31. fieldLabel : "单据类型",
  32. readOnly:true,
  33. allowBlank : true,
  34. columnWidth : 0.25
  35. }, {
  36. xtype : "hidden",
  37. name : "pi_vendid",
  38. fieldLabel : "供应商ID",
  39. allowBlank : true,
  40. columnWidth : 0.0
  41. },{
  42. xtype: 'hidden',
  43. name: 'pi_vendcode',
  44. fieldLabel: '供应商编号'
  45. }, {
  46. xtype: 'vendorDbfindTrigger',
  47. name: 'pi_vendname',
  48. fieldLabel: '供应商名称'
  49. },{
  50. xtype : "hidden",
  51. name : "pi_custid",
  52. fieldLabel : "客户ID",
  53. allowBlank : true,
  54. columnWidth : 0.0
  55. },{
  56. xtype: 'hidden',
  57. name: 'pi_custcode',
  58. fieldLabel: '客户编号'
  59. }, {
  60. xtype: 'customerDbfindTrigger',
  61. name: 'pi_custname',
  62. fieldLabel: '客户名称'
  63. },{
  64. xtype : "datefield",
  65. name : "pi_date",
  66. fieldLabel : "单据日期",
  67. allowBlank : false,
  68. columnWidth : 0.25,
  69. defaultValue: new Date()
  70. }, {
  71. name : "detailGridField",
  72. xtype : "detailGridField",
  73. storeModel:'saas.model.purchase.ProdIODetail',
  74. deleteDetailUrl:'/api/storage/prodinout/deleteDetail/',
  75. detnoColumn: 'pd_pdno',
  76. columns : [
  77. {
  78. text : "id",
  79. dataIndex : "id",
  80. xtype : "numbercolumn",
  81. hidden:true
  82. },{
  83. text : "物料id",
  84. dataIndex : "pd_prodid",
  85. xtype : "numbercolumn",
  86. hidden:true
  87. },
  88. {
  89. text : "物料编号",
  90. width : 200.0,
  91. dataIndex : "pd_prodcode",
  92. xtype : "",
  93. items : null,
  94. allowBlank:false,
  95. editor : {
  96. displayField : "display",
  97. editable : true,
  98. format : "",
  99. hideTrigger : false,
  100. maxLength : 100.0,
  101. minValue : null,
  102. positiveNum : false,
  103. queryMode : "local",
  104. store : null,
  105. valueField : "value",
  106. xtype : "productMultiDbfindTrigger"
  107. }
  108. },{
  109. text: 'model映射需要',
  110. dataIndex: 'productDTO',
  111. hidden: true,
  112. },
  113. {
  114. text : "名称",
  115. dataIndex : "pr_detail",
  116. ignore:true,
  117. renderer: function (v, m, r) {
  118. if(!v){
  119. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  120. }
  121. return v;
  122. }
  123. },
  124. {
  125. text : "规格",
  126. dataIndex : "pr_spec",
  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. xtype: 'numbercolumn',
  138. dataIndex : "pd_outqty",
  139. width : 120.0,
  140. allowBlank:false,
  141. editor : {
  142. xtype : "numberfield",
  143. decimalPrecision: 3,
  144. minValue:0
  145. },
  146. renderer : function(v) {
  147. var arr = (v + '.').split('.');
  148. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  149. var format = '0.' + xr.join();
  150. return Ext.util.Format.number(v, format);
  151. },
  152. summaryType: 'sum',
  153. summaryRenderer: function(v) {
  154. var arr = (v + '.').split('.');
  155. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  156. var format = '0.' + xr.join();
  157. return Ext.util.Format.number(v, format);
  158. }
  159. },{
  160. text : "拨出仓库id",
  161. dataIndex : "pd_whid",
  162. xtype : "numbercolumn",
  163. hidden:true
  164. },
  165. {
  166. text : "拨出仓库编号",
  167. dataIndex : "pd_whcode",
  168. hidden:true
  169. },
  170. {
  171. text : "拨出仓库",
  172. dataIndex : "pd_whname",
  173. width : 120.0,
  174. items : null,
  175. allowBlank:false,
  176. editor : {
  177. displayField : "display",
  178. editable : true,
  179. format : "",
  180. hideTrigger : false,
  181. maxLength : 100.0,
  182. minValue : null,
  183. positiveNum : false,
  184. queryMode : "local",
  185. store : null,
  186. valueField : "value",
  187. xtype : "warehouseDbfindTrigger"
  188. }
  189. },{
  190. text : "拨入仓库id",
  191. dataIndex : "pd_inwhid",
  192. xtype : "numbercolumn",
  193. hidden:true
  194. },
  195. {
  196. text : "拨入仓库编号",
  197. dataIndex : "pd_inwhcode",
  198. hidden:true
  199. },
  200. {
  201. text : "拨入仓库",
  202. dataIndex : "pd_inwhname",
  203. width : 120.0,
  204. allowBlank:false,
  205. items : null,
  206. editor : {
  207. displayField : "display",
  208. editable : true,
  209. format : "",
  210. hideTrigger : false,
  211. maxLength : 100.0,
  212. minValue : null,
  213. positiveNum : false,
  214. queryMode : "local",
  215. store : null,
  216. valueField : "value",
  217. xtype : "warehouseDbfindTrigger"
  218. }
  219. },{
  220. text : "备注",
  221. dataIndex : "pd_remark",
  222. width : 250,
  223. items : null,
  224. editor : {
  225. xtype : "textfield"
  226. },
  227. }
  228. ]
  229. }, {
  230. xtype : "textfield",
  231. name : "pi_remark",
  232. fieldLabel : "备注",
  233. columnWidth : 1
  234. },{
  235. xtype : "hidden",
  236. name : "creatorId",
  237. fieldLabel : "录入人ID",
  238. readOnly:true
  239. },
  240. {
  241. xtype : "textfield",
  242. name : "creatorName",
  243. fieldLabel : "录入人",
  244. readOnly:true
  245. }, {
  246. xtype : "datefield",
  247. name : "createTime",
  248. fieldLabel : "录入日期",
  249. readOnly:true,
  250. defaultValue: new Date()
  251. },{
  252. xtype : "hidden",
  253. name : "updaterId",
  254. fieldLabel : "更新人ID",
  255. readOnly:true
  256. },{
  257. xtype : "hidden",
  258. name : "updaterName",
  259. fieldLabel : "更新人",
  260. readOnly:true
  261. }, {
  262. xtype : "hidden",
  263. name : "updateTime",
  264. fieldLabel : "更新日期",
  265. readOnly:true,
  266. defaultValue: new Date()
  267. }, {
  268. xtype : "textfield",
  269. name : "pi_auditman",
  270. fieldLabel : "审核人",
  271. readOnly:true
  272. }, {
  273. xtype : "datefield",
  274. name : "pi_auditdate",
  275. fieldLabel : "审核日期",
  276. readOnly:true
  277. }]
  278. });