QueryPanel.js 16 KB

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