QueryPanel_1.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. Ext.define('make.view.make.makeBase.QueryPanel_1', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'make-makebase-querypanel-1',
  4. controller: 'make-makebase-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:true,//单独显示反审核按钮
  19. openEnable:false, //显示开启 针对已取消列表
  20. configurable: true, // 允许列设置
  21. }
  22. },
  23. viewName: 'make-makebase-querypanel',
  24. caller: 'MakeBase',
  25. //importUploadPath: '/api/purchse/makereturn/saveToFormal',
  26. initComponent: function () {
  27. var me = this;
  28. Ext.apply(this, {
  29. queryFormItems: [{
  30. xtype: 'condatefield',
  31. name: 'make.createTime',
  32. fieldLabel: '日期',
  33. columnWidth: 0.4,
  34. minWidth:430,
  35. value: '7',
  36. operation: 'between',
  37. },{
  38. xtype: 'multiqueryField',
  39. columnWidth: 0.4,
  40. name: 'multi_query',
  41. querys: {
  42. "Prod": {"field": "ma_prodcode", "dbfinds": [{//物料
  43. from: 'pr_code',
  44. to: 'ma_prodcode'
  45. },{
  46. from: 'pr_detail',
  47. to: 'pr_detail'
  48. }]},
  49. "MakeCode": {"field": "ma_code" ,"desc": "制造单号"},
  50. "BillCode": {"field": "ma_salecode" ,"desc": "订单号"},
  51. "Cust": {"field": "ma_custname", "dbfinds": [{
  52. from: 'cu_name',
  53. to: 'ma_custname'
  54. }]},
  55. "Emp":{"field": "make.creatorName", "dbfinds": [{
  56. from: 'em_name',
  57. to: 'make.creatorName'
  58. }]},
  59. },
  60. setShowDetail: function(v){
  61. this.showDetail = false;
  62. }
  63. },{
  64. xtype: 'checkbox',
  65. boxLabel: '展开明细',
  66. name:'showDetail',
  67. showDetail: true,
  68. columnWidth: 0.1,
  69. minWidth:75,
  70. margin: '0 0 0 8',
  71. getCondition: function (value) {
  72. return '1=1';
  73. },
  74. listeners:{
  75. change:function(t,n,o){
  76. if(n != o){
  77. var grid = t.ownerCt.ownerCt.down('core-query-querygridpanel');
  78. /*groupField:'ma_code',
  79. groupHeaderTpl: Ext.create('Ext.XTemplate',
  80. '<div class="groupHeaderTpl" style="margin:0px 0px 0px 120px">',
  81. '<span style="width:280px">制造单号:{[values.rows[0].data.ma_code]}</span>',
  82. '<span style="width:140px">销售单号:{[values.rows[0].data.sa_currency]}</span>',
  83. '<span style="width:140px">客户名称:{[values.rows[0].data.sa_currency]}</span>',
  84. '<span style="width:140px">交货日期:{[values.rows[0].data.sa_currency]}</span>',
  85. '<span style="width:140px">产品编号:{[values.rows[0].data.sa_currency]}</span>',
  86. '<span style="width:140px">产品名称:{[values.rows[0].data.sa_currency]}</span>',
  87. '<span style="width:140px">产品规格:{[values.rows[0].data.sa_currency]}</span>',
  88. '<span style="width:140px">数量:{[values.rows[0].data.sa_currency]}</span>',
  89. '<span style="width:140px">已完工数:{[values.rows[0].data.sa_currency]}</span>',
  90. '</div>'
  91. ),*/
  92. grid.store.load();
  93. }
  94. }
  95. }
  96. }],
  97. moreQueryFormItems: [{
  98. xtype: 'saledetailDbfindTrigger',
  99. name: 'ma_salecode',
  100. fieldLabel: '订单编号'
  101. },{
  102. xtype: "customerDbfindTrigger",
  103. name: "ma_custname",
  104. fieldLabel: "客户名称",
  105. },{
  106. xtype: 'condatefield',
  107. name: 'ma_delivery',
  108. fieldLabel: '交货日期',
  109. value:7,
  110. columnWidth: 1
  111. },{
  112. xtype: 'productDbfindTrigger',
  113. name: 'ma_prodcode',
  114. fieldLabel: '物料编号'
  115. },{
  116. xtype: 'textfield',
  117. name: 'pr_detail',
  118. fieldLabel: '产品名称',
  119. readOnly: true,
  120. }, {
  121. xtype: 'textfield',
  122. name: 'pr_orispeccode',
  123. fieldLabel: '产品型号',
  124. readOnly: true,
  125. }, {
  126. xtype: "remotecombo",
  127. name: "pr_brand",
  128. fieldLabel: "厂家/品牌",
  129. storeUrl: '/api/document/productbrand/getCombo',
  130. editable: false,
  131. hiddenBtn:true
  132. },{
  133. xtype: "remotecombo",
  134. name: "ma_kind",
  135. fieldLabel: "制造类型",
  136. storeUrl:'/api/make/kind/list/make',
  137. valueField:'mk_name',
  138. displayField: 'mk_name',
  139. editable: false,
  140. hiddenBtn:true
  141. },{
  142. xtype: 'remotecombo',
  143. name: "ma_wcname",
  144. fieldLabel: "工作中心",
  145. storeUrl: '/api/document/workcenter/getCombo',
  146. editable: false,
  147. hiddenBtn:true
  148. },{
  149. xtype: 'combobox',
  150. name: 'ma_statuscode',
  151. fieldLabel: '审核状态',
  152. queryMode: 'local',
  153. displayField: 'ma_status',
  154. valueField: 'ma_statuscode',
  155. emptyText :'全部',
  156. editable:false,
  157. store: Ext.create('Ext.data.ArrayStore', {
  158. fields: ['ma_statuscode', 'ma_status'],
  159. data: [
  160. ["ALL", "全部"],
  161. ["AUDITED", "已审核"],
  162. ["UNAUDITED", "未审核"]
  163. ]
  164. }),
  165. getCondition: function(value) {
  166. if(value == 'ALL') {
  167. return '1=1';
  168. }else {
  169. return 'ma_statuscode=\'' + value + '\'';
  170. }
  171. }
  172. }, {
  173. xtype: 'employeeDbfindTrigger',
  174. name: 'creatorName',
  175. fieldLabel: '录入人',
  176. emptyText:'请输入账户名称或姓名',
  177. getCondition: function(value) {
  178. if(!value) {
  179. return '1=1';
  180. }else {
  181. return 'make.creatorName like\'%' + value + '%\'';
  182. }
  183. }
  184. },{
  185. xtype: 'condatefield',
  186. name: 'ma_planbegindate',
  187. fieldLabel: '计划开工日期',
  188. value:7,
  189. columnWidth: 1
  190. },{
  191. xtype: 'condatefield',
  192. name: 'ma_planenddate',
  193. fieldLabel: '计划完工日期',
  194. value:7,
  195. columnWidth: 1
  196. },{
  197. xtype: 'condatefield',
  198. name: 'make.createTime',
  199. fieldLabel: '录入日期',
  200. value:7,
  201. columnWidth: 1
  202. }, {
  203. xtype: 'employeeDbfindTrigger',
  204. name: 'ma_auditman',
  205. fieldLabel: '审核人',
  206. emptyText:'请输入账户名称或姓名',
  207. }],
  208. queryGridConfig: {
  209. idField: 'ma_id',
  210. codeField: 'ma_code',
  211. mainIdField:'ma_id',
  212. detailIdField:'mm_id',
  213. addTitle: '制造单',
  214. addXtype: 'make-makebase-formpanel',
  215. baseVastUrl: '/api/make/make/',
  216. caller: 'MakeBase',
  217. defaultCondition:me.defaultCondition,
  218. toolBtns: [{
  219. text: '转领料',
  220. xtype: 'button',
  221. handler: 'onPick',
  222. },{
  223. text: '结案',
  224. xtype: 'button',
  225. handler: 'onEnd',
  226. }],
  227. baseColumn: [{
  228. text: 'id',
  229. dataIndex: 'ma_id',
  230. hidden: true,
  231. xtype: 'numbercolumn'
  232. }, {
  233. text: '制造单号',
  234. dataIndex: 'ma_code',
  235. width: 150
  236. }, {
  237. text: '单据日期',
  238. dataIndex: 'createTime',
  239. xtype: 'datecolumn',
  240. width: 110
  241. }, {
  242. text: '销售单号',
  243. dataIndex: 'ma_salecode',
  244. width: 0
  245. }, {
  246. text: '客户名称',
  247. dataIndex: 'ma_custname',
  248. width: 150
  249. }, {
  250. text: '交货日期',
  251. align: 'center',
  252. dataIndex: 'ma_delivery',
  253. width: 110,
  254. xtype:'datecolumn'
  255. },{
  256. text: '产品编号',
  257. dataIndex: 'ma_prodcode',
  258. width: 150
  259. },{
  260. text: '产品名称',
  261. dataIndex: 'ma_prdetail',
  262. width: 150
  263. },{
  264. text: '产品型号',
  265. dataIndex: 'ma_prorispeccode',
  266. width: 150,
  267. renderer : saas.util.RenderUtil['renderer_makeprod']
  268. },{
  269. text: '单位',
  270. align: 'center',
  271. dataIndex: 'ma_prunit',
  272. width: 80
  273. },{
  274. text: '数量',
  275. align: 'center',
  276. dataIndex: 'ma_qty',
  277. xtype: 'numbercolumn',
  278. width: 110,
  279. renderer : function(v, m, r) {
  280. return saas.util.BaseUtil.numberFormat(v, 6, true);
  281. },
  282. },{
  283. text: '已完工数',
  284. align: 'center',
  285. dataIndex: 'ma_madeqty',
  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. align: 'center',
  294. dataIndex: 'ma_setqty',
  295. xtype: 'numbercolumn',
  296. width: 110,
  297. renderer : function(v, m, r) {
  298. return saas.util.BaseUtil.numberFormat(v, 0, true);
  299. },
  300. },{
  301. text: '可完工数',
  302. align: 'center',
  303. dataIndex: 'ma_canmadeqty',
  304. xtype: 'numbercolumn',
  305. width: 110,
  306. renderer : function(v, m, r) {
  307. return saas.util.BaseUtil.numberFormat(v, 6, true);
  308. },
  309. },{
  310. text: '制造类型',
  311. dataIndex: 'ma_kind',
  312. width: 100,
  313. },{
  314. text: '工作中心',
  315. dataIndex: 'ma_wcname',
  316. width: 100,
  317. },{
  318. text: '审核状态',
  319. dataIndex: 'ma_status',
  320. align: 'center',
  321. width: 100,
  322. },{
  323. text: '领料状态',
  324. dataIndex: 'ma_getstatus',
  325. align: 'center',
  326. width: 100,
  327. },{
  328. text: '完工状态',
  329. dataIndex: 'ma_finishstatus',
  330. align: 'center',
  331. width: 100,
  332. },{
  333. text: '制单人',
  334. dataIndex: 'creatorName',
  335. align: 'center',
  336. width: 100,
  337. },{
  338. text: '计划开工日期',
  339. dataIndex: 'ma_planbegindate',
  340. width: 130,
  341. xtype:'datecolumn'
  342. },{
  343. text: '计划完工日期',
  344. dataIndex: 'ma_planenddate',
  345. width: 130,
  346. xtype:'datecolumn'
  347. },{
  348. text: '实际开工日期',
  349. dataIndex: 'ma_actbegindate',
  350. width: 130,
  351. xtype:'datecolumn'
  352. },{
  353. text: '实际完工日期',
  354. dataIndex: 'ma_actenddate',
  355. width: 130,
  356. xtype:'datecolumn'
  357. },{
  358. text: '结案日期',
  359. dataIndex: 'ma_enddate',
  360. width: 130,
  361. xtype:'datecolumn'
  362. },{
  363. text: '备注',
  364. dataIndex: 'ma_remark',
  365. width: 100
  366. }],
  367. relativeColumn: [{
  368. text: 'id',
  369. dataIndex: 'id',
  370. hidden: true,
  371. xtype: 'numbercolumn'
  372. },{
  373. text: '本次数量',
  374. align: 'center',
  375. dataIndex: 'mm_thisqty',
  376. xtype: 'widgetcolumn',
  377. width: 110,
  378. widget: {
  379. xtype: "numberfield",
  380. cls:'widget-number',
  381. bind: '{record.mm_thisqty}',
  382. decimalPrecision: 6,
  383. minValue: 0,
  384. listeners:{
  385. blur: function(f ,event, e){
  386. var record = f.lookupViewModel().data.record,
  387. maxVal,nowVal;
  388. if(record){
  389. if(!Ext.isEmpty(record.modified['mm_thisqty'])){ //若存在修改
  390. maxVal = record.modified['mm_thisqty'];
  391. nowVal = f.value;
  392. if(Ext.isEmpty(nowVal)){
  393. record.set('mm_thisqty', maxVal)
  394. }else if(nowVal>maxVal){
  395. record.set('mm_thisqty', maxVal)
  396. saas.util.BaseUtil.showErrorToast('请不要输入超过最大数量' + maxVal + "的值!");
  397. }
  398. }
  399. }
  400. }
  401. }
  402. }
  403. },{
  404. text: '制造单号',
  405. dataIndex: 'ma_code',
  406. width: 150
  407. }, {
  408. text: '单据日期',
  409. dataIndex: 'createTime',
  410. xtype: 'datecolumn',
  411. width: 110
  412. },{
  413. text: '工单序号',
  414. dataIndex: 'mm_detno',
  415. align: 'center',
  416. width: 80
  417. },{
  418. text: '物料编号',
  419. dataIndex: 'mm_prodcode',
  420. width: 150
  421. },{
  422. text: '物料名称',
  423. dataIndex: 'pr_detail',
  424. width: 150
  425. },{
  426. text: '物料规格',
  427. dataIndex: 'pr_desc',
  428. width: 150
  429. },{
  430. text: '单位',
  431. align: 'center',
  432. dataIndex: 'pr_unit',
  433. width: 80
  434. },{
  435. text: '单位用量',
  436. align: 'center',
  437. dataIndex: 'mm_oneuseqty',
  438. width: 80
  439. },{
  440. text: '需求数',
  441. align: 'center',
  442. dataIndex: 'mm_qty',
  443. xtype: 'numbercolumn',
  444. width: 110,
  445. renderer : function(v, m, r) {
  446. return saas.util.BaseUtil.numberFormat(v, 6, true);
  447. },
  448. },{
  449. text: '已领数',
  450. align: 'center',
  451. dataIndex: 'mm_havegetqty',
  452. xtype: 'numbercolumn',
  453. width: 110,
  454. renderer : function(v, m, r) {
  455. return saas.util.BaseUtil.numberFormat(v, 6, true);
  456. },
  457. },{
  458. text: '已转领数',
  459. align: 'center',
  460. dataIndex: 'mm_turngetqty',
  461. xtype: 'numbercolumn',
  462. width: 110,
  463. renderer : function(v, m, r) {
  464. return saas.util.BaseUtil.numberFormat(v, 6, true);
  465. },
  466. },{
  467. text: '未领数',
  468. align: 'center',
  469. dataIndex: 'mm_restgetqty',
  470. xtype: 'numbercolumn',
  471. width: 110,
  472. renderer : function(v, m, r) {
  473. v = r.get('mm_qty') + (r.get('mm_scrapqty')||0) - (r.get('mm_havegetqty')||0)-(r.get('mm_turngetqty')||0);
  474. return saas.util.BaseUtil.numberFormat(v, 6, true);
  475. }
  476. },{
  477. text: '制程不良数',
  478. align: 'center',
  479. dataIndex: 'mm_returnmqty',
  480. xtype: 'numbercolumn',
  481. width: 110,
  482. renderer : function(v, m, r) {
  483. return saas.util.BaseUtil.numberFormat(v, 6, true);
  484. },
  485. },{
  486. text: '报废数',
  487. align: 'center',
  488. dataIndex: 'mm_turnscrapqty',
  489. xtype: 'numbercolumn',
  490. width: 110,
  491. renderer : function(v, m, r) {
  492. return saas.util.BaseUtil.numberFormat(v, 6, true);
  493. },
  494. },{
  495. text: '备注',
  496. dataIndex: 'ma_remark',
  497. width: 100
  498. }]
  499. }
  500. });
  501. this.callParent(arguments);
  502. },
  503. });