QueryPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. Ext.define('make.view.make.makePick.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'make-makepick-querypanel',
  4. controller: 'make-makepick-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: 'make-makepick-querypanel',
  24. caller: 'MakePick',
  25. //importUploadPath: '/api/purchse/makepick/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": "prodiodetail.pd_ordercode" ,"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. setShowDetail: function(v){
  55. this.showDetail = (v == 'Prod' ||v=='MakeCode');
  56. },
  57. }],
  58. moreQueryFormItems: [{
  59. xtype: 'condatefield',
  60. name: 'pi_date',
  61. fieldLabel: '单据日期',
  62. value:1,
  63. columnWidth: 1
  64. }, {
  65. xtype: 'departDbfindTrigger',
  66. name: 'pi_departmentname',
  67. fieldLabel: '部门'
  68. },{
  69. xtype: 'warehouseDbfindTrigger',
  70. name: 'prodiodetail.pd_whname',
  71. showDetail: true,
  72. fieldLabel: '仓库'
  73. },{
  74. xtype: 'productDbfindTrigger',
  75. name: 'Prodiodetail.pd_prodcode',
  76. showDetail: true,
  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. xtype: "remotecombo",
  90. name: "pr_brand",
  91. fieldLabel: "厂家/品牌",
  92. storeUrl: '/api/document/productbrand/getCombo',
  93. editable: false,
  94. hiddenBtn:true
  95. },{
  96. xtype: 'combobox',
  97. name: 'pi_statuscode',
  98. fieldLabel: '审核状态',
  99. queryMode: 'local',
  100. displayField: 'pi_status',
  101. valueField: 'pi_statuscode',
  102. emptyText :'全部',
  103. editable:false,
  104. store: Ext.create('Ext.data.ArrayStore', {
  105. fields: ['pi_statuscode', 'pi_status'],
  106. data: [
  107. ["ALL", "全部"],
  108. ["AUDITED", "已审核"],
  109. ["UNAUDITED", "未审核"]
  110. ]
  111. }),
  112. getCondition: function(value) {
  113. if(value == 'ALL') {
  114. return '1=1';
  115. }else {
  116. return 'pi_statuscode=\'' + value + '\'';
  117. }
  118. }
  119. }, {
  120. xtype: 'employeeDbfindTrigger',
  121. name: 'creatorName',
  122. fieldLabel: '录入人',
  123. emptyText:'请输入账户名称或姓名',
  124. getCondition: function(value) {
  125. if(!value) {
  126. return '1=1';
  127. }else {
  128. return 'prodinout.creatorName like\'%' + value + '%\'';
  129. }
  130. }
  131. },{
  132. xtype: 'employeeDbfindTrigger',
  133. name: 'pi_auditman',
  134. fieldLabel: '审核人',
  135. emptyText:'请输入账户名称或姓名',
  136. }],
  137. queryGridConfig: {
  138. idField: 'id',
  139. codeField: 'pi_inoutno',
  140. mainIdField:'_id',
  141. detailIdField:'pd_id',
  142. addTitle: me.addTitle,
  143. addXtype: me.addXtype,
  144. defaultCondition: me.defaultCondition,
  145. baseVastUrl: me.baseVastUrl,
  146. caller: 'MakePick',
  147. baseColumn: [{
  148. text: 'id',
  149. dataIndex: 'id',
  150. hidden: true,
  151. xtype: 'numbercolumn'
  152. }, {
  153. text: '领料单号',
  154. dataIndex: 'pi_inoutno',
  155. width: 150
  156. }, {
  157. text: '单据类型',
  158. dataIndex: 'pi_class',
  159. hidden: true
  160. }, {
  161. text: '单据日期',
  162. dataIndex: 'pi_date',
  163. xtype: 'datecolumn',
  164. width: 110
  165. }, {
  166. text: '审核状态',
  167. align: 'center',
  168. dataIndex: 'pi_status',
  169. width: 80
  170. }, {
  171. text: '金额(元)',
  172. hidden:true,
  173. xtype: 'numbercolumn',
  174. dataIndex: 'pi_costtotal',
  175. width: 110,
  176. renderer: function(v, m, r) {
  177. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  178. }
  179. }, {
  180. text: '录入人',
  181. align: 'center',
  182. dataIndex: 'creatorName',
  183. width: 100
  184. }, {
  185. text: '审核人',
  186. align: 'center',
  187. dataIndex: 'pi_auditman',
  188. width: 100
  189. }, {
  190. text: '审核日期',
  191. align: 'center',
  192. dataIndex: 'pi_auditdate',
  193. xtype: 'datecolumn',
  194. width: 110
  195. }, {
  196. hidden:true,
  197. text: '币种',
  198. dataIndex: 'pi_currency',
  199. align: 'center',
  200. width: 65
  201. }, {
  202. text: '备注',
  203. dataIndex: 'pi_remark',
  204. width: 250
  205. }],
  206. relativeColumn: [{
  207. text: 'id',
  208. dataIndex: 'pd_id',
  209. xtype: 'numbercolumn',
  210. hidden: true
  211. }, {
  212. text: '领料单号',
  213. dataIndex: 'pi_inoutno',
  214. width: 150
  215. }, {
  216. text: '单据日期',
  217. dataIndex: 'pi_date',
  218. xtype: 'datecolumn',
  219. width: 110
  220. }, {
  221. text: '审核状态',
  222. align: 'center',
  223. dataIndex: 'pi_status',
  224. width: 80
  225. }, {
  226. text: '审核日期',
  227. align: 'center',
  228. dataIndex: 'pi_auditdate',
  229. xtype: 'datecolumn',
  230. width: 110
  231. }, {
  232. text: '制造单号',
  233. dataIndex: 'pd_ordercode',
  234. width: 150
  235. }, {
  236. text: '工单序号',
  237. dataIndex: 'pd_orderdetno',
  238. align: 'center',
  239. width: 80
  240. }, {
  241. text: '物料编号',
  242. dataIndex: 'pr_code',
  243. width: 150,
  244. }, {
  245. text: '厂家/品牌',
  246. dataIndex: 'pr_brand',
  247. width: 100
  248. }, {
  249. text: '物料名称',
  250. dataIndex: 'pr_detail',
  251. width: 150
  252. }, {
  253. text: '型号',
  254. dataIndex: 'pr_orispeccode',
  255. width: 200,
  256. renderer: saas.util.RenderUtil['renderer_prod']
  257. }, {
  258. text: '规格',
  259. dataIndex: 'pr_spec',
  260. width: 200
  261. }, {
  262. text: '仓库',
  263. dataIndex: 'pd_whname',
  264. width: 120
  265. }, {
  266. text: '数量',
  267. dataIndex: 'pd_outqty',
  268. xtype: 'numbercolumn',
  269. width: 110,
  270. renderer: function(v, m, r) {
  271. return saas.util.BaseUtil.numberFormat(v, 6, true);
  272. }
  273. }, {
  274. text: '单位',
  275. dataIndex: 'pr_unit',
  276. width: 65
  277. }, {
  278. text: '成本单价(元)',
  279. dataIndex: 'pd_price',
  280. xtype: 'numbercolumn',
  281. renderer: function(v, m, r) {
  282. return saas.util.BaseUtil.numberFormat(v, 8, true);
  283. },
  284. width: 110
  285. }, {
  286. text: '金额(元)',
  287. hidden:true,
  288. dataIndex: 'pd_total',
  289. xtype: 'numbercolumn',
  290. width: 110,
  291. renderer: function(v, m, r) {
  292. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  293. },
  294. }, {
  295. text: '备注',
  296. dataIndex: 'pd_remark',
  297. width: 250
  298. }]
  299. }
  300. });
  301. this.callParent(arguments);
  302. },
  303. });