QueryPanel3.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. Ext.define('make.view.osmake.osMakeCheckIn.QueryPanel_3', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'osmake-osmakecheckin-querypanel-3',
  4. controller: 'osmake-osmakecheckin-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:false, //显示开启 针对已取消列表
  21. configurable: true, // 允许列设置
  22. }
  23. },
  24. viewName: 'osmake-osmakecheckin-querypanel',
  25. caller: 'OsMakeIn',
  26. //importUploadPath: '/api/osmake/osmakecheckin/saveToFormal',
  27. initComponent: function () {
  28. var me = this;
  29. Ext.apply(me, {
  30. queryFormItems: [ {
  31. xtype: 'condatefield',
  32. name: 'pi_date',
  33. fieldLabel: '日期',
  34. columnWidth: 0.5,
  35. value: '7',
  36. operation: 'between',
  37. },{
  38. xtype: 'multiqueryField',
  39. columnWidth: 0.4,
  40. name: 'multi_query',
  41. querys: {
  42. "Vend":{"field": "pi_vendname", "dbfinds": [{//仓库
  43. from: 've_name',
  44. to: 'pi_vendname'
  45. }]},
  46. "BillCode": {"field": "pi_inoutno" ,"desc": "验收单号"},
  47. "MakeCode": {"field": "prodiodetail.pd_ordercode" ,"desc": "外协单号"},
  48. "Prod": {"field": "pr_code", "dbfinds": [{//物料
  49. from: 'pr_code',
  50. to: 'pr_code'
  51. },{
  52. from: 'pr_detail',
  53. to: 'pr_detail'
  54. }]},
  55. "Emp":{"field": "prodinout.creatorName", "dbfinds": [{
  56. from: 'em_name',
  57. to: 'prodinout.creatorName'
  58. }]},
  59. },
  60. setShowDetail: function(v){
  61. this.showDetail = (v == 'Prod' ||v=='MakeCode');
  62. },
  63. }],
  64. moreQueryFormItems: [{
  65. xtype: 'condatefield',
  66. name: 'pi_date',
  67. fieldLabel: '单据日期',
  68. columnWidth: 1
  69. },{
  70. xtype: 'vendorDbfindTrigger',
  71. name: 'pi_vendname',
  72. fieldLabel: '外协厂商'
  73. },{
  74. xtype: 'combobox',
  75. name: 'pi_currency',
  76. fieldLabel: '币别',
  77. queryMode: 'local',
  78. displayField: 'pi_currency',
  79. valueField: 'pi_currency',
  80. emptyText :'',
  81. editable:false,
  82. store: Ext.create('Ext.data.ArrayStore', {
  83. fields: ['pi_currency', 'pi_currency'],
  84. data: [
  85. ["RMB", "RMB"],
  86. ["USD", "USD"],
  87. ["HKD", "HKD"]
  88. ]
  89. }),
  90. getCondition: function(value) {
  91. if(!value) {
  92. return '1=1';
  93. }else {
  94. return 'pi_currency=\'' + value + '\'';
  95. }
  96. }
  97. },{
  98. xtype: 'warehouseDbfindTrigger',
  99. name: 'pi_whname',
  100. fieldLabel: '仓库'
  101. },{
  102. xtype: 'productDbfindTrigger',
  103. name: 'prodiodetail.pd_prodcode',
  104. showDetail: true,
  105. fieldLabel: '物料编号'
  106. },{
  107. xtype: 'textfield',
  108. name: 'pr_detail',
  109. fieldLabel: '产品名称',
  110. readOnly: true,
  111. }, {
  112. xtype: 'textfield',
  113. name: 'pr_orispeccode',
  114. fieldLabel: '产品型号',
  115. readOnly: true,
  116. }, {
  117. editable: false,
  118. xtype: "remotecombo",
  119. storeUrl: '/api/document/productbrand/getCombo',
  120. name: "pr_brand",
  121. fieldLabel: "厂家/品牌",
  122. hiddenBtn:true
  123. },{
  124. xtype: 'combobox',
  125. name: 'pi_statuscode',
  126. fieldLabel: '审核状态',
  127. queryMode: 'local',
  128. displayField: 'pi_status',
  129. valueField: 'pi_statuscode',
  130. emptyText :'全部',
  131. editable:false,
  132. store: Ext.create('Ext.data.ArrayStore', {
  133. fields: ['pi_statuscode', 'pi_status'],
  134. data: [
  135. ["ALL", "全部"],
  136. ["AUDITED", "已审核"],
  137. ["UNAUDITED", "未审核"]
  138. ]
  139. }),
  140. getCondition: function(value) {
  141. if(value == 'ALL') {
  142. return '1=1';
  143. }else {
  144. return 'pi_statuscode=\'' + value + '\'';
  145. }
  146. }
  147. }, {
  148. xtype: 'employeeDbfindTrigger',
  149. name: 'creatorName',
  150. fieldLabel: '录入人',
  151. emptyText:'请输入账户名称或姓名',
  152. getCondition: function(value) {
  153. if(!value) {
  154. return '1=1';
  155. }else {
  156. return 'prodinout.creatorName like\'%' + value + '%\'';
  157. }
  158. }
  159. }, {
  160. xtype: 'employeeDbfindTrigger',
  161. name: 'pi_auditman',
  162. fieldLabel: '审核人',
  163. emptyText:'请输入账户名称或姓名',
  164. }],
  165. queryGridConfig: {
  166. idField: 'id',
  167. codeField: 'pi_inoutno',
  168. mainIdField:'_id',
  169. detailIdField:'pd_id',
  170. addTitle: me.addTitle,
  171. addXtype: me.addXtype,
  172. defaultCondition: me.defaultCondition,
  173. baseVastUrl: me.baseVastUrl,
  174. groupField: 'vendname_currency',
  175. groupHeaderTpl: Ext.create('Ext.XTemplate',
  176. '<div class="groupHeaderTpl" style="margin:0px 0px 0px 120px">',
  177. '<span style="width:280px">供应商:{[values.rows[0].data.pi_vendname]}</span>',
  178. '<span style="width:140px">币种:{[values.rows[0].data.pi_currency]}</span>',
  179. '</div>'
  180. ),
  181. openTab:function(record,codeValue,idValue){
  182. if(record.get('pi_class')=='OSMAKEIN'){
  183. openXtype = 'osmake-osmakecheckin-formpanel';
  184. addTitle = '外协验收';
  185. }else{
  186. openXtype = 'osmake-osmakecheckreturn-formpanel';
  187. addTitle = '外协验退';
  188. }
  189. id = openXtype + '-' + idValue;
  190. saas.util.BaseUtil.openTab(openXtype, addTitle+"("+codeValue+")", id, {
  191. initId: idValue
  192. });
  193. },
  194. onGroupClick: function(view, group, idx, e){
  195. },
  196. caller: 'OsMakeIn',
  197. toolBtns: [{
  198. xtype: 'button',
  199. text: '对账',
  200. handler: 'turnApCheck'
  201. }],
  202. baseColumn: [{
  203. text: 'id',
  204. dataIndex: 'id',
  205. hidden: true,
  206. xtype: 'numbercolumn'
  207. }, {
  208. text: '入库单号',
  209. dataIndex: 'pi_inoutno',
  210. width: 150
  211. },{
  212. text: '供应商币别',
  213. dataIndex: 'vendname_currency',
  214. hidden:true
  215. }, {
  216. text: '单据类型',
  217. dataIndex: 'pi_class',
  218. hidden: true
  219. }, {
  220. text: '单据日期',
  221. dataIndex: 'pi_date',
  222. xtype: 'datecolumn',
  223. width: 110
  224. }, {
  225. text: '供应商名称',
  226. dataIndex: 'pi_vendname',
  227. width: 200
  228. }, {
  229. text: '金额(元)',
  230. xtype: 'numbercolumn',
  231. dataIndex: 'pi_nettotal',
  232. width: 110,
  233. renderer: function(v, m, r) {
  234. let inqty=r.get('pd_inqty');
  235. inqty= inqty==null ? 0: inqty;
  236. if(inqty>0){
  237. return saas.util.BaseUtil.numberFixFormat(v,2, true);
  238. }else{
  239. return saas.util.BaseUtil.numberFixFormat((0-v),2, true);
  240. }
  241. }
  242. }, {
  243. text: '价税合计(元)',
  244. xtype: 'numbercolumn',
  245. dataIndex: 'pi_total',
  246. width: 110,
  247. renderer: function(v, m, r) {
  248. let inqty=r.get('pd_inqty');
  249. inqty= inqty==null ? 0: inqty;
  250. if(inqty>0){
  251. return saas.util.BaseUtil.numberFixFormat(v,2, true);
  252. }else{
  253. return saas.util.BaseUtil.numberFixFormat((0-v),2, true);
  254. }
  255. }
  256. }, {
  257. text: '币种',
  258. dataIndex: 'pi_currency',
  259. align: 'center',
  260. width: 65
  261. }, {
  262. text: '审核状态',
  263. align: 'center',
  264. dataIndex: 'pi_status',
  265. width: 80
  266. }, {
  267. text: '付款状态',
  268. align: 'center',
  269. dataIndex: 'pi_prstatus',
  270. width: 80
  271. }, {
  272. text: '关联委协工单号',
  273. dataIndex: 'pd_ordercode',
  274. width: 150
  275. }, {
  276. text: '备注',
  277. dataIndex: 'pi_remark',
  278. width: 250
  279. }],
  280. relativeColumn: [{
  281. text: 'id',
  282. dataIndex: 'id',
  283. xtype: 'numbercolumn',
  284. hidden: true
  285. },{
  286. text: '供应商币别',
  287. dataIndex: 'vendname_currency',
  288. hidden:true
  289. },{
  290. text: 'pd_id',
  291. dataIndex: 'pd_id',
  292. xtype: 'numbercolumn',
  293. hidden: true
  294. }, {
  295. text: '入库单号',
  296. dataIndex: 'pi_inoutno',
  297. width: 150,
  298. exportStyle:{
  299. width: 150
  300. }
  301. }, {
  302. text: '单据日期',
  303. dataIndex: 'pi_date',
  304. xtype: 'datecolumn',
  305. hidden:true,
  306. exportStyle:{
  307. width: 110
  308. }
  309. }, {
  310. text: '供应商名称',
  311. dataIndex: 'pi_vendname',
  312. hidden:true,
  313. exportStyle:{
  314. width: 200
  315. }
  316. },{
  317. text: '币种',
  318. dataIndex: 'pi_currency',
  319. align: 'center',
  320. hidden:true,
  321. exportStyle:{
  322. width: 65
  323. }
  324. },{
  325. text: '序号',
  326. dataIndex: 'pd_pdno',
  327. xtype: 'numbercolumn',
  328. align:'center',
  329. width: 60,
  330. renderer : function(v, m, r) {
  331. return saas.util.BaseUtil.numberFormat(v, 0, false);
  332. },
  333. }, {
  334. text: '物料名称',
  335. dataIndex: 'pr_detail',
  336. width: 150
  337. }, {
  338. text: '型号',
  339. dataIndex: 'pr_orispeccode',
  340. width: 200,
  341. renderer: saas.util.RenderUtil['renderer_prod']
  342. }, {
  343. text: '入库数',
  344. dataIndex: 'pd_inqty',
  345. xtype: 'numbercolumn',
  346. width: 110,
  347. renderer: function(v, m, r) {
  348. let outqty=r.get('pd_outqty'),
  349. inqty=r.get('pd_inqty');
  350. inqty= inqty==null ? 0: inqty;
  351. outqty= outqty==null ? 0: outqty;
  352. return saas.util.BaseUtil.numberFormat((inqty-outqty), 6, true);
  353. }
  354. }, {
  355. text: '类型',
  356. dataIndex: 'pi_class',
  357. width: 110,
  358. renderer: function(v) {
  359. if(v=="OSMAKEIN"){
  360. return "外协验收";
  361. }else if(v=="OSMAKEINBACK"){
  362. return "外协验退";
  363. }else if(v=="ESTIMATE"){
  364. return "应付暂估";
  365. }else{
  366. return v;
  367. }
  368. }
  369. }, {
  370. text: '物料编号',
  371. dataIndex: 'pr_code',
  372. width: 150
  373. }, {
  374. text: '厂家/品牌',
  375. dataIndex: 'pr_brand',
  376. width: 100
  377. }, {
  378. text: '规格',
  379. dataIndex: 'pr_spec',
  380. width: 200
  381. }, {
  382. text: '不含税单价(元)',
  383. dataIndex: 'pd_netprice',
  384. xtype: 'numbercolumn',
  385. renderer: function(v, m, r) {
  386. return saas.util.BaseUtil.numberFormat(v, 8, true);
  387. },
  388. width: 110
  389. }, {
  390. text: '含税单价(元)',
  391. dataIndex: 'pd_orderprice',
  392. xtype: 'numbercolumn',
  393. renderer: function(v, m, r) {
  394. return saas.util.BaseUtil.numberFormat(v, 8, true);
  395. },
  396. width: 110
  397. }, {
  398. text: '不含税金额(元)',
  399. dataIndex: 'pd_nettotal',
  400. xtype: 'numbercolumn',
  401. width: 110,
  402. renderer: function(v, m, r) {
  403. let inqty=r.get('pd_inqty');
  404. inqty= inqty==null ? 0: inqty;
  405. if(inqty>0){
  406. return saas.util.BaseUtil.numberFixFormat(v,2, true);
  407. }else{
  408. return saas.util.BaseUtil.numberFixFormat((0-v),2, true);
  409. }
  410. },
  411. }, {
  412. text: '关联委协工单号',
  413. dataIndex: 'pd_ordercode',
  414. width: 150
  415. }, {
  416. text: '备注',
  417. dataIndex: 'pd_remark',
  418. width: 250
  419. }]
  420. }
  421. });
  422. this.callParent(arguments);
  423. },
  424. getQueryMode: function () {
  425. return 'DETAIL';
  426. }
  427. });