FormPanel.js 10 KB

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