QueryPanel_2.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. Ext.define('make.view.make.makeIn.QueryPanel_2', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'make-makein-querypanel-2',
  4. controller: 'make-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: false, // 显示删除按钮
  16. deleteDisable:false, //删除按钮是否可使用
  17. openAudit:false,//单独显示审核按钮
  18. openUnAudit:true,//单独显示反审核按钮
  19. openEnable:false, //显示开启 针对已取消列表
  20. configurable: true, // 允许列设置
  21. }
  22. },
  23. viewName: 'make-makein-querypanel-2',
  24. caller: 'MakeIn',
  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. },{
  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: 'MakeIn',
  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_total',
  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. dataIndex: 'pr_code',
  228. width: 150,
  229. }, {
  230. text: '厂家/品牌',
  231. dataIndex: 'pr_brand',
  232. width: 100
  233. }, {
  234. text: '物料名称',
  235. dataIndex: 'pr_detail',
  236. width: 150
  237. }, {
  238. text: '型号',
  239. dataIndex: 'pr_orispeccode',
  240. width: 200,
  241. renderer: saas.util.RenderUtil['renderer_prod']
  242. }, {
  243. text: '规格',
  244. dataIndex: 'pr_spec',
  245. width: 200
  246. }, {
  247. text: '仓库',
  248. dataIndex: 'pd_whname',
  249. width: 120
  250. }, {
  251. text: '完工数量',
  252. dataIndex: 'pd_inqty',
  253. xtype: 'numbercolumn',
  254. width: 110,
  255. renderer: function(v, m, r) {
  256. return saas.util.BaseUtil.numberFormat(v, 6, true);
  257. }
  258. }, {
  259. text: '单位',
  260. dataIndex: 'pr_unit',
  261. width: 65
  262. }, {
  263. text: '单价(元)',
  264. dataIndex: 'pd_orderprice',
  265. xtype: 'numbercolumn',
  266. renderer: function(v, m, r) {
  267. return saas.util.BaseUtil.numberFormat(v, 8, true);
  268. },
  269. width: 110
  270. }, {
  271. text: '金额(元)',
  272. hidden:true,
  273. dataIndex: 'pd_ordertotal',
  274. xtype: 'numbercolumn',
  275. width: 110,
  276. renderer: function(v, m, r) {
  277. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  278. },
  279. }, {
  280. text: '备注',
  281. dataIndex: 'pd_remark',
  282. width: 250
  283. }]
  284. }
  285. });
  286. this.callParent(arguments);
  287. },
  288. });