QueryPanel_1.js 14 KB

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