QueryPanel_1.js 16 KB

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