QueryPanel_4.js 16 KB

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