QueryPanel2.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. Ext.define('make.view.stock.osMakeCheckIn.QueryPanel_2', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'stock-osmakecheckin-querypanel-2',
  4. controller: 'stock-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:true,//单独显示反审核按钮
  19. cancelEnable:false, //单独显示取消
  20. openEnable:false, //显示开启 针对已取消列表
  21. configurable: true, // 允许列设置
  22. }
  23. },
  24. viewName: 'stock-osmakecheckin-querypanel',
  25. caller: 'StockOSMakeCheckIn',
  26. //importUploadPath: '/api/osmake/osmakeReturn/saveToFormal',
  27. initComponent: function () {
  28. var me = this;
  29. Ext.apply(this, {
  30. queryFormItems: [ {
  31. xtype: 'condatefield',
  32. name: 'pi_date',
  33. fieldLabel: '日期',
  34. columnWidth: 0.5,
  35. operation: 'between',
  36. },{
  37. xtype: 'multiqueryField',
  38. columnWidth: 0.4,
  39. name: 'multi_query',
  40. querys: {
  41. "Vend":{"field": "pi_vendname", "dbfinds": [{//仓库
  42. from: 've_name',
  43. to: 'pi_vendname'
  44. }]},
  45. "BillCode": {"field": "pi_inoutno" ,"desc": "验收单号"},
  46. "MakeCode": {"field": "ma_code" ,"desc": "外协单号"},
  47. "Prod": {"field": "pr_code", "dbfinds": [{//物料
  48. from: 'pr_code',
  49. to: 'pr_code'
  50. },{
  51. from: 'pr_detail',
  52. to: 'pr_detail'
  53. }]},
  54. "Emp":{"field": "prodinout.creatorName", "dbfinds": [{
  55. from: 'em_name',
  56. to: 'prodinout.creatorName'
  57. }]},
  58. }
  59. }],
  60. moreQueryFormItems: [{
  61. xtype: 'condatefield',
  62. name: 'pi_date',
  63. fieldLabel: '入库日期',
  64. columnWidth: 1
  65. },{
  66. xtype: 'vendorDbfindTrigger',
  67. name: 'pi_vendname',
  68. fieldLabel: '供应商名称'
  69. },{
  70. xtype: 'warehouseDbfindTrigger',
  71. name: 'pi_whname',
  72. fieldLabel: '仓库'
  73. },{
  74. xtype: 'productDbfindTrigger',
  75. name: 'pd_prodcode',
  76. fieldLabel: '物料编号'
  77. },{
  78. xtype: 'textfield',
  79. name: 'pr_detail',
  80. fieldLabel: '产品名称',
  81. readOnly: true,
  82. }, {
  83. xtype: 'textfield',
  84. name: 'pr_orispeccode',
  85. fieldLabel: '产品型号',
  86. readOnly: true,
  87. }, {
  88. editable: false,
  89. xtype: "remotecombo",
  90. storeUrl: '/api/document/productbrand/getCombo',
  91. name: "pr_brand",
  92. fieldLabel: "厂家/品牌",
  93. showDetail: true,
  94. addHandler: function (b) {
  95. var form = this.ownerCmp.ownerCt;
  96. this.dialog = form.add({
  97. xtype: 'document-productbrand-window',
  98. bind: {
  99. title: '新增物料厂家/品牌'
  100. },
  101. dataKind: 'productbrand',
  102. _parent: form,
  103. _combo: this.ownerCmp,
  104. record: null,
  105. session: true
  106. });
  107. this.dialog.show();
  108. },
  109. editHandler:function(btn,type){
  110. saas.util.BaseUtil.openTab('document-productbrand-datalist', '物料厂家/品牌','maintab--document-productbrand-datalist');
  111. var combo = btn.ownerCt.up('remotecombo');
  112. if(combo){
  113. combo.collapse();
  114. }
  115. }
  116. },{
  117. xtype: 'combobox',
  118. name: 'pi_statuscode',
  119. fieldLabel: '审核状态',
  120. queryMode: 'local',
  121. displayField: 'pi_status',
  122. valueField: 'pi_statuscode',
  123. emptyText :'全部',
  124. editable:false,
  125. store: Ext.create('Ext.data.ArrayStore', {
  126. fields: ['pi_statuscode', 'pi_status'],
  127. data: [
  128. ["ALL", "全部"],
  129. ["AUDITED", "已审核"],
  130. ["UNAUDITED", "未审核"]
  131. ]
  132. }),
  133. getCondition: function(value) {
  134. if(value == 'ALL') {
  135. return '1=1';
  136. }else {
  137. return 'pi_statuscode=\'' + value + '\'';
  138. }
  139. }
  140. },{
  141. xtype: 'combobox',
  142. name: 'pi_currency',
  143. fieldLabel: '币别',
  144. queryMode: 'local',
  145. displayField: 'pi_currency',
  146. valueField: 'pi_currency',
  147. emptyText :'',
  148. editable:false,
  149. store: Ext.create('Ext.data.ArrayStore', {
  150. fields: ['pi_currency', 'pi_currency'],
  151. data: [
  152. ["RMB", "RMB"],
  153. ["USD", "USD"],
  154. ["HKD", "HKD"]
  155. ]
  156. }),
  157. getCondition: function(value) {
  158. if(!value) {
  159. return '1=1';
  160. }else {
  161. return 'pi_currency=\'' + value + '\'';
  162. }
  163. }
  164. }, {
  165. xtype: 'employeeDbfindTrigger',
  166. name: 'pi_buyername',
  167. fieldLabel: '采购员',
  168. emptyText:'输入人员编号或名称',
  169. }, {
  170. xtype: 'employeeDbfindTrigger',
  171. name: 'creatorName',
  172. fieldLabel: '录入人',
  173. emptyText:'请输入账户名称或姓名',
  174. getCondition: function(value) {
  175. if(!value) {
  176. return '1=1';
  177. }else {
  178. return 'prodinout.creatorName like\'%' + value + '%\'';
  179. }
  180. }
  181. },{
  182. xtype: 'condatefield',
  183. name: 'prodinout.createTime',
  184. fieldLabel: '录入日期',
  185. columnWidth: 1
  186. }, {
  187. xtype: 'employeeDbfindTrigger',
  188. name: 'pi_auditman',
  189. fieldLabel: '审核人',
  190. emptyText:'请输入账户名称或姓名',
  191. }],
  192. queryGridConfig: {
  193. idField: 'id',
  194. codeField: 'pi_inoutno',
  195. mainIdField:'_id',
  196. detailIdField:'pd_id',
  197. addTitle: me.addTitle,
  198. addXtype: me.addXtype,
  199. defaultCondition: me.defaultCondition,
  200. baseVastUrl: me.baseVastUrl,
  201. caller: 'OSMakeCheckIn',
  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: 'pi_date',
  214. xtype: 'datecolumn',
  215. width: 110
  216. }, {
  217. text: '外协厂商',
  218. dataIndex: 'pi_inoutno',
  219. width: 200
  220. }, {
  221. text: '价税合计(元)',
  222. xtype: 'numbercolumn',
  223. dataIndex: 'pi_total',
  224. width: 110,
  225. renderer: function(v, m, r) {
  226. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  227. }
  228. }, {
  229. text: '金额(元)',
  230. xtype: 'numbercolumn',
  231. dataIndex: 'pi_nettotal',
  232. width: 110,
  233. renderer: function(v, m, r) {
  234. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  235. }
  236. }, {
  237. text: '币种',
  238. dataIndex: 'pi_currency',
  239. align: 'center',
  240. width: 65,
  241. }, {
  242. text: '审核状态',
  243. align: 'center',
  244. dataIndex: 'pi_status',
  245. width: 80
  246. }, {
  247. text: '录入人',
  248. align: 'center',
  249. dataIndex: 'creatorName',
  250. width: 100
  251. }, {
  252. text: '审核人',
  253. align: 'center',
  254. dataIndex: 'pi_auditman',
  255. width: 100
  256. }, {
  257. text: '审核日期',
  258. align: 'center',
  259. dataIndex: 'pi_auditdate',
  260. width: 100
  261. }, {
  262. text: '开票金额',
  263. dataIndex: 'pi_billamount',
  264. width: (saas.util.BaseUtil.getBillOutSource("BillOutARSource") == 'PRODIOAUTO')? 0.0:100,
  265. renderer: function(v, m, r) {
  266. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  267. }
  268. }, {
  269. text: '开票状态',
  270. dataIndex: 'pi_billstatus',
  271. width: (saas.util.BaseUtil.getBillOutSource("BillOutARSource") == 'PRODIOAUTO')? 0.0:100
  272. }, {
  273. text: '备注',
  274. dataIndex: 'pi_remark',
  275. width: 250
  276. }],
  277. relativeColumn: [{
  278. text: 'id',
  279. dataIndex: 'pd_id',
  280. xtype: 'numbercolumn',
  281. hidden: true
  282. }, {
  283. text: '入库单号',
  284. dataIndex: 'pi_inoutno',
  285. width: 150
  286. }, {
  287. text: '单据日期',
  288. dataIndex: 'pi_date',
  289. xtype: 'datecolumn',
  290. width: 110
  291. }, {
  292. text: '供应商名称',
  293. dataIndex: 'pi_vendname',
  294. width: 200,
  295. hidden: true
  296. }, {
  297. text: '审核状态',
  298. align: 'center',
  299. dataIndex: 'pi_status',
  300. width: 80
  301. }, {
  302. text: '物料编号',
  303. dataIndex: 'pr_code',
  304. width: 150,
  305. }, {
  306. text: '厂家/品牌',
  307. dataIndex: 'pr_brand',
  308. width: 100
  309. }, {
  310. text: '物料名称',
  311. dataIndex: 'pr_detail',
  312. width: 150
  313. }, {
  314. text: '型号',
  315. dataIndex: 'pr_orispeccode',
  316. width: 200,
  317. renderer: saas.util.RenderUtil['renderer_prod']
  318. }, {
  319. text: '规格',
  320. dataIndex: 'pr_spec',
  321. width: 200
  322. }, {
  323. text: '仓库',
  324. dataIndex: 'pd_whname',
  325. width: 120
  326. }, {
  327. text: '数量',
  328. dataIndex: 'pd_inqty',
  329. xtype: 'numbercolumn',
  330. width: 110,
  331. renderer: function(v, m, r) {
  332. return saas.util.BaseUtil.numberFormat(v, 6, true);
  333. }
  334. }, {
  335. text: '单位',
  336. dataIndex: 'pr_unit',
  337. width: 65
  338. }, {
  339. text: '单价(元)',
  340. dataIndex: 'pd_netprice',
  341. xtype: 'numbercolumn',
  342. renderer: function(v, m, r) {
  343. return saas.util.BaseUtil.numberFormat(v, 8, true);
  344. },
  345. width: 110
  346. }, {
  347. text: '含税单价(元)',
  348. dataIndex: 'pd_orderprice',
  349. xtype: 'numbercolumn',
  350. renderer: function(v, m, r) {
  351. return saas.util.BaseUtil.numberFormat(v, 8, true);
  352. },
  353. width: 110
  354. }, {
  355. text: '金额(元)',
  356. dataIndex: 'pd_nettotal',
  357. xtype: 'numbercolumn',
  358. width: 110,
  359. renderer: function(v, m, r) {
  360. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  361. },
  362. }, {
  363. text: '税率(%)',
  364. dataIndex: 'pd_taxrate',
  365. xtype: 'numbercolumn',
  366. width: 80,
  367. renderer : function(v, m, r) {
  368. return saas.util.BaseUtil.numberFormat(v, 0, true);
  369. }
  370. }, {
  371. text: '税额(元)',
  372. dataIndex: 'pd_taxamount',
  373. xtype: 'numbercolumn',
  374. width: 110,
  375. renderer: function (v, g, r) {
  376. v = (r.data["pd_ordertotal"] || 0.0) - (r.data["pd_nettotal"] || 0.0);
  377. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  378. }
  379. }, {
  380. text: '价税合计(元)',
  381. dataIndex: 'pd_ordertotal',
  382. xtype: 'numbercolumn',
  383. width: 110,
  384. renderer: function(v, m, r) {
  385. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  386. },
  387. }, {
  388. text: '币种',
  389. dataIndex: 'pi_currency',
  390. align: 'center',
  391. width: 65
  392. }, {
  393. text: "汇率",
  394. dataIndex: "pi_rate",
  395. xtype: 'numbercolumn',
  396. width: 80,
  397. renderer: function(v, m, r) {
  398. return saas.util.BaseUtil.numberFormat(v, 6, false);
  399. }
  400. }, {
  401. text: '关联采购单号',
  402. dataIndex: 'pi_pucode',
  403. width: 150
  404. },{
  405. text: "对账状态",
  406. dataIndex: "apcheckStatus",
  407. width: 100.0
  408. },{
  409. text: 'B2B上传状态',
  410. dataIndex: 'b2bStatus',
  411. textAlign: 'center',
  412. width:120,
  413. hidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
  414. initHidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
  415. renderer: function(v) {
  416. return v ? v : '待上传'
  417. }
  418. }, {
  419. text: '开票数量',
  420. dataIndex: 'pd_auditbillqty',
  421. xtype: 'numbercolumn',
  422. width: (saas.util.BaseUtil.getBillOutSource("BillOutARSource") == 'PRODIOAUTO')? 0.0:110,
  423. renderer: function(v, m, r) {
  424. return saas.util.BaseUtil.numberFixFormat(v, 6, true);
  425. }
  426. }, {
  427. text: '开票金额',
  428. dataIndex: 'pd_auditbillamount',
  429. xtype: 'numbercolumn',
  430. width: (saas.util.BaseUtil.getBillOutSource("BillOutARSource") == 'PRODIOAUTO')? 0.0:110,
  431. renderer: function(v, m, r) {
  432. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  433. }
  434. }, {
  435. text: '开票状态',
  436. dataIndex: 'pi_billstatus',
  437. width: (saas.util.BaseUtil.getBillOutSource("BillOutARSource") == 'PRODIOAUTO')? 0.0:100
  438. }, {
  439. text: '备注',
  440. dataIndex: 'pd_remark',
  441. width: 250
  442. }]
  443. }
  444. });
  445. this.callParent(arguments);
  446. },
  447. });