QueryPanel_1.js 20 KB

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