QueryPanel.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. Ext.define('make.view.osmake.osMake.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'osmake-osmake-querypanel',
  4. controller: 'osmake-osmake-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-osmake-querypanel',
  24. caller: 'OsMake',
  25. initComponent: function () {
  26. var me = this;
  27. Ext.apply(this, {
  28. importUploadPath:me.importUploadPath,
  29. queryFormItems: [{
  30. xtype: 'condatefield',
  31. name: 'make.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. "Prod": {
  41. "field": "ma_prodcode", "dbfinds": [{//物料
  42. from: 'pr_code',
  43. to: 'ma_prodcode'
  44. }, {
  45. from: 'pr_detail',
  46. to: 'pr_detail'
  47. }]
  48. },
  49. "MakeCode": { "field": "ma_code", "desc": "外协单号" },
  50. "BillCode": { "field": "ma_salecode", "desc": "订单号" },
  51. "Cust": { "field": "ma_custcode", "desc": "客户" },
  52. "Vend": { "field": "ma_code", "desc": "供应商" },
  53. "Emp": {
  54. "field": "make.creatorName", "dbfinds": [{
  55. from: 'em_name',
  56. to: 'make.creatorName'
  57. }]
  58. },
  59. },
  60. setShowDetail: function(v){
  61. this.showDetail = false;
  62. }
  63. }],
  64. moreQueryFormItems: [{
  65. xtype: 'saledetailDbfindTrigger',
  66. name: 'ma_salecode',
  67. fieldLabel: '订单编号'
  68. }, {
  69. xtype: 'customerDbfindTrigger',
  70. name: 'ma_custname',
  71. fieldLabel: '客户名称'
  72. }, {
  73. xtype: 'condatefield',
  74. name: 'ma_delivery',
  75. fieldLabel: '交货日期',
  76. columnWidth: 1
  77. }, {
  78. xtype: 'productMDbfindTrigger',
  79. name: 'ma_prodcode',
  80. fieldLabel: '物料编号'
  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: 'vendorDbfindTrigger',
  100. name: 'ma_vendname',
  101. fieldLabel: '外协厂商'
  102. }, {
  103. xtype: 'combobox',
  104. name: 'ma_currency',
  105. fieldLabel: '币别',
  106. queryMode: 'local',
  107. displayField: 'ma_currency',
  108. valueField: 'ma_currency',
  109. emptyText: '',
  110. editable: false,
  111. store: Ext.create('Ext.data.ArrayStore', {
  112. fields: ['ma_currency'],
  113. data: [
  114. ["RMB", "RMB"],
  115. ["USD", "USD"],
  116. ["HKD", "HKD"]
  117. ]
  118. }),
  119. getCondition: function (value) {
  120. if (!value) {
  121. return '1=1';
  122. } else {
  123. return 'ma_currency=\'' + value + '\'';
  124. }
  125. }
  126. }, {
  127. xtype: "remotecombo",
  128. name: "ma_kind",
  129. fieldLabel: "外协类型",
  130. storeUrl: '/api/make/kind/list/osmake',
  131. valueField: 'mk_name',
  132. displayField: 'mk_name',
  133. hiddenBtn: true,
  134. }, {
  135. xtype: 'combobox',
  136. name: 'ma_statuscode',
  137. fieldLabel: '审核状态',
  138. queryMode: 'local',
  139. displayField: 'ma_status',
  140. valueField: 'ma_statuscode',
  141. emptyText: '全部',
  142. editable: false,
  143. store: Ext.create('Ext.data.ArrayStore', {
  144. fields: ['ma_statuscode', 'ma_status'],
  145. data: [
  146. ["ALL", "全部"],
  147. ["AUDITED", "已审核"],
  148. ["UNAUDITED", "未审核"]
  149. ]
  150. }),
  151. getCondition: function (value) {
  152. if (value == 'ALL') {
  153. return '1=1';
  154. } else {
  155. return 'ma_statuscode=\'' + value + '\'';
  156. }
  157. }
  158. }, {
  159. xtype: 'employeeDbfindTrigger',
  160. name: 'ma_auditman',
  161. fieldLabel: '审核人',
  162. emptyText: '请输入账户名称或姓名',
  163. }, {
  164. xtype: 'employeeDbfindTrigger',
  165. name: 'creatorName',
  166. fieldLabel: '录入人',
  167. emptyText: '请输入账户名称或姓名',
  168. getCondition: function (value) {
  169. if (!value) {
  170. return '1=1';
  171. } else {
  172. return 'make.creatorName like\'%' + value + '%\'';
  173. }
  174. }
  175. }, {
  176. xtype: 'condatefield',
  177. name: 'ma_planbegindate',
  178. fieldLabel: '计划开工日期',
  179. columnWidth: 1
  180. }, {
  181. xtype: 'condatefield',
  182. name: 'ma_planenddate',
  183. fieldLabel: '计划完工日期',
  184. columnWidth: 1
  185. }, {
  186. xtype: 'condatefield',
  187. name: 'make.createTime',
  188. fieldLabel: '单据日期',
  189. columnWidth: 1
  190. }],
  191. queryGridConfig: {
  192. idField: 'ma_id',
  193. codeField: 'ma_code',
  194. mainIdField: 'ma_id',
  195. detailIdField: 'mm_id',
  196. addTitle: '外协单',
  197. addXtype: 'osmake-osmake-formpanel',
  198. baseVastUrl: '/api/make/make/',
  199. caller: 'OsMake',
  200. defaultCondition: me.defaultCondition,
  201. toolBtns: [{
  202. xtype: 'button',
  203. text: '智能工单',
  204. cls: 'x-formpanel-btn-blue',
  205. handler: 'intelligentMake'
  206. },{
  207. text: '结案',
  208. xtype: 'button',
  209. handler: 'onEnd',
  210. menu: {
  211. cls: 'x-query-menu',
  212. anchor: '100%',
  213. items: [{
  214. text: '反结案',
  215. handler: 'onResEnd'
  216. }],
  217. listeners: {
  218. 'mouseleave': function (enu) {
  219. this.hide();
  220. }
  221. }
  222. }
  223. }],
  224. baseColumn: [{
  225. text: 'id',
  226. dataIndex: 'ma_id',
  227. hidden: true,
  228. xtype: 'numbercolumn'
  229. }, {
  230. text: '外协单号',
  231. dataIndex: 'ma_code',
  232. width: 150
  233. }, {
  234. text: '单据日期',
  235. dataIndex: 'createTime',
  236. xtype: 'datecolumn',
  237. width: 110
  238. }, {
  239. text: '销售单号',
  240. dataIndex: 'ma_salecode',
  241. width: 150
  242. }, {
  243. text: '客户名称',
  244. dataIndex: 'ma_custname',
  245. width: 150
  246. }, {
  247. text: '交货日期',
  248. align: 'center',
  249. dataIndex: 'ma_delivery',
  250. width: 100,
  251. xtype:'datecolumn'
  252. }, {
  253. text: '外协厂商',
  254. dataIndex: 'ma_vendname',
  255. width: 150
  256. }, {
  257. text: '产品编号',
  258. dataIndex: 'ma_prodcode',
  259. width: 150
  260. }, {
  261. text: '产品名称',
  262. dataIndex: 'ma_prdetail',
  263. width: 150
  264. }, {
  265. text: '产品型号',
  266. dataIndex: 'ma_prorispeccode',
  267. width: 150,
  268. renderer : saas.util.RenderUtil['renderer_makeprod']
  269. }, {
  270. text: '单位',
  271. align: 'center',
  272. dataIndex: 'ma_prunit',
  273. width: 80
  274. }, {
  275. text: '数量',
  276. align: 'center',
  277. dataIndex: 'ma_qty',
  278. xtype: 'numbercolumn',
  279. width: 110,
  280. renderer: function (v, m, r) {
  281. return saas.util.BaseUtil.numberFormat(v, 6, true);
  282. },
  283. }, {
  284. text: '已验收数',
  285. align: 'center',
  286. dataIndex: 'ma_madeqty',
  287. xtype: 'numbercolumn',
  288. width: 110,
  289. renderer: function (v, m, r) {
  290. return saas.util.BaseUtil.numberFormat(v, 6, true);
  291. },
  292. }, {
  293. text: '已转验收数',
  294. align: 'center',
  295. dataIndex: 'ma_turnmadeqty',
  296. xtype: 'numbercolumn',
  297. width: 110,
  298. renderer : function(v, m, r) {
  299. return saas.util.BaseUtil.numberFormat(v, 6, true);
  300. },
  301. },{
  302. text: '已领齐套数',
  303. align: 'center',
  304. dataIndex: 'ma_setqty',
  305. xtype: 'numbercolumn',
  306. width: 110,
  307. renderer: function (v, m, r) {
  308. return saas.util.BaseUtil.numberFormat(v, 6, true);
  309. },
  310. },{
  311. text: '可验收数',
  312. align: 'center',
  313. dataIndex: 'ma_canmadeqty',
  314. xtype: 'numbercolumn',
  315. width: 110,
  316. renderer : function(v, m, r) {
  317. return saas.util.BaseUtil.numberFormat(v, 6, true);
  318. },
  319. }, {
  320. text: '币种',
  321. dataIndex: 'ma_currency',
  322. align: 'center',
  323. width: 80,
  324. }, {
  325. text: '价税合计(元)',
  326. dataIndex: 'ma_total',
  327. width: 110,
  328. xtype: 'numbercolumn',
  329. renderer : function(v, m, r) {
  330. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  331. }
  332. },{
  333. text: '外协类型',
  334. dataIndex: 'ma_kind',
  335. width: 100,
  336. }, {
  337. text: '审核状态',
  338. dataIndex: 'ma_status',
  339. align: 'center',
  340. width: 100,
  341. }, {
  342. text: '领料状态',
  343. dataIndex: 'ma_getstatus',
  344. align: 'center',
  345. width: 100,
  346. }, {
  347. text: '完工状态',
  348. dataIndex: 'ma_finishstatus',
  349. align: 'center',
  350. width: 100,
  351. }, {
  352. text: '制单人',
  353. dataIndex: 'creatorName',
  354. align: 'center',
  355. width: 100,
  356. }, {
  357. text: '计划开工日期',
  358. dataIndex: 'ma_planbegindate',
  359. width: 130,
  360. xtype: 'datecolumn'
  361. }, {
  362. text: '计划完工日期',
  363. dataIndex: 'ma_planenddate',
  364. width: 130,
  365. xtype: 'datecolumn'
  366. }, {
  367. text: '实际开工日期',
  368. dataIndex: 'ma_actbegindate',
  369. width: 130,
  370. xtype: 'datecolumn'
  371. }, {
  372. text: '实际完工日期',
  373. dataIndex: 'ma_actenddate',
  374. width: 130,
  375. xtype: 'datecolumn'
  376. }, {
  377. text: '结案日期',
  378. dataIndex: 'ma_enddate',
  379. width: 130,
  380. xtype: 'datecolumn'
  381. }, {
  382. text: '备注',
  383. dataIndex: 'ma_remark',
  384. width: 100
  385. }],
  386. relativeColumn: []
  387. }
  388. });
  389. this.callParent(arguments);
  390. },
  391. });