FormPanel.js 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. // _relationColumn: 'pd_piid',
  21. // _readUrl:'http://localhost:9000/prodinout/read/',
  22. // _saveUrl:'http://localhost:9000/prodinout/save',
  23. // _auditUrl:'http://localhost:9000/prodinout/audit',
  24. // _deleteUrl:'http://localhost:9000/prodinout/delete/',
  25. initId:0,
  26. toolBtns: [],
  27. defaultItems: [{
  28. xtype: 'hidden',
  29. name: 'id',
  30. bind: '{id}',
  31. fieldLabel: 'id',
  32. allowBlank: true,
  33. columnWidth: 0
  34. },{
  35. xtype : "textfield",
  36. name : "pi_class",
  37. bind : "{pi_class}",
  38. fieldLabel : "单据类型",
  39. readOnly:true,
  40. allowBlank : true,
  41. columnWidth : 0.25
  42. }, {
  43. xtype : "hidden",
  44. name : "pi_vendid",
  45. bind : "{pi_vendid}",
  46. fieldLabel : "供应商ID",
  47. allowBlank : true,
  48. columnWidth : 0.0
  49. },{
  50. xtype: 'hidden',
  51. name: 'pi_vendcode',
  52. bind: '{pi_vendcode}',
  53. fieldLabel: '供应商编号'
  54. }, {
  55. xtype: 'dbfindtrigger',
  56. name: 'pi_vendname',
  57. bind: '{pi_vendname}',
  58. fieldLabel: '供应商名称'
  59. },{
  60. xtype : "hidden",
  61. name : "pi_custid",
  62. bind : "{pi_custid}",
  63. fieldLabel : "客户ID",
  64. allowBlank : true,
  65. columnWidth : 0.0
  66. },{
  67. xtype: 'hidden',
  68. name: 'pi_custcode',
  69. bind: '{pi_custcode}',
  70. fieldLabel: '客户编号'
  71. }, {
  72. xtype: 'dbfindtrigger',
  73. name: 'pi_custname',
  74. bind: '{pi_custname}',
  75. fieldLabel: '客户名称'
  76. },{
  77. xtype : "datefield",
  78. name : "pi_date",
  79. bind : "{pi_date}",
  80. fieldLabel : "单据日期",
  81. allowBlank : false,
  82. columnWidth : 0.25,
  83. defaultValue: new Date()
  84. }
  85. // ,{
  86. // xtype : "textfield",
  87. // name : "pi_total",
  88. // bind : "{pi_total}",
  89. // fieldLabel : "总额",
  90. // allowBlank : true,
  91. // readOnly: true,
  92. // columnWidth : 0.25
  93. // }
  94. ,
  95. {
  96. name : "detailGridField",
  97. xtype : "detailGridField",
  98. storeModel:'saas.model.purchase.ProdIODetail',
  99. // deleteDetailUrl:'http://localhost:9000/prodinout/deleteDetail/',
  100. deleteDetailUrl:'/api/storage/prodinout/deleteDetail/',
  101. detnoColumn: 'pd_pdno',
  102. columns : [
  103. {
  104. text : "id",
  105. dataIndex : "id",
  106. xtype : "numbercolumn",
  107. hidden:true
  108. },{
  109. text : "物料id",
  110. dataIndex : "pd_prodid",
  111. xtype : "numbercolumn",
  112. hidden:true
  113. },
  114. {
  115. text : "物料编号",
  116. width : 200.0,
  117. dataIndex : "pd_prodcode",
  118. xtype : "",
  119. items : null,
  120. editor : {
  121. displayField : "display",
  122. editable : true,
  123. format : "",
  124. hideTrigger : false,
  125. maxLength : 100.0,
  126. minValue : null,
  127. positiveNum : false,
  128. queryMode : "local",
  129. store : null,
  130. valueField : "value",
  131. xtype : "multidbfindtrigger"
  132. }
  133. },
  134. {
  135. text : "名称",
  136. dataIndex : "pr_detail",
  137. ignore:true,
  138. renderer: function (v, m, r) {
  139. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  140. }
  141. },
  142. {
  143. text : "规格",
  144. dataIndex : "pr_spec",
  145. ignore:true,
  146. renderer: function (v, m, r) {
  147. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  148. }
  149. },
  150. {
  151. text : "数量",
  152. dataIndex : "pd_inqty",
  153. width : 120.0,
  154. editor : {
  155. xtype : "numberfield",
  156. decimalPrecision: 8,
  157. minValue:0
  158. },
  159. renderer : function(v) {
  160. var arr = (v + '.').split('.');
  161. var xr = (new Array(arr[1].length)).fill('0');
  162. var format = '0.' + xr.join();
  163. return Ext.util.Format.number(v, format);
  164. },
  165. summaryType: 'sum',
  166. summaryRenderer: function(v) {
  167. var arr = (v + '.').split('.');
  168. var xr = (new Array(arr[1].length)).fill('0');
  169. var format = '0.' + xr.join();
  170. return Ext.util.Format.number(v, format);
  171. }
  172. },{
  173. text : "拨出仓库id",
  174. dataIndex : "pd_whid",
  175. xtype : "numbercolumn",
  176. hidden:true
  177. },
  178. {
  179. text : "拨出仓库编号",
  180. dataIndex : "pd_whcode",
  181. hidden:true
  182. },
  183. {
  184. text : "拨出仓库",
  185. dataIndex : "pd_whname",
  186. width : 120.0,
  187. items : null,
  188. editor : {
  189. displayField : "display",
  190. editable : true,
  191. format : "",
  192. hideTrigger : false,
  193. maxLength : 100.0,
  194. minValue : null,
  195. positiveNum : false,
  196. queryMode : "local",
  197. store : null,
  198. valueField : "value",
  199. xtype : "dbfindtrigger"
  200. }
  201. },{
  202. text : "拨入仓库id",
  203. dataIndex : "pd_inwhid",
  204. xtype : "numbercolumn",
  205. hidden:true
  206. },
  207. {
  208. text : "拨入仓库编号",
  209. dataIndex : "pd_inwhcode",
  210. hidden:true
  211. },
  212. {
  213. text : "拨入仓库",
  214. dataIndex : "pd_inwhname",
  215. width : 120.0,
  216. items : null,
  217. editor : {
  218. displayField : "display",
  219. editable : true,
  220. format : "",
  221. hideTrigger : false,
  222. maxLength : 100.0,
  223. minValue : null,
  224. positiveNum : false,
  225. queryMode : "local",
  226. store : null,
  227. valueField : "value",
  228. xtype : "dbfindtrigger"
  229. }
  230. }
  231. // ,
  232. // {
  233. // text : "单价",
  234. // dataIndex : "pd_orderprice",
  235. // editor : {
  236. // xtype : "numberfield"
  237. // },
  238. // width : 120.0,
  239. // xtype : "numbercolumn",
  240. // items : null
  241. // },
  242. // {
  243. // text : "含税金额",
  244. // dataIndex : "pd_total",
  245. // width : 120.0,
  246. // xtype : "numbercolumn"
  247. // }, {
  248. // text : "税率",
  249. // dataIndex : "pd_taxrate",
  250. // editor : {
  251. // xtype : "numberfield"
  252. // },
  253. // width : 120.0,
  254. // xtype : "numbercolumn",
  255. // items : null
  256. // },
  257. // {
  258. // text : "未税金额",
  259. // dataIndex : "pd_nettotal",
  260. // xtype : "numbercolumn"
  261. // }
  262. ]
  263. }, {
  264. xtype : "datefield",
  265. name : "createTime",
  266. bind : "{createTime}",
  267. fieldLabel : "创建时间",
  268. allowBlank : true,
  269. columnWidth : 0.25
  270. }, {
  271. xtype : "datefield",
  272. name : "updateTime",
  273. bind : "{updateTime}",
  274. fieldLabel : "更新时间",
  275. allowBlank : true,
  276. columnWidth : 0.25
  277. }, {
  278. xtype : "textfield",
  279. readOnly : true,
  280. editable : false,
  281. name : "pi_status",
  282. bind : "{pi_status}",
  283. fieldLabel : "单据状态",
  284. allowBlank : true,
  285. columnWidth : 0.25
  286. }, {
  287. xtype : "hidden",
  288. readOnly : true,
  289. editable : false,
  290. name : "pi_statuscode",
  291. bind : "{pi_statuscode}",
  292. fieldLabel : "单据状态码",
  293. allowBlank : true,
  294. columnWidth : 0.0
  295. }]
  296. });