QueryPanel_2.js 12 KB

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