QueryPanel.js 7.9 KB

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