FormPanel.js 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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. handler: 'turnOut'
  32. }],
  33. defaultItems: [{
  34. xtype: 'hidden',
  35. name: 'id',
  36. bind: '{id}',
  37. fieldLabel: 'id',
  38. allowBlank: true,
  39. columnWidth: 0
  40. },{
  41. xtype : "textfield",
  42. name : "pi_class",
  43. bind : "{pi_class}",
  44. fieldLabel : "单据类型",
  45. readOnly:true,
  46. allowBlank : true,
  47. columnWidth : 0.25
  48. }, {
  49. xtype : "hidden",
  50. name : "pi_vendid",
  51. bind : "{pi_vendid}",
  52. fieldLabel : "供应商ID",
  53. allowBlank : true,
  54. columnWidth : 0.0
  55. },{
  56. xtype: 'hidden',
  57. name: 'pi_vendcode',
  58. bind: '{pi_vendcode}',
  59. fieldLabel: '供应商编号'
  60. }, {
  61. xtype: 'dbfindtrigger',
  62. name: 'pi_vendname',
  63. bind: '{pi_vendname}',
  64. fieldLabel: '供应商名称'
  65. },{
  66. xtype : "datefield",
  67. name : "pi_date",
  68. bind : "{pi_date}",
  69. fieldLabel : "单据日期",
  70. allowBlank : false,
  71. columnWidth : 0.25
  72. },{
  73. xtype : "textfield",
  74. name : "pi_total",
  75. bind : "{pi_total}",
  76. fieldLabel : "总额",
  77. allowBlank : true,
  78. readOnly: true,
  79. columnWidth : 0.25
  80. }, {
  81. xtype : "hidden",
  82. name : "pi_puid",
  83. bind : "{pi_puid}",
  84. fieldLabel : "采购单id",
  85. allowBlank : true,
  86. columnWidth : 0.25
  87. },{
  88. xtype : "textfield",
  89. name : "pi_pucode",
  90. bind : "{pi_pucode}",
  91. fieldLabel : "采购单号",
  92. allowBlank : true,
  93. columnWidth : 0.25
  94. }, {
  95. name : "detailGridField",
  96. xtype : "detailGridField",
  97. storeModel:'saas.model.document.ProductDTO',
  98. // deleteDetailUrl:'http://localhost:8800/prodinout/deleteDetail/',
  99. deleteDetailUrl:'api/purchase/prodinout/deleteDetail/',
  100. detnoColumn: 'pd_pdno',
  101. columns : [
  102. {
  103. text : "id",
  104. dataIndex : "id",
  105. xtype : "numbercolumn",
  106. hidden:true
  107. },{
  108. text : "物料id",
  109. dataIndex : "pd_prodid",
  110. xtype : "numbercolumn",
  111. hidden:true
  112. },
  113. {
  114. text : "物料编号",
  115. width : 200.0,
  116. dataIndex : "pd_prodcode",
  117. xtype : "",
  118. items : null,
  119. editor : {
  120. displayField : "display",
  121. editable : true,
  122. format : "",
  123. hideTrigger : false,
  124. maxLength : 100.0,
  125. minValue : null,
  126. positiveNum : false,
  127. queryMode : "local",
  128. store : null,
  129. valueField : "value",
  130. xtype : "dbfindtrigger"
  131. }
  132. },
  133. {
  134. text : "名称",
  135. dataIndex : "pr_detail",
  136. ignore:true,
  137. renderer: function (v, m, r) {
  138. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  139. }
  140. },
  141. {
  142. text : "规格",
  143. dataIndex : "pr_spec",
  144. ignore:true,
  145. renderer: function (v, m, r) {
  146. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  147. }
  148. },
  149. {
  150. text : "数量",
  151. dataIndex : "pd_inqty",
  152. editor : {
  153. xtype : "numberfield"
  154. },
  155. width : 120.0,
  156. xtype : "numbercolumn",
  157. format:'0',
  158. items : null,
  159. summaryType: 'sum'
  160. }, {
  161. text : "已转数",
  162. dataIndex : "pd_yqty",
  163. width : 120.0,
  164. xtype : "numbercolumn",
  165. format:'0',
  166. items : null,
  167. summaryType: 'sum'
  168. },{
  169. text : "仓库id",
  170. dataIndex : "pd_whid",
  171. xtype : "numbercolumn",
  172. hidden:true
  173. },
  174. {
  175. text : "仓库编号",
  176. dataIndex : "pd_whcode",
  177. hidden:true
  178. },
  179. {
  180. text : "仓库",
  181. dataIndex : "pd_whname",
  182. width : 120.0,
  183. items : null,
  184. editor : {
  185. displayField : "display",
  186. editable : true,
  187. format : "",
  188. hideTrigger : false,
  189. maxLength : 100.0,
  190. minValue : null,
  191. positiveNum : false,
  192. queryMode : "local",
  193. store : null,
  194. valueField : "value",
  195. xtype : "dbfindtrigger"
  196. }
  197. },
  198. {
  199. text : "单价",
  200. editor : {
  201. xtype : "numberfield"
  202. },
  203. dataIndex : "pd_orderprice",
  204. width : 120.0,
  205. xtype : "numbercolumn"
  206. },
  207. {
  208. text : "含税金额",
  209. dataIndex : "pd_total",
  210. width : 120.0,
  211. xtype : "numbercolumn"
  212. }, {
  213. text : "税率",
  214. editor : {
  215. xtype : "numberfield"
  216. },
  217. dataIndex : "pd_taxrate",
  218. width : 120.0,
  219. xtype : "numbercolumn"
  220. },
  221. {
  222. text : "未税金额",
  223. dataIndex : "pd_nettotal",
  224. xtype : "numbercolumn"
  225. },
  226. {
  227. text : "采购单明细id",
  228. dataIndex : "pd_orderid",
  229. width : 120.0,
  230. hidden:true
  231. },
  232. {
  233. text : "采购单号",
  234. dataIndex : "pd_ordercode",
  235. width : 120.0
  236. },{
  237. text : "采购序号",
  238. dataIndex : "pd_orderdetno",
  239. xtype : "numbercolumn",
  240. flex:1
  241. }
  242. ]
  243. }, {
  244. format : "Y-m-d",
  245. xtype : "datefield",
  246. name : "createTime",
  247. bind : "{createTime}",
  248. fieldLabel : "创建时间",
  249. allowBlank : true,
  250. columnWidth : 0.25
  251. }, {
  252. xtype : "datefield",
  253. name : "updateTime",
  254. bind : "{updateTime}",
  255. fieldLabel : "更新时间",
  256. allowBlank : true,
  257. columnWidth : 0.25
  258. }, {
  259. xtype : "textfield",
  260. readOnly : true,
  261. editable : false,
  262. name : "pi_status",
  263. bind : "{pi_status}",
  264. fieldLabel : "单据状态",
  265. allowBlank : true,
  266. columnWidth : 0.25
  267. }, {
  268. xtype : "hidden",
  269. readOnly : true,
  270. editable : false,
  271. name : "pi_statuscode",
  272. bind : "{pi_statuscode}",
  273. fieldLabel : "单据状态码",
  274. allowBlank : true,
  275. columnWidth : 0.0
  276. }]
  277. });