FormPanel.js 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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. },{
  76. xtype : "textfield",
  77. name : "pi_total",
  78. bind : "{pi_total}",
  79. fieldLabel : "总额",
  80. allowBlank : true,
  81. readOnly: true,
  82. columnWidth : 0.25
  83. }, {
  84. xtype : "hidden",
  85. name : "pi_puid",
  86. bind : "{pi_puid}",
  87. fieldLabel : "采购单id",
  88. allowBlank : true,
  89. columnWidth : 0.25
  90. },{
  91. xtype : "textfield",
  92. name : "pi_pucode",
  93. bind : "{pi_pucode}",
  94. fieldLabel : "采购单号",
  95. allowBlank : true,
  96. columnWidth : 0.25
  97. }, {
  98. name : "detailGridField",
  99. xtype : "detailGridField",
  100. storeModel:'saas.model.purchase.ProdIODetail',
  101. // deleteDetailUrl:'http://localhost:8800/prodinout/deleteDetail/',
  102. deleteDetailUrl:'api/purchase/prodinout/deleteDetail/',
  103. detnoColumn: 'pd_pdno',
  104. columns : [
  105. {
  106. text : "id",
  107. dataIndex : "id",
  108. xtype : "numbercolumn",
  109. hidden:true
  110. },{
  111. text : "物料id",
  112. dataIndex : "pd_prodid",
  113. xtype : "numbercolumn",
  114. hidden:true
  115. },
  116. {
  117. text : "物料编号",
  118. width : 200.0,
  119. dataIndex : "pd_prodcode",
  120. xtype : "",
  121. items : null,
  122. editor : {
  123. displayField : "display",
  124. editable : true,
  125. format : "",
  126. hideTrigger : false,
  127. maxLength : 100.0,
  128. minValue : null,
  129. positiveNum : false,
  130. queryMode : "local",
  131. store : null,
  132. valueField : "value",
  133. xtype : "multidbfindtrigger"
  134. }
  135. },
  136. {
  137. text : "名称",
  138. dataIndex : "pr_detail",
  139. ignore:true,
  140. renderer: function (v, m, r) {
  141. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  142. }
  143. },
  144. {
  145. text : "规格",
  146. dataIndex : "pr_spec",
  147. ignore:true,
  148. renderer: function (v, m, r) {
  149. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  150. }
  151. },
  152. {
  153. text : "数量",
  154. dataIndex : "pd_inqty",
  155. editor : {
  156. xtype : "numberfield"
  157. },
  158. width : 120.0,
  159. xtype : "numbercolumn",
  160. format:'0',
  161. items : null,
  162. summaryType: 'sum'
  163. }, {
  164. text : "已转数",
  165. dataIndex : "pd_yqty",
  166. width : 120.0,
  167. xtype : "numbercolumn",
  168. format:'0',
  169. items : null,
  170. summaryType: 'sum'
  171. },{
  172. text : "仓库id",
  173. dataIndex : "pd_whid",
  174. xtype : "numbercolumn",
  175. hidden:true
  176. },
  177. {
  178. text : "仓库编号",
  179. dataIndex : "pd_whcode",
  180. hidden:true
  181. },
  182. // {
  183. // text : "仓库",
  184. // dataIndex : "pd_whname",
  185. // width : 120.0,
  186. // items : null,
  187. // editor : {
  188. // editable:false,
  189. // xtype : "remotecombo",
  190. // storeUrl:'/api/document/warehouse/getCombo',
  191. // name : "wh_name",
  192. // hiddenBtn:false,//true 则会关闭新增按钮功能
  193. // addHandler:function(b){
  194. // var document = Ext.create('saas.view.document.kind.Kind',{});
  195. // var form =this.ownerCmp.ownerCt.ownerCmp.ownerCt;
  196. // this.dialog = form.getController().getView().add({
  197. // xtype: 'document-kind-childwin',
  198. // bind: {
  199. // title: '新增供应商类型'
  200. // },
  201. // dataKind:'warehouse',
  202. // belong:document.etc['warehouse'],
  203. // _parent:form,
  204. // _combo:this.ownerCmp,
  205. // record:null,
  206. // session: true
  207. // });
  208. // this.dialog.show();
  209. // }
  210. // }
  211. // },
  212. {
  213. text : "仓库",
  214. dataIndex : "pd_whname",
  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. text : "单价",
  233. editor : {
  234. xtype : "numberfield"
  235. },
  236. dataIndex : "pd_orderprice",
  237. width : 120.0,
  238. xtype : "numbercolumn"
  239. },
  240. {
  241. text : "含税金额",
  242. dataIndex : "pd_total",
  243. width : 120.0,
  244. xtype : "numbercolumn"
  245. }, {
  246. text : "税率",
  247. editor : {
  248. xtype : "numberfield"
  249. },
  250. dataIndex : "pd_taxrate",
  251. width : 120.0,
  252. xtype : "numbercolumn"
  253. },
  254. {
  255. text : "未税金额",
  256. dataIndex : "pd_nettotal",
  257. xtype : "numbercolumn"
  258. },
  259. {
  260. text : "采购单明细id",
  261. dataIndex : "pd_orderid",
  262. width : 120.0,
  263. hidden:true
  264. },
  265. {
  266. text : "采购单号",
  267. dataIndex : "pd_ordercode",
  268. width : 120.0
  269. },{
  270. text : "采购序号",
  271. dataIndex : "pd_orderdetno",
  272. xtype : "numbercolumn",
  273. flex:1
  274. }
  275. ]
  276. }, {
  277. format : "Y-m-d",
  278. xtype : "datefield",
  279. name : "createTime",
  280. bind : "{createTime}",
  281. fieldLabel : "创建时间",
  282. allowBlank : true,
  283. columnWidth : 0.25
  284. }, {
  285. xtype : "datefield",
  286. name : "updateTime",
  287. bind : "{updateTime}",
  288. fieldLabel : "更新时间",
  289. allowBlank : true,
  290. columnWidth : 0.25
  291. }, {
  292. xtype : "textfield",
  293. readOnly : true,
  294. editable : false,
  295. name : "pi_status",
  296. bind : "{pi_status}",
  297. fieldLabel : "单据状态",
  298. allowBlank : true,
  299. columnWidth : 0.25
  300. }, {
  301. xtype : "hidden",
  302. readOnly : true,
  303. editable : false,
  304. name : "pi_statuscode",
  305. bind : "{pi_statuscode}",
  306. fieldLabel : "单据状态码",
  307. allowBlank : true,
  308. columnWidth : 0.0
  309. }]
  310. });