FormPanel.js 9.1 KB

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