QueryPanel_1.js 11 KB

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