QueryPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. Ext.define('make.view.make.makeScrap.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'make-makescrap-querypanel',
  4. controller: 'make-makescrap-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-makescrap-querypanel',
  24. caller: 'MakeScrap',
  25. //importUploadPath: '/api/purchse/makescrap/saveToFormal',
  26. initComponent: function () {
  27. var me = this;
  28. Ext.apply(me, {
  29. queryFormItems: [ {
  30. xtype: 'condatefield',
  31. name: 'makeScrap.createTime',
  32. fieldLabel: '日期',
  33. columnWidth: 0.5,
  34. operation: 'between',
  35. },{
  36. xtype: 'multiqueryField',
  37. columnWidth: 0.4,
  38. name: 'multi_query',
  39. querys: {
  40. "Vend": {"field": "ms_vendname","desc":"供应商", "dbfinds": [{
  41. from: 've_name',
  42. to: 'ms_vendname'
  43. }]},
  44. "BillCode": {"field": "ms_code" ,"desc": "报废单号"},
  45. "MakeCode": {"field": "md_macode" ,"desc": "制造单号"},
  46. "Prod": {"field": "pr_code", "dbfinds": [{//物料
  47. from: 'pr_code',
  48. to: 'pr_code'
  49. },{
  50. from: 'pr_detail',
  51. to: 'pr_detail'
  52. }]},
  53. "Emp":{"field": "makescrap.creatorName", "dbfinds": [{
  54. from: 'em_name',
  55. to: 'makescrap.creatorName'
  56. }]},
  57. },
  58. setShowDetail: function(v){
  59. this.showDetail = (v == 'Prod' ||v=='MakeCode');
  60. }
  61. }],
  62. moreQueryFormItems: [{
  63. xtype: 'condatefield',
  64. name: 'makescrap.createTime',
  65. fieldLabel: '单据日期',
  66. value:1,
  67. columnWidth: 1
  68. }, {
  69. xtype: 'departDbfindTrigger',
  70. name: 'ms_departmentname',
  71. fieldLabel: '部门'
  72. },{
  73. xtype: 'productDbfindTrigger',
  74. name: 'Makescrapdetail.md_prodcode',
  75. showDetail: true,
  76. fieldLabel: '物料编号'
  77. },{
  78. xtype: 'textfield',
  79. name: 'pr_detail',
  80. fieldLabel: '产品名称',
  81. readOnly: true,
  82. }, {
  83. xtype: 'textfield',
  84. name: 'pr_orispeccode',
  85. fieldLabel: '产品型号',
  86. readOnly: true,
  87. }, {
  88. xtype: "remotecombo",
  89. name: "pr_brand",
  90. fieldLabel: "厂家/品牌",
  91. storeUrl: '/api/document/productbrand/getCombo',
  92. editable: false,
  93. hiddenBtn:true
  94. },{
  95. xtype: 'combobox',
  96. name: 'ms_statuscode',
  97. fieldLabel: '审核状态',
  98. queryMode: 'local',
  99. displayField: 'ms_status',
  100. valueField: 'ms_statuscode',
  101. emptyText :'全部',
  102. editable:false,
  103. store: Ext.create('Ext.data.ArrayStore', {
  104. fields: ['ms_statuscode', 'ms_status'],
  105. data: [
  106. ["ALL", "全部"],
  107. ["AUDITED", "已审核"],
  108. ["UNAUDITED", "未审核"]
  109. ]
  110. }),
  111. getCondition: function(value) {
  112. if(value == 'ALL') {
  113. return '1=1';
  114. }else {
  115. return 'ms_statuscode=\'' + value + '\'';
  116. }
  117. }
  118. }, {
  119. xtype: 'employeeDbfindTrigger',
  120. name: 'creatorName',
  121. fieldLabel: '录入人',
  122. emptyText:'请输入账户名称或姓名',
  123. getCondition: function(value) {
  124. if(!value) {
  125. return '1=1';
  126. }else {
  127. return 'makescrap.creatorName like\'%' + value + '%\'';
  128. }
  129. }
  130. },{
  131. xtype: 'employeeDbfindTrigger',
  132. name: 'ms_auditman',
  133. fieldLabel: '审核人',
  134. emptyText:'请输入账户名称或姓名',
  135. }],
  136. queryGridConfig: {
  137. idField: 'id',
  138. codeField: 'ms_code',
  139. mainIdField:'_id',
  140. detailIdField:'md_id',
  141. addTitle: me.addTitle,
  142. addXtype: me.addXtype,
  143. defaultCondition: me.defaultCondition,
  144. baseVastUrl: me.baseVastUrl,
  145. caller: 'MakeScrap',
  146. baseColumn: [{
  147. text: 'id',
  148. dataIndex: 'id',
  149. hidden: true,
  150. xtype: 'numbercolumn'
  151. }, {
  152. text: '报废单号',
  153. dataIndex: 'ms_code',
  154. width: 150
  155. }, {
  156. text: '单据类型',
  157. dataIndex: 'ms_class',
  158. hidden: true
  159. }, {
  160. text: '单据日期',
  161. dataIndex: 'createTime',
  162. xtype: 'datecolumn',
  163. width: 110
  164. }, {
  165. text: '审核状态',
  166. align: 'center',
  167. dataIndex: 'ms_status',
  168. width: 80
  169. }, {
  170. text: '金额(元)',
  171. hidden:true,
  172. xtype: 'numbercolumn',
  173. dataIndex: 'ms_amount',
  174. width: 110,
  175. renderer: function(v, m, r) {
  176. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  177. }
  178. }, {
  179. text: '录入人',
  180. align: 'center',
  181. dataIndex: 'creatorName',
  182. width: 100
  183. }, {
  184. text: '审核人',
  185. align: 'center',
  186. dataIndex: 'ms_auditman',
  187. width: 100
  188. }, {
  189. text: '审核日期',
  190. align: 'center',
  191. dataIndex: 'ms_auditdate',
  192. xtype: 'datecolumn',
  193. width: 100
  194. }, {
  195. text: '备注',
  196. dataIndex: 'ms_remark',
  197. width: 250
  198. }],
  199. relativeColumn: [{
  200. text: 'id',
  201. dataIndex: 'ms_id',
  202. xtype: 'numbercolumn',
  203. hidden: true
  204. }, {
  205. text: '报废单号',
  206. dataIndex: 'ms_code',
  207. width: 150
  208. }, {
  209. text: '单据日期',
  210. dataIndex: 'createTime',
  211. xtype: 'datecolumn',
  212. width: 110
  213. }, {
  214. text: '审核状态',
  215. align: 'center',
  216. dataIndex: 'ms_status',
  217. width: 80
  218. }, {
  219. text: '制造单号',
  220. dataIndex: 'md_macode',
  221. width: 150,
  222. }, {
  223. text: '工单序号',
  224. dataIndex: 'md_mmdetno',
  225. align: 'center',
  226. width: 80
  227. },{
  228. text: '物料编号',
  229. dataIndex: 'pr_code',
  230. width: 150,
  231. }, {
  232. text: '厂家/品牌',
  233. dataIndex: 'pr_brand',
  234. width: 100
  235. }, {
  236. text: '物料名称',
  237. dataIndex: 'pr_detail',
  238. width: 150
  239. }, {
  240. text: '型号',
  241. dataIndex: 'pr_orispeccode',
  242. width: 200,
  243. renderer: saas.util.RenderUtil['renderer_prod']
  244. }, {
  245. text: '规格',
  246. dataIndex: 'pr_spec',
  247. width: 250
  248. }, {
  249. text: '报废数量',
  250. dataIndex: 'md_qty',
  251. xtype: 'numbercolumn',
  252. width: 110,
  253. renderer: function(v, m, r) {
  254. return saas.util.BaseUtil.numberFormat(v, 6, true);
  255. }
  256. }, {
  257. text: '单位',
  258. dataIndex: 'pr_unit',
  259. width: 65
  260. }, {
  261. text: '报废原因',
  262. dataIndex: 'md_reason',
  263. width: 200
  264. }, {
  265. text: '成本单价(元)',
  266. dataIndex: 'md_price',
  267. xtype: 'numbercolumn',
  268. renderer: function(v, m, r) {
  269. return saas.util.BaseUtil.numberFormat(v, 8, true);
  270. },
  271. width: 110
  272. }, {
  273. text: '金额(元)',
  274. hidden:true,
  275. dataIndex: 'md_total',
  276. xtype: 'numbercolumn',
  277. width: 110,
  278. renderer: function(v, m, r) {
  279. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  280. },
  281. }, {
  282. text: '备注',
  283. dataIndex: 'md_remark',
  284. width: 250
  285. }]
  286. }
  287. });
  288. this.callParent(arguments);
  289. },
  290. });