QueryPanel_1.js 16 KB

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