QueryPanel_3.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. Ext.define('make.view.sale.saleForecast.QueryPanel_3', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'sale-saleforecast-querypanel-3',
  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:false, //单独显示取消
  20. openEnable:true, //单独显示开启 针对已取消列表
  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. 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: 'sf_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. }, {
  85. editable: false,
  86. xtype: "remotecombo",
  87. storeUrl: '/api/document/productbrand/getCombo',
  88. name: "pr_brand",
  89. fieldLabel: "厂家/品牌",
  90. showDetail: true,
  91. addHandler: function (b) {
  92. var form = this.ownerCmp.ownerCt;
  93. this.dialog = form.add({
  94. xtype: 'document-productbrand-window',
  95. bind: {
  96. title: '新增物料厂家/品牌'
  97. },
  98. dataKind: 'productbrand',
  99. _parent: form,
  100. _combo: this.ownerCmp,
  101. record: null,
  102. session: true
  103. });
  104. this.dialog.show();
  105. },
  106. editHandler:function(btn,type){
  107. saas.util.BaseUtil.openTab('document-productbrand-datalist', '物料厂家/品牌','maintab--document-productbrand-datalist');
  108. var combo = btn.ownerCt.up('remotecombo');
  109. if(combo){
  110. combo.collapse();
  111. }
  112. }
  113. },/*{
  114. xtype: 'combobox',
  115. name: 'sf_currency',
  116. fieldLabel: '币别',
  117. queryMode: 'local',
  118. displayField: 'sf_currency',
  119. valueField: 'sf_currency',
  120. emptyText :'',
  121. editable:false,
  122. store: Ext.create('Ext.data.ArrayStore', {
  123. fields: ['sf_currency', 'sf_currency'],
  124. data: [
  125. ["RMB", "RMB"],
  126. ["USD", "USD"],
  127. ["HKD", "HKD"]
  128. ]
  129. }),
  130. getCondition: function(value) {
  131. if(!value) {
  132. return '1=1';
  133. }else {
  134. return 'sf_currency=\'' + value + '\'';
  135. }
  136. }
  137. },*/ {
  138. xtype: 'employeeDbfindTrigger',
  139. name: 'sf_seller',
  140. fieldLabel: '业务员',
  141. emptyText:'输入人员编号或名称',
  142. }/*, {
  143. xtype: 'multicombo',
  144. name: 'sa_sendstatuscode',
  145. fieldLabel: '业务状态',
  146. allowBlank: true,
  147. emptyText:'全部',
  148. datas: [
  149. ["TURNOUT", "已出库"],
  150. ["UNTURNOUT", "未出库"],
  151. ["PARTOUT", "部分出库"],
  152. ["CLOSE", "已关闭"]
  153. ]
  154. }*/, {
  155. xtype: 'employeeDbfindTrigger',
  156. name: 'creatorName',
  157. fieldLabel: '录入人',
  158. emptyText:'请输入账户名称或姓名',
  159. getCondition: function(value) {
  160. if(!value) {
  161. return '1=1';
  162. }else {
  163. return 'saleforecast.creatorName like\'%' + value + '%\'';
  164. }
  165. }
  166. },{
  167. xtype: 'condatefield',
  168. name: 'saleforecast.createTime',
  169. fieldLabel: '录入日期',
  170. columnWidth: 1
  171. }, {
  172. xtype: 'employeeDbfindTrigger',
  173. name: 'sf_auditman',
  174. fieldLabel: '审核人',
  175. emptyText:'请输入账户名称或姓名',
  176. }, {
  177. xtype: 'combobox',
  178. name: 'sf_statuscode',
  179. fieldLabel: '审核状态',
  180. queryMode: 'local',
  181. displayField: 'sf_status',
  182. valueField: 'sf_statuscode',
  183. emptyText :'全部',
  184. editable:false,
  185. store: Ext.create('Ext.data.ArrayStore', {
  186. fields: ['sf_statuscode', 'sf_status'],
  187. data: [
  188. ["ALL", "全部"],
  189. ["AUDITED", "已审核"],
  190. ["UNAUDITED", "未审核"]
  191. ]
  192. }),
  193. getCondition: function(value) {
  194. if(value == 'ALL') {
  195. return '1=1';
  196. }else {
  197. return 'sf_statuscode=\'' + value + '\'';
  198. }
  199. }
  200. }],
  201. queryGridConfig: {
  202. idField: 'sd_id',
  203. mainIdField:'sf_id',
  204. detailIdField:'sd_id',
  205. codeField: 'sf_code',
  206. addTitle: '备货单',
  207. addXtype: 'sale-saleforecast-formpanel',
  208. defaultCondition:me.defaultCondition,
  209. baseVastUrl: '/api/sale/saleforecast/',
  210. caller:'SaleForecast',
  211. baseColumn: [{
  212. text: '明细id',
  213. dataIndex: 'sd_id',
  214. hidden:true,
  215. xtype: 'numbercolumn'
  216. },{
  217. text: 'id',
  218. dataIndex: 'sf_id',
  219. hidden:true,
  220. xtype: 'numbercolumn'
  221. }, {
  222. text: '备货单号',
  223. dataIndex: 'sf_code',
  224. width: 150
  225. }, {
  226. text: '单据日期',
  227. dataIndex: 'sf_date',
  228. xtype: 'datecolumn',
  229. width: 110
  230. }, {
  231. text: '客户名称',
  232. dataIndex: 'sd_custname',
  233. width: 200
  234. },{
  235. text: '序号',
  236. dataIndex: 'sd_detno',
  237. width: 60
  238. },{
  239. text: '物料名称',
  240. dataIndex: 'pr_detail',
  241. width: 200
  242. },{
  243. text: '型号',
  244. dataIndex: 'pr_orispeccode',
  245. width: 200
  246. },{
  247. text: '已核销数量',
  248. dataIndex: 'sd_yqty',
  249. xtype: 'numbercolumn',
  250. width: 110,
  251. renderer : function(v, m, r) {
  252. return saas.util.BaseUtil.numberFormat(v, 6, true);
  253. },
  254. },{
  255. text: '备货数',
  256. dataIndex: 'sd_qty',
  257. xtype: 'numbercolumn',
  258. width: 110,
  259. renderer : function(v, m, r) {
  260. return saas.util.BaseUtil.numberFormat(v, 6, true);
  261. },
  262. },{
  263. text: '已开工单数',
  264. dataIndex: 'sd_ymaqty',
  265. xtype: 'numbercolumn',
  266. width: 110,
  267. renderer : function(v, m, r) {
  268. return saas.util.BaseUtil.numberFormat(v, 6, true);
  269. },
  270. },{
  271. text: '订单冲减工单数',
  272. dataIndex: 'sd_maqty',
  273. xtype: 'numbercolumn',
  274. width: 140,
  275. renderer : function(v, m, r) {
  276. return saas.util.BaseUtil.numberFormat(v, 6, true);
  277. },
  278. }, {
  279. text: '交货日期',
  280. dataIndex: 'sd_delivery',
  281. xtype: 'datecolumn',
  282. width: 110
  283. },{
  284. text: '业务员',
  285. align: 'center',
  286. dataIndex: 'sf_seller',
  287. width: 80
  288. },{
  289. text: '物料编号',
  290. dataIndex: 'sd_prodcode',
  291. width: 200
  292. },{
  293. text: '厂家/品牌',
  294. dataIndex: 'pr_brand',
  295. width: 200
  296. },{
  297. text: '备注',
  298. dataIndex: 'sd_remark',
  299. width: 250
  300. }],
  301. relativeColumn: [{
  302. text: '明细id',
  303. dataIndex: 'sd_id',
  304. hidden:true,
  305. xtype: 'numbercolumn'
  306. },{
  307. text: 'id',
  308. dataIndex: 'sf_id',
  309. hidden:true,
  310. xtype: 'numbercolumn'
  311. }, {
  312. text: '备货单号',
  313. dataIndex: 'sf_code',
  314. width: 150
  315. }, {
  316. text: '单据日期',
  317. dataIndex: 'sf_date',
  318. xtype: 'datecolumn',
  319. width: 110
  320. }, {
  321. text: '客户名称',
  322. dataIndex: 'sd_custname',
  323. width: 200
  324. },{
  325. text: '序号',
  326. dataIndex: 'sd_detno',
  327. width: 60
  328. },{
  329. text: '物料名称',
  330. dataIndex: 'pr_detail',
  331. width: 200
  332. },{
  333. text: '型号',
  334. dataIndex: 'pr_orispeccode',
  335. width: 200,
  336. renderer: saas.util.RenderUtil['renderer_prod']
  337. },{
  338. text: '已核销数量',
  339. dataIndex: 'sd_yqty',
  340. xtype: 'numbercolumn',
  341. width: 110,
  342. renderer : function(v, m, r) {
  343. return saas.util.BaseUtil.numberFormat(v, 6, true);
  344. },
  345. },{
  346. text: '备货数',
  347. dataIndex: 'sd_qty',
  348. xtype: 'numbercolumn',
  349. width: 110,
  350. renderer : function(v, m, r) {
  351. return saas.util.BaseUtil.numberFormat(v, 6, true);
  352. },
  353. },{
  354. text: '已开工单数',
  355. dataIndex: 'sd_ymaqty',
  356. xtype: 'numbercolumn',
  357. width: 110,
  358. renderer : function(v, m, r) {
  359. return saas.util.BaseUtil.numberFormat(v, 6, true);
  360. },
  361. },{
  362. text: '订单冲减工单数',
  363. dataIndex: 'sd_maqty',
  364. xtype: 'numbercolumn',
  365. width: 140,
  366. renderer : function(v, m, r) {
  367. return saas.util.BaseUtil.numberFormat(v, 6, true);
  368. },
  369. }, {
  370. text: '交货日期',
  371. dataIndex: 'sd_delivery',
  372. xtype: 'datecolumn',
  373. width: 110
  374. },{
  375. text: '业务员',
  376. align: 'center',
  377. dataIndex: 'sf_seller',
  378. width: 80
  379. },{
  380. text: '物料编号',
  381. dataIndex: 'sd_prodcode',
  382. width: 200
  383. },{
  384. text: '厂家/品牌',
  385. dataIndex: 'pr_brand',
  386. width: 200
  387. },{
  388. text: '备注',
  389. dataIndex: 'sd_remark',
  390. width: 250
  391. }]
  392. }
  393. });
  394. me.callParent(arguments);
  395. },
  396. });