QueryPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. Ext.define('make.view.osmake.osMakeScrap.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'osmake-osmakescrap-querypanel',
  4. controller: 'osmake-osmakescrap-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: 'osmake-osmakescrap-querypanel',
  24. caller: 'OsMakeScrap',
  25. //importUploadPath: '/api/purchse/osmakescrap/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. columnWidth: 1
  67. },{
  68. xtype: 'vendorDbfindTrigger',
  69. name: 'ms_vendname',
  70. fieldLabel: '外协厂商'
  71. },{
  72. xtype: 'productDbfindTrigger',
  73. name: 'makescrapdetail.md_prodcode',
  74. showDetail: true,
  75. fieldLabel: '物料编号'
  76. },{
  77. xtype: 'textfield',
  78. name: 'pr_detail',
  79. fieldLabel: '产品名称',
  80. readOnly: true,
  81. }, {
  82. xtype: 'textfield',
  83. name: 'pr_orispeccode',
  84. fieldLabel: '产品型号',
  85. readOnly: true,
  86. }, {
  87. editable: false,
  88. xtype: "remotecombo",
  89. storeUrl: '/api/document/productbrand/getCombo',
  90. name: "pr_brand",
  91. fieldLabel: "厂家/品牌",
  92. showDetail: true,
  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: 'OsMakeScrap',
  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. dataIndex: 'ms_vendname',
  172. width: 200
  173. }, {
  174. text: '金额(元)',
  175. hidden:true,
  176. xtype: 'numbercolumn',
  177. dataIndex: 'ms_amount',
  178. width: 110,
  179. renderer: function(v, m, r) {
  180. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  181. }
  182. }, {
  183. text: '录入人',
  184. align: 'center',
  185. dataIndex: 'creatorName',
  186. width: 100
  187. }, {
  188. text: '审核人',
  189. align: 'center',
  190. dataIndex: 'ms_auditman',
  191. width: 100
  192. }, {
  193. text: '审核日期',
  194. align: 'center',
  195. dataIndex: 'ms_auditdate',
  196. xtype: 'datecolumn',
  197. width: 100
  198. }, {
  199. text: '备注',
  200. dataIndex: 'ms_remark',
  201. width: 250
  202. }],
  203. relativeColumn: [{
  204. text: 'id',
  205. dataIndex: 'ms_id',
  206. xtype: 'numbercolumn',
  207. hidden: true
  208. }, {
  209. text: '报废单号',
  210. dataIndex: 'ms_code',
  211. width: 150
  212. }, {
  213. text: '单据日期',
  214. dataIndex: 'createTime',
  215. xtype: 'datecolumn',
  216. width: 110
  217. }, {
  218. text: '外协厂商',
  219. dataIndex: 'ms_vendname',
  220. width: 200
  221. }, {
  222. text: '审核状态',
  223. align: 'center',
  224. dataIndex: 'ms_status',
  225. width: 80
  226. }, {
  227. text: '制造单号',
  228. dataIndex: 'md_macode',
  229. width: 150,
  230. }, {
  231. text: '工单序号',
  232. dataIndex: 'md_mmdetno',
  233. align: 'center',
  234. width: 80
  235. },{
  236. text: '物料编号',
  237. dataIndex: 'pr_code',
  238. width: 150,
  239. }, {
  240. text: '厂家/品牌',
  241. dataIndex: 'pr_brand',
  242. width: 100
  243. }, {
  244. text: '物料名称',
  245. dataIndex: 'pr_detail',
  246. width: 150
  247. }, {
  248. text: '型号',
  249. dataIndex: 'pr_orispeccode',
  250. width: 200,
  251. renderer: saas.util.RenderUtil['renderer_prod']
  252. }, {
  253. text: '规格',
  254. dataIndex: 'pr_spec',
  255. width: 250
  256. }, {
  257. text: '报废数量',
  258. dataIndex: 'md_qty',
  259. xtype: 'numbercolumn',
  260. width: 110,
  261. renderer: function(v, m, r) {
  262. return saas.util.BaseUtil.numberFormat(v, 6, true);
  263. }
  264. }, {
  265. text: '单位',
  266. dataIndex: 'pr_unit',
  267. width: 65
  268. }, {
  269. text: '报废原因',
  270. dataIndex: 'md_reason',
  271. width: 200
  272. }, {
  273. text: '成本单价(元)',
  274. dataIndex: 'md_price',
  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. hidden:true,
  283. dataIndex: 'md_total',
  284. xtype: 'numbercolumn',
  285. width: 110,
  286. renderer: function(v, m, r) {
  287. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  288. },
  289. }, {
  290. text: '备注',
  291. dataIndex: 'md_remark',
  292. width: 250
  293. }]
  294. }
  295. });
  296. this.callParent(arguments);
  297. },
  298. });