QueryPanel.js 15 KB

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