QueryPanel.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. Ext.define('make.view.sale.saleForecast.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'sale-saleforecast-querypanel',
  4. controller: 'sale-saleforecast-querypanel',
  5. viewModel: {
  6. extend: 'saas.view.core.query.QueryPanelModel',
  7. data: {
  8. form: {}, // 查询字段记录
  9. addEnable: false, // 显示新增按钮
  10. auditEnable: true, // 显示审核按钮
  11. printEnable: false, // 显示打印按钮
  12. importEnable: true, // 显示导入按钮
  13. exportEnable: true, // 显示导出按钮
  14. closeEnable: true, // 显示关闭按钮
  15. deleteEnable: true, // 显示删除按钮
  16. deleteDisable:false, //删除按钮是否可使用
  17. openAudit:false,//单独显示审核按钮
  18. openUnAudit:false,//单独显示反审核按钮
  19. openEnable:false, //显示开启 针对已取消列表
  20. configurable: true, // 允许列设置
  21. }
  22. },
  23. viewName: 'sale-saleforecast-querypanel',
  24. caller: 'SaleForecast',
  25. importUploadPath: '/api/sale/saleforecast/saveToFormal',
  26. initComponent: function() {
  27. var me = this;
  28. console.log('querypanel');
  29. Ext.apply(me, {
  30. queryFormItems: [
  31. {
  32. xtype: 'condatefield',
  33. name: 'sf_date',
  34. fieldLabel: '订单时间',
  35. showDetail: true,
  36. columnWidth: 0.5
  37. }, {
  38. xtype: 'multiqueryField',
  39. columnWidth: 0.4,
  40. name: 'multi_query',
  41. querys: {
  42. "Prod": {"field": "pr_code", "dbfinds": [{
  43. from: 'pr_code',
  44. to: 'pr_code'
  45. },{
  46. from: 'pr_detail',
  47. to: 'pr_detail'
  48. }]},
  49. "Cust": {"field": "sd_custname", "dbfinds": [{
  50. from: 'cu_name',
  51. to: 'sd_custname'
  52. }]},
  53. "Emp":{"field": "sf_seller", "dbfinds": [{
  54. from: 'em_name',
  55. to: 'sf_seller'
  56. }]},
  57. "BillCode": {"field": "sf_code" ,"desc": "订单号"}
  58. }
  59. }],
  60. moreQueryFormItems: [{
  61. xtype: 'condatefield',
  62. name: 'sf_date',
  63. fieldLabel: '单据日期',
  64. columnWidth: 1
  65. }, {
  66. xtype: 'customerDbfindTrigger',
  67. name: 'sd_custname',
  68. fieldLabel: '客户名称'
  69. },{
  70. xtype: 'productDbfindTrigger',
  71. name: 'saleforecastdetail.sd_prodcode',
  72. showDetail: true,
  73. fieldLabel: '物料编号'
  74. },{
  75. xtype: 'textfield',
  76. name: 'pr_detail',
  77. fieldLabel: '产品名称',
  78. readOnly: true,
  79. }, {
  80. xtype: 'textfield',
  81. name: 'pr_orispeccode',
  82. fieldLabel: '产品型号',
  83. readOnly: true,
  84. renderer: saas.util.RenderUtil['renderer_prod']
  85. }, {
  86. editable: false,
  87. xtype: "remotecombo",
  88. storeUrl: '/api/document/productbrand/getCombo',
  89. name: "pr_brand",
  90. fieldLabel: "厂家/品牌",
  91. showDetail: true,
  92. addHandler: function (b) {
  93. var form = this.ownerCmp.ownerCt;
  94. this.dialog = form.add({
  95. xtype: 'document-productbrand-window',
  96. bind: {
  97. title: '新增物料厂家/品牌'
  98. },
  99. dataKind: 'productbrand',
  100. _parent: form,
  101. _combo: this.ownerCmp,
  102. record: null,
  103. session: true
  104. });
  105. this.dialog.show();
  106. },
  107. editHandler:function(btn,type){
  108. saas.util.BaseUtil.openTab('document-productbrand-datalist', '物料厂家/品牌','maintab--document-productbrand-datalist');
  109. var combo = btn.ownerCt.up('remotecombo');
  110. if(combo){
  111. combo.collapse();
  112. }
  113. }
  114. },/*{
  115. xtype: 'combobox',
  116. name: 'sf_currency',
  117. fieldLabel: '币别',
  118. queryMode: 'local',
  119. displayField: 'sf_currency',
  120. valueField: 'sf_currency',
  121. emptyText :'',
  122. editable:false,
  123. store: Ext.create('Ext.data.ArrayStore', {
  124. fields: ['sf_currency', 'sf_currency'],
  125. data: [
  126. ["RMB", "RMB"],
  127. ["USD", "USD"],
  128. ["HKD", "HKD"]
  129. ]
  130. }),
  131. getCondition: function(value) {
  132. if(!value) {
  133. return '1=1';
  134. }else {
  135. return 'sf_currency=\'' + value + '\'';
  136. }
  137. }
  138. },*/ {
  139. xtype: 'employeeDbfindTrigger',
  140. name: 'sf_seller',
  141. fieldLabel: '业务员',
  142. emptyText:'输入人员编号或名称',
  143. }/*, {
  144. xtype: 'multicombo',
  145. name: 'sa_sendstatuscode',
  146. fieldLabel: '业务状态',
  147. allowBlank: true,
  148. emptyText:'全部',
  149. datas: [
  150. ["TURNOUT", "已出库"],
  151. ["UNTURNOUT", "未出库"],
  152. ["PARTOUT", "部分出库"],
  153. ["CLOSE", "已关闭"]
  154. ]
  155. }*/, {
  156. xtype: 'employeeDbfindTrigger',
  157. name: 'creatorName',
  158. fieldLabel: '录入人',
  159. emptyText:'请输入账户名称或姓名',
  160. getCondition: function(value) {
  161. if(!value) {
  162. return '1=1';
  163. }else {
  164. return 'saleforecast.creatorName like\'%' + value + '%\'';
  165. }
  166. }
  167. },{
  168. xtype: 'condatefield',
  169. name: 'saleforecast.createTime',
  170. fieldLabel: '录入日期',
  171. columnWidth: 1
  172. }, {
  173. xtype: 'employeeDbfindTrigger',
  174. name: 'sf_auditman',
  175. fieldLabel: '审核人',
  176. emptyText:'请输入账户名称或姓名',
  177. }, {
  178. xtype: 'combobox',
  179. name: 'sf_statuscode',
  180. fieldLabel: '审核状态',
  181. queryMode: 'local',
  182. displayField: 'sf_status',
  183. valueField: 'sf_statuscode',
  184. emptyText :'全部',
  185. editable:false,
  186. store: Ext.create('Ext.data.ArrayStore', {
  187. fields: ['sf_statuscode', 'sf_status'],
  188. data: [
  189. ["ALL", "全部"],
  190. ["AUDITED", "已审核"],
  191. ["UNAUDITED", "未审核"]
  192. ]
  193. }),
  194. getCondition: function(value) {
  195. if(value == 'ALL') {
  196. return '1=1';
  197. }else {
  198. return 'sf_statuscode=\'' + value + '\'';
  199. }
  200. }
  201. }],
  202. queryGridConfig: {
  203. idField: 'sd_id',
  204. mainIdField:'sf_id',
  205. detailIdField:'sd_id',
  206. codeField: 'sf_code',
  207. addTitle: '备货单',
  208. addXtype: 'sale-saleforecast-formpanel',
  209. defaultCondition:me.defaultCondition,
  210. baseVastUrl: '/api/sale/saleforecast/',
  211. caller:'SaleForecast',
  212. baseColumn: [{
  213. text: '明细id',
  214. dataIndex: 'sd_id',
  215. hidden:true,
  216. xtype: 'numbercolumn'
  217. },{
  218. text: 'id',
  219. dataIndex: 'sf_id',
  220. hidden:true,
  221. xtype: 'numbercolumn'
  222. }, {
  223. text: '备货单号',
  224. dataIndex: 'sf_code',
  225. width: 150,
  226. }, {
  227. text: '单据日期',
  228. dataIndex: 'sf_date',
  229. xtype: 'datecolumn',
  230. width: 110
  231. }, {
  232. text: '客户名称',
  233. dataIndex: 'sd_custname',
  234. width: 200
  235. },{
  236. text: '审核状态',
  237. dataIndex: 'sf_status',
  238. width: 80
  239. },{
  240. text: '序号',
  241. dataIndex: 'sd_detno',
  242. width: 60
  243. },{
  244. text: '物料名称',
  245. dataIndex: 'pr_detail',
  246. width: 200
  247. },{
  248. text: '型号',
  249. dataIndex: 'pr_orispeccode',
  250. width: 200
  251. },{
  252. text: '已核销数量',
  253. dataIndex: 'sd_yqty',
  254. xtype: 'numbercolumn',
  255. width: 110,
  256. renderer : function(v, m, r) {
  257. return saas.util.BaseUtil.numberFormat(v, 6, true);
  258. },
  259. },{
  260. text: '备货数',
  261. dataIndex: 'sd_qty',
  262. xtype: 'numbercolumn',
  263. width: 110,
  264. renderer : function(v, m, r) {
  265. return saas.util.BaseUtil.numberFormat(v, 6, true);
  266. },
  267. summaryType: 'sum',
  268. summaryRenderer: function(v, d, f, m) {
  269. return saas.util.BaseUtil.numberFormat(v, 6, true);
  270. }
  271. },{
  272. text: '已开工单数',
  273. dataIndex: 'sd_ymaqty',
  274. xtype: 'numbercolumn',
  275. width: 110,
  276. renderer : function(v, m, r) {
  277. return saas.util.BaseUtil.numberFormat(v, 6, true);
  278. },
  279. },{
  280. text: '订单冲减工单数',
  281. dataIndex: 'sd_maqty',
  282. xtype: 'numbercolumn',
  283. width: 140,
  284. renderer : function(v, m, r) {
  285. return saas.util.BaseUtil.numberFormat(v, 6, true);
  286. },
  287. }, {
  288. text: '交货日期',
  289. dataIndex: 'sd_delivery',
  290. xtype: 'datecolumn',
  291. width: 110
  292. },{
  293. text: '业务员',
  294. align: 'center',
  295. dataIndex: 'sf_seller',
  296. width: 80
  297. },{
  298. text: '物料编号',
  299. dataIndex: 'sd_prodcode',
  300. width: 200
  301. },{
  302. text: '厂家/品牌',
  303. dataIndex: 'pr_brand',
  304. width: 200
  305. },{
  306. text: '备注',
  307. dataIndex: 'sd_remark',
  308. width: 250
  309. }],
  310. relativeColumn: [{
  311. text: '明细id',
  312. dataIndex: 'sd_id',
  313. hidden:true,
  314. xtype: 'numbercolumn'
  315. },{
  316. text: 'id',
  317. dataIndex: 'sf_id',
  318. hidden:true,
  319. xtype: 'numbercolumn'
  320. }, {
  321. text: '备货单号',
  322. dataIndex: 'sf_code',
  323. width: 150
  324. }, {
  325. text: '单据日期',
  326. dataIndex: 'sf_date',
  327. xtype: 'datecolumn',
  328. width: 110
  329. }, {
  330. text: '客户名称',
  331. dataIndex: 'sd_custname',
  332. width: 200
  333. },{
  334. text: '审核状态',
  335. dataIndex: 'sf_status',
  336. width: 80
  337. },{
  338. text: '序号',
  339. dataIndex: 'sd_detno',
  340. width: 60
  341. },{
  342. text: '物料名称',
  343. dataIndex: 'pr_detail',
  344. width: 200
  345. },{
  346. text: '型号',
  347. dataIndex: 'pr_orispeccode',
  348. width: 200,
  349. renderer: saas.util.RenderUtil['renderer_prod']
  350. },{
  351. text: '已核销数量',
  352. dataIndex: 'sd_yqty',
  353. xtype: 'numbercolumn',
  354. width: 110,
  355. renderer : function(v, m, r) {
  356. return saas.util.BaseUtil.numberFormat(v, 6, true);
  357. },
  358. },{
  359. text: '备货数',
  360. dataIndex: 'sd_qty',
  361. xtype: 'numbercolumn',
  362. width: 110,
  363. renderer : function(v, m, r) {
  364. return saas.util.BaseUtil.numberFormat(v, 6, true);
  365. },
  366. },{
  367. text: '已开工单数',
  368. dataIndex: 'sd_ymaqty',
  369. xtype: 'numbercolumn',
  370. width: 110,
  371. renderer : function(v, m, r) {
  372. return saas.util.BaseUtil.numberFormat(v, 6, true);
  373. },
  374. },{
  375. text: '订单冲减工单数',
  376. dataIndex: 'sd_maqty',
  377. xtype: 'numbercolumn',
  378. width: 140,
  379. renderer : function(v, m, r) {
  380. return saas.util.BaseUtil.numberFormat(v, 6, true);
  381. },
  382. }, {
  383. text: '交货日期',
  384. dataIndex: 'sd_delivery',
  385. xtype: 'datecolumn',
  386. width: 110
  387. },{
  388. text: '业务员',
  389. align: 'center',
  390. dataIndex: 'sf_seller',
  391. width: 80
  392. },{
  393. text: '物料编号',
  394. dataIndex: 'sd_prodcode',
  395. width: 200
  396. },{
  397. text: '厂家/品牌',
  398. dataIndex: 'pr_brand',
  399. width: 200
  400. },{
  401. text: '备注',
  402. dataIndex: 'sd_remark',
  403. width: 250
  404. }]
  405. }
  406. });
  407. me.callParent(arguments);
  408. },
  409. });