QueryPanel.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. Ext.define('saas.view.sale.sale.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'sale-sale-querypanel',
  4. controller: 'sale-sale-querypanel',
  5. viewModel: 'sale-sale-querypanel',
  6. viewName: 'sale-sale-querypanel',
  7. queryFormItems: [{
  8. xtype: 'textfield',
  9. name: 'sa_code',
  10. emptyText:'请输入单号或客户',
  11. getCondition: function(value) {
  12. return ' (sa_code like\'%' + value + '%\' or sa_custcode like \'%'+value+'%\' or sa_custname like \'%'+value+'%\') ';
  13. }
  14. }, {
  15. xtype: 'condatefield',
  16. name: 'sa_date',
  17. fieldLabel: '日期',
  18. columnWidth: 0.5
  19. }, {
  20. xtype: 'productDbfindTrigger',
  21. name: 'pr_detail',
  22. fieldLabel: '物料',
  23. showDetail: true
  24. }, {
  25. xtype: 'combobox',
  26. name: 'sa_statuscode',
  27. fieldLabel: '单据状态',
  28. queryMode: 'local',
  29. displayField: 'sa_status',
  30. valueField: 'sa_statuscode',
  31. emptyText :'全部',
  32. editable:false,
  33. store: Ext.create('Ext.data.ArrayStore', {
  34. fields: ['sa_statuscode', 'sa_status'],
  35. data: [
  36. ["ALL", "全部"],
  37. ["AUDITED", "已审核"],
  38. ["UNAUDITED", "未审核"]
  39. ]
  40. }),
  41. getCondition: function(value) {
  42. if(value == 'ALL') {
  43. return '1=1';
  44. }else {
  45. return 'sa_statuscode=\'' + value + '\'';
  46. }
  47. }
  48. }, {
  49. xtype: 'multicombo',
  50. name: 'sa_sendstatuscode',
  51. fieldLabel: '业务状态',
  52. allowBlank: true,
  53. columnWidth: 0.25,
  54. datas: [
  55. ["TURNOUT", "已出库"],
  56. ["UNTURNOUT", "未出库"],
  57. ["PARTOUT", "部分出库"],
  58. ["CLOSE", "已关闭"]
  59. ]
  60. }, {
  61. xtype: 'employeeDbfindTrigger',
  62. name: 'sa_seller',
  63. fieldLabel: '业务员'
  64. }, {
  65. xtype: 'employeeDbfindTrigger',
  66. name: 'creatorName',
  67. fieldLabel: '录入人',
  68. getCondition: function(value) {
  69. if(!value) {
  70. return '1=1';
  71. }else {
  72. return 'sale.creatorName like\'%' + value + '%\'';
  73. }
  74. }
  75. }, {
  76. xtype: 'employeeDbfindTrigger',
  77. name: 'sa_auditman',
  78. fieldLabel: '审核人'
  79. }],
  80. moreQueryFormItems: [],
  81. queryGridConfig: {
  82. idField: 'sa_id',
  83. codeField: 'sa_code',
  84. addTitle: '销售订单',
  85. addXtype: 'sale-sale-formpanel',
  86. defaultCondition:'',
  87. baseVastUrl: '/api/sale/sale/',
  88. caller:'Sale',
  89. baseColumn: [{
  90. text: 'id',
  91. dataIndex: 'sa_id',
  92. hidden:true,
  93. xtype: 'numbercolumn'
  94. }, {
  95. text: '销售单号',
  96. dataIndex: 'sa_code',
  97. width: 150
  98. }, {
  99. text: '单据日期',
  100. dataIndex: 'sa_date',
  101. xtype: 'datecolumn',
  102. width: 110
  103. }, {
  104. text: '客户编号',
  105. dataIndex: 'sa_custcode',
  106. hidden :true
  107. }, {
  108. text: '客户名称',
  109. dataIndex: 'sa_custname',
  110. width: 250
  111. }, {
  112. text: '总金额',
  113. dataIndex: 'sa_total',
  114. width: 110,
  115. xtype: 'numbercolumn',
  116. renderer : function(v) {
  117. var arr = (v + '.').split('.');
  118. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  119. var format = '0,000.' + xr.join();
  120. return Ext.util.Format.number(v, format);
  121. }
  122. }, {
  123. text: '审核状态',
  124. align: 'center',
  125. dataIndex: 'sa_status',
  126. width: 90
  127. }, {
  128. text: '业务状态',
  129. align: 'center',
  130. dataIndex: 'sa_sendstatus',
  131. width: 100
  132. }, {
  133. text: '业务员',
  134. dataIndex: 'sa_seller',
  135. width: 110
  136. }, {
  137. text: '录入人',
  138. dataIndex: 'creatorName',
  139. hidden :true
  140. }, {
  141. text: '审核人',
  142. dataIndex: 'sa_auditman',
  143. width: 110
  144. }, {
  145. text: '收货地址',
  146. dataIndex: 'sa_toplace',
  147. hidden :true
  148. }, {
  149. text: '备注',
  150. dataIndex: 'sa_remark',
  151. width: 250
  152. }
  153. ],
  154. relativeColumn: [ {
  155. text: 'id',
  156. dataIndex: 'sa_id',
  157. hidden:true,
  158. xtype: 'numbercolumn'
  159. }, {
  160. text: '单据编号',
  161. dataIndex: 'sa_code',
  162. width: 200
  163. }, {
  164. text: '单据状态',
  165. align: 'center',
  166. dataIndex: 'sa_status',
  167. width: 120
  168. }, {
  169. text: '单据日期',
  170. dataIndex: 'sa_date',
  171. xtype: 'datecolumn',
  172. width: 200
  173. }, {
  174. text: '客户名称',
  175. dataIndex: 'sa_custname',
  176. width: 120
  177. }, {
  178. text: '业务状态',
  179. align: 'center',
  180. dataIndex: 'sa_sendstatus',
  181. width: 90
  182. }, {
  183. text: '明细序号',
  184. dataIndex: 'sd_detno',
  185. xtype: 'numbercolumn',
  186. width: 120,
  187. renderer : function(v) {
  188. return Ext.util.Format.number(v, '0');
  189. }
  190. }, {
  191. text: '物料编号',
  192. dataIndex: 'sd_prodcode',
  193. width: 120
  194. }, {
  195. text: '物料名称',
  196. dataIndex: 'pr_detail',
  197. width: 120
  198. }, {
  199. text: '物料规格',
  200. dataIndex: 'pr_spec',
  201. width: 120
  202. }, {
  203. text: '数量',
  204. dataIndex: 'sd_qty',
  205. xtype: 'numbercolumn',
  206. width: 120,
  207. renderer : function(v) {
  208. var arr = (v + '.').split('.');
  209. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  210. var format = '0.' + xr.join();
  211. return Ext.util.Format.number(v, format);
  212. },
  213. }, {
  214. text: '单价',
  215. dataIndex: 'sd_price',
  216. xtype: 'numbercolumn',
  217. width: 120,
  218. renderer : function(v) {
  219. var arr = (v + '.').split('.');
  220. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  221. var format = '0,000.' + xr.join();
  222. return Ext.util.Format.number(v, format);
  223. },
  224. }, {
  225. text: '已转数',
  226. dataIndex: 'sd_yqty',
  227. xtype: 'numbercolumn',
  228. width: 120,
  229. renderer : function(v) {
  230. var arr = (v + '.').split('.');
  231. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  232. var format = '0.' + xr.join();
  233. return Ext.util.Format.number(v, format);
  234. },
  235. }, {
  236. text: '已出货数',
  237. dataIndex: 'sd_sendqty',
  238. xtype: 'numbercolumn',
  239. width: 120,
  240. renderer : function(v) {
  241. var arr = (v + '.').split('.');
  242. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  243. var format = '0.' + xr.join();
  244. return Ext.util.Format.number(v, format);
  245. },
  246. }, {
  247. text: '备注',
  248. dataIndex: 'sd_remark',
  249. width: 250
  250. }]
  251. }
  252. });