QueryPanel_1.js 15 KB

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