QueryPanel.js 16 KB

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