FormPanel.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'purchase-purchasein-formpanel',
  4. controller: 'purchase-purchasein-formpanel',
  5. viewModel: 'purchase-purchasein-formpanel',
  6. viewName: 'purchase-purchasein-formpanel',
  7. caller:'PurchaseIn',
  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. _turnOutUrl:'/api/purchase/prodinout/turnProdOut/',
  21. // _relationColumn: 'pd_piid',
  22. // _readUrl:'http://localhost:8800/prodinout/read/',
  23. // _saveUrl:'http://localhost:8800/prodinout/save',
  24. // _auditUrl:'http://localhost:8800/prodinout/audit',
  25. // _unAuditUrl:'http://localhost:8800/prodinout/unAudit/',
  26. // _deleteUrl:'http://localhost:8800/prodinout/delete/',
  27. // _turnOutUrl:'http://localhost:8800/prodinout/turnProdOut/',
  28. initId:0,
  29. toolBtns: [{
  30. xtype: 'button',
  31. text: '转采购验退单',
  32. bind: {
  33. hidden: '{!id}'
  34. },
  35. handler: 'turnOut'
  36. }],
  37. defaultItems: [{
  38. xtype: 'hidden',
  39. name: 'id',
  40. bind: '{id}',
  41. fieldLabel: 'id',
  42. allowBlank: true,
  43. columnWidth: 0
  44. },{
  45. xtype : "textfield",
  46. name : "pi_class",
  47. bind : "{pi_class}",
  48. fieldLabel : "单据类型",
  49. readOnly:true,
  50. allowBlank : true,
  51. columnWidth : 0.25
  52. }, {
  53. xtype : "hidden",
  54. name : "pi_vendid",
  55. bind : "{pi_vendid}",
  56. fieldLabel : "供应商ID",
  57. allowBlank : true,
  58. columnWidth : 0.0
  59. },{
  60. xtype: 'hidden',
  61. name: 'pi_vendcode',
  62. bind: '{pi_vendcode}',
  63. fieldLabel: '供应商编号'
  64. }, {
  65. xtype: 'dbfindtrigger',
  66. name: 'pi_vendname',
  67. bind: '{pi_vendname}',
  68. fieldLabel: '供应商名称'
  69. },{
  70. xtype : "datefield",
  71. name : "pi_date",
  72. bind : "{pi_date}",
  73. fieldLabel : "单据日期",
  74. allowBlank : false,
  75. columnWidth : 0.25,
  76. defaultValue: new Date()
  77. },{
  78. xtype : "textfield",
  79. name : "pi_total",
  80. bind : "{pi_total}",
  81. fieldLabel : "总额",
  82. allowBlank : true,
  83. readOnly: true,
  84. columnWidth : 0.25
  85. }, {
  86. xtype : "hidden",
  87. name : "pi_puid",
  88. bind : "{pi_puid}",
  89. fieldLabel : "采购单id",
  90. allowBlank : true,
  91. columnWidth : 0.25
  92. },{
  93. xtype : "textfield",
  94. name : "pi_pucode",
  95. bind : "{pi_pucode}",
  96. fieldLabel : "采购单号",
  97. allowBlank : true,
  98. columnWidth : 0.25
  99. }, {
  100. name : "detailGridField",
  101. xtype : "detailGridField",
  102. storeModel:'saas.model.purchase.ProdIODetail',
  103. // deleteDetailUrl:'http://localhost:8800/prodinout/deleteDetail/',
  104. deleteDetailUrl:'api/purchase/prodinout/deleteDetail/',
  105. detnoColumn: 'pd_pdno',
  106. columns : [
  107. {
  108. text : "id",
  109. dataIndex : "id",
  110. xtype : "numbercolumn",
  111. hidden:true
  112. },{
  113. text : "物料id",
  114. dataIndex : "pd_prodid",
  115. xtype : "numbercolumn",
  116. hidden:true
  117. },
  118. {
  119. text : "物料编号",
  120. width : 200.0,
  121. dataIndex : "pd_prodcode",
  122. xtype : "",
  123. items : null,
  124. editor : {
  125. displayField : "display",
  126. editable : true,
  127. format : "",
  128. hideTrigger : false,
  129. maxLength : 100.0,
  130. minValue : null,
  131. positiveNum : false,
  132. queryMode : "local",
  133. store : null,
  134. valueField : "value",
  135. xtype : "multidbfindtrigger"
  136. }
  137. },
  138. {
  139. text : "名称",
  140. dataIndex : "pr_detail",
  141. ignore:true,
  142. renderer: function (v, m, r) {
  143. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  144. }
  145. },
  146. {
  147. text : "规格",
  148. dataIndex : "pr_spec",
  149. ignore:true,
  150. renderer: function (v, m, r) {
  151. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  152. }
  153. },
  154. {
  155. text : "数量",
  156. dataIndex : "pd_inqty",
  157. editor : {
  158. xtype : "numberfield"
  159. },
  160. width : 120.0,
  161. xtype : "numbercolumn",
  162. format:'0',
  163. items : null,
  164. summaryType: 'sum'
  165. }, {
  166. text : "已转数",
  167. dataIndex : "pd_yqty",
  168. width : 120.0,
  169. xtype : "numbercolumn",
  170. format:'0',
  171. items : null,
  172. summaryType: 'sum'
  173. },{
  174. text : "仓库id",
  175. dataIndex : "pd_whid",
  176. xtype : "numbercolumn",
  177. hidden:true
  178. },
  179. {
  180. text : "仓库编号",
  181. dataIndex : "pd_whcode",
  182. hidden:true
  183. },
  184. // {
  185. // text : "仓库",
  186. // dataIndex : "pd_whname",
  187. // width : 120.0,
  188. // items : null,
  189. // editor : {
  190. // editable:false,
  191. // xtype : "remotecombo",
  192. // storeUrl:'/api/document/warehouse/getCombo',
  193. // name : "wh_name",
  194. // hiddenBtn:false,//true 则会关闭新增按钮功能
  195. // addHandler:function(b){
  196. // var document = Ext.create('saas.view.document.kind.Kind',{});
  197. // var form =this.ownerCmp.ownerCt.ownerCmp.ownerCt;
  198. // this.dialog = form.getController().getView().add({
  199. // xtype: 'document-kind-childwin',
  200. // bind: {
  201. // title: '新增供应商类型'
  202. // },
  203. // dataKind:'warehouse',
  204. // belong:document.etc['warehouse'],
  205. // _parent:form,
  206. // _combo:this.ownerCmp,
  207. // record:null,
  208. // session: true
  209. // });
  210. // this.dialog.show();
  211. // }
  212. // }
  213. // },
  214. {
  215. text : "仓库",
  216. dataIndex : "pd_whname",
  217. width : 120.0,
  218. items : null,
  219. editor : {
  220. displayField : "display",
  221. editable : true,
  222. format : "",
  223. hideTrigger : false,
  224. maxLength : 100.0,
  225. minValue : null,
  226. positiveNum : false,
  227. queryMode : "local",
  228. store : null,
  229. valueField : "value",
  230. xtype : "dbfindtrigger"
  231. }
  232. },
  233. {
  234. text : "单价",
  235. editor : {
  236. xtype : "numberfield"
  237. },
  238. dataIndex : "pd_orderprice",
  239. width : 120.0,
  240. xtype : "numbercolumn"
  241. },
  242. {
  243. text : "含税金额",
  244. dataIndex : "pd_total",
  245. width : 120.0,
  246. xtype : "numbercolumn",
  247. summaryType: 'sum'
  248. }, {
  249. text : "税率",
  250. editor : {
  251. xtype : "numberfield"
  252. },
  253. dataIndex : "pd_taxrate",
  254. width : 120.0,
  255. xtype : "numbercolumn"
  256. },
  257. {
  258. text : "未税金额",
  259. dataIndex : "pd_nettotal",
  260. xtype : "numbercolumn",
  261. summaryType: 'sum'
  262. },
  263. {
  264. text : "采购单明细id",
  265. dataIndex : "pd_orderid",
  266. width : 120.0,
  267. hidden:true
  268. },
  269. {
  270. text : "采购单号",
  271. dataIndex : "pd_ordercode",
  272. width : 120.0
  273. },{
  274. text : "采购序号",
  275. dataIndex : "pd_orderdetno",
  276. xtype : "numbercolumn",
  277. width : 120.0,
  278. format: '0000',
  279. renderer: function(v) {
  280. return v ? v : null;
  281. }
  282. }
  283. ]
  284. }, {
  285. xtype : "datefield",
  286. name : "createTime",
  287. bind : "{createTime}",
  288. fieldLabel : "创建时间",
  289. allowBlank : true,
  290. columnWidth : 0.25
  291. }, {
  292. xtype : "datefield",
  293. name : "updateTime",
  294. bind : "{updateTime}",
  295. fieldLabel : "更新时间",
  296. allowBlank : true,
  297. columnWidth : 0.25
  298. }, {
  299. xtype : "textfield",
  300. readOnly : true,
  301. editable : false,
  302. name : "pi_status",
  303. bind : "{pi_status}",
  304. fieldLabel : "单据状态",
  305. allowBlank : true,
  306. columnWidth : 0.25
  307. }, {
  308. xtype : "hidden",
  309. readOnly : true,
  310. editable : false,
  311. name : "pi_statuscode",
  312. bind : "{pi_statuscode}",
  313. fieldLabel : "单据状态码",
  314. allowBlank : true,
  315. columnWidth : 0.0
  316. }]
  317. });