QueryPanel1.js 16 KB

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