FormPanel.js 8.3 KB

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