QueryPanel_2.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. Ext.define('make.view.make.makeBase.QueryPanel_2', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'make-makebase-querypanel-2',
  4. controller: 'make-makebase-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:false,//单独显示反审核按钮
  19. openEnable:false, //显示开启 针对已取消列表
  20. configurable: true, // 允许列设置
  21. }
  22. },
  23. viewName: 'make-makebase-querypanel',
  24. caller: 'MakeBase',
  25. //importUploadPath: '/api/purchse/makereturn/saveToFormal',
  26. initComponent: function () {
  27. var me = this;
  28. Ext.apply(this, {
  29. queryFormItems: [ {
  30. xtype: 'condatefield',
  31. name: 'make.createTime',
  32. fieldLabel: '日期',
  33. columnWidth: 0.5,
  34. operation: 'between',
  35. value: '7'
  36. },{
  37. xtype: 'multiqueryField',
  38. columnWidth: 0.4,
  39. name: 'multi_query',
  40. querys: {
  41. "Prod": {"field": "ma_prodcode", "dbfinds": [{//物料
  42. from: 'pr_code',
  43. to: 'ma_prodcode'
  44. },{
  45. from: 'pr_detail',
  46. to: 'pr_detail'
  47. }]},
  48. "MakeCode": {"field": "ma_code" ,"desc": "制造单号"},
  49. "BillCode": {"field": "ma_salecode" ,"desc": "订单号"},
  50. "Cust": {"field": "ma_custname", "dbfinds": [{
  51. from: 'cu_name',
  52. to: 'ma_custname'
  53. }]},
  54. "Emp":{"field": "make.creatorName", "dbfinds": [{
  55. from: 'em_name',
  56. to: 'make.creatorName'
  57. }]},
  58. },
  59. setShowDetail: function(v){
  60. this.showDetail = false;
  61. }
  62. }],
  63. moreQueryFormItems: [{
  64. xtype: 'saledetailDbfindTrigger',
  65. name: 'ma_salecode',
  66. fieldLabel: '订单编号'
  67. },{
  68. xtype: "customerDbfindTrigger",
  69. name: "ma_custname",
  70. fieldLabel: "客户名称",
  71. },{
  72. xtype: 'condatefield',
  73. name: 'ma_delivery',
  74. fieldLabel: '交货日期',
  75. value:7,
  76. columnWidth: 1
  77. },{
  78. xtype: 'productDbfindTrigger',
  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. xtype: "remotecombo",
  93. name: "pr_brand",
  94. fieldLabel: "厂家/品牌",
  95. storeUrl: '/api/document/productbrand/getCombo',
  96. editable: false,
  97. hiddenBtn:true
  98. },{
  99. xtype: "remotecombo",
  100. name: "ma_kind",
  101. fieldLabel: "制造类型",
  102. storeUrl:'/api/make/kind/list/make',
  103. valueField:'mk_name',
  104. displayField: 'mk_name',
  105. editable: false,
  106. hiddenBtn:true
  107. },{
  108. xtype: 'remotecombo',
  109. name: "ma_wcname",
  110. fieldLabel: "工作中心",
  111. storeUrl: '/api/document/workcenter/getCombo',
  112. editable: false,
  113. hiddenBtn:true
  114. },{
  115. xtype: 'combobox',
  116. name: 'ma_statuscode',
  117. fieldLabel: '审核状态',
  118. queryMode: 'local',
  119. displayField: 'ma_status',
  120. valueField: 'ma_statuscode',
  121. emptyText :'全部',
  122. editable:false,
  123. store: Ext.create('Ext.data.ArrayStore', {
  124. fields: ['ma_statuscode', 'ma_status'],
  125. data: [
  126. ["ALL", "全部"],
  127. ["AUDITED", "已审核"],
  128. ["UNAUDITED", "未审核"]
  129. ]
  130. }),
  131. getCondition: function(value) {
  132. if(value == 'ALL') {
  133. return '1=1';
  134. }else {
  135. return 'ma_statuscode=\'' + value + '\'';
  136. }
  137. }
  138. }, {
  139. xtype: 'employeeDbfindTrigger',
  140. name: 'creatorName',
  141. fieldLabel: '录入人',
  142. emptyText:'请输入账户名称或姓名',
  143. getCondition: function(value) {
  144. if(!value) {
  145. return '1=1';
  146. }else {
  147. return 'make.creatorName like\'%' + value + '%\'';
  148. }
  149. }
  150. },{
  151. xtype: 'condatefield',
  152. name: 'ma_planbegindate',
  153. fieldLabel: '计划开工日期',
  154. value:7,
  155. columnWidth: 1
  156. },{
  157. xtype: 'condatefield',
  158. name: 'ma_planenddate',
  159. fieldLabel: '计划完工日期',
  160. value:7,
  161. columnWidth: 1
  162. },{
  163. xtype: 'condatefield',
  164. name: 'make.createTime',
  165. fieldLabel: '录入日期',
  166. value:7,
  167. columnWidth: 1
  168. }, {
  169. xtype: 'employeeDbfindTrigger',
  170. name: 'ma_auditman',
  171. fieldLabel: '审核人',
  172. emptyText:'请输入账户名称或姓名',
  173. }],
  174. queryGridConfig: {
  175. idField: 'ma_id',
  176. codeField: 'ma_code',
  177. mainIdField:'ma_id',
  178. detailIdField:'mm_id',
  179. addTitle: '制造单',
  180. addXtype: 'make-makebase-formpanel',
  181. baseVastUrl: '/api/make/make/',
  182. caller: me.caller,
  183. useGridCaller: true,
  184. defaultCondition:me.defaultCondition,
  185. turnQtyField:'this_yqty',
  186. toolBtns: [{
  187. text: '转完工',
  188. xtype: 'button',
  189. handler: 'onIn',
  190. },{
  191. text: '结案',
  192. xtype: 'button',
  193. handler: 'onEnd',
  194. }],
  195. baseColumn: [{
  196. text: 'id',
  197. dataIndex: 'ma_id',
  198. hidden: true,
  199. xtype: 'numbercolumn'
  200. },{
  201. text: '本次完工数',
  202. dataIndex: 'this_yqty',
  203. xtype: 'widgetcolumn',
  204. renderer : function(val, meta, record, x, y, store, view) {
  205. var data=record.data,
  206. v=data.ma_canmadeqty-data.ma_turnmadeqty||0;
  207. if(!val){
  208. val=v;
  209. }
  210. record.data['this_yqty']=val;
  211. return val;
  212. },
  213. widget: {
  214. xtype: "numberfield",
  215. cls:'widget-number',
  216. bind: '{record.this_yqty}',
  217. decimalPrecision: 6,
  218. minValue: 0,
  219. listeners:{
  220. blur: function(f ,event, e){
  221. var record = f.lookupViewModel().data.record;
  222. if(record){
  223. var v=saas.util.NumberUtil.accSub(record.get('ma_canmadeqty'),record.get('ma_turnmadeqty')),
  224. val = record.get('this_yqty');
  225. if(!val){
  226. val=v;
  227. }
  228. var maxValue=saas.util.NumberUtil.accSub(record.get('ma_canmadeqty'),record.get('ma_turnmadeqty'));
  229. val =Ext.Number.from(val,maxValue);
  230. if(val> maxValue){
  231. val = maxValue;
  232. saas.util.BaseUtil.showErrorToast('请不要输入超过最大数量' + maxValue + "的值!");
  233. }
  234. record.set('this_yqty', val)
  235. }
  236. }
  237. }
  238. }
  239. }, {
  240. text: '制造单号',
  241. dataIndex: 'ma_code',
  242. width: 150
  243. }, {
  244. text: '单据日期',
  245. dataIndex: 'createTime',
  246. xtype: 'datecolumn',
  247. width: 110
  248. }, {
  249. text: '销售单号',
  250. dataIndex: 'ma_salecode',
  251. width: 150
  252. }, {
  253. text: '客户名称',
  254. dataIndex: 'ma_custname',
  255. width: 150
  256. }, {
  257. text: '交货日期',
  258. align: 'center',
  259. dataIndex: 'ma_delivery',
  260. width: 110,
  261. xtype:'datecolumn'
  262. },{
  263. text: '产品编号',
  264. dataIndex: 'ma_prodcode',
  265. width: 150
  266. },{
  267. text: '产品名称',
  268. dataIndex: 'ma_prdetail',
  269. width: 150
  270. },{
  271. text: '产品型号',
  272. dataIndex: 'ma_prorispeccode',
  273. width: 150,
  274. renderer : saas.util.RenderUtil['renderer_makeprod']
  275. },{
  276. text: '单位',
  277. align: 'center',
  278. dataIndex: 'ma_prunit',
  279. width: 80
  280. },{
  281. text: '数量',
  282. align: 'center',
  283. dataIndex: 'ma_qty',
  284. xtype: 'numbercolumn',
  285. width: 110,
  286. renderer : function(v, m, r) {
  287. return saas.util.BaseUtil.numberFormat(v, 6, true);
  288. },
  289. },{
  290. text: '已完工数',
  291. align: 'center',
  292. dataIndex: 'ma_madeqty',
  293. xtype: 'numbercolumn',
  294. width: 110,
  295. renderer : function(v, m, r) {
  296. return saas.util.BaseUtil.numberFormat(v, 6, true);
  297. },
  298. },{
  299. text: '已转完工数',
  300. align: 'center',
  301. dataIndex: 'ma_turnmadeqty',
  302. xtype: 'numbercolumn',
  303. width: 110,
  304. renderer : function(v, m, r) {
  305. return saas.util.BaseUtil.numberFormat(v, 6, true);
  306. },
  307. },{
  308. text: '已领齐套数',
  309. align: 'center',
  310. dataIndex: 'ma_setqty',
  311. xtype: 'numbercolumn',
  312. width: 110,
  313. renderer : function(v, m, r) {
  314. return saas.util.BaseUtil.numberFormat(v, 6, true);
  315. },
  316. },{
  317. text: '可完工数',
  318. align: 'center',
  319. dataIndex: 'ma_canmadeqty',
  320. xtype: 'numbercolumn',
  321. width: 110,
  322. renderer : function(v, m, r) {
  323. return saas.util.BaseUtil.numberFormat(v, 6, true);
  324. },
  325. },{
  326. text: '制造类型',
  327. dataIndex: 'ma_kind',
  328. width: 100,
  329. },{
  330. text: '工作中心',
  331. dataIndex: 'ma_wcname',
  332. width: 100,
  333. },{
  334. text: '审核状态',
  335. dataIndex: 'ma_status',
  336. align: 'center',
  337. width: 100,
  338. },{
  339. text: '领料状态',
  340. dataIndex: 'ma_getstatus',
  341. align: 'center',
  342. width: 100,
  343. },{
  344. text: '完工状态',
  345. dataIndex: 'ma_finishstatus',
  346. align: 'center',
  347. width: 100,
  348. },{
  349. text: '制单人',
  350. dataIndex: 'creatorName',
  351. align: 'center',
  352. width: 100,
  353. },{
  354. text: '计划开工日期',
  355. dataIndex: 'ma_planbegindate',
  356. width: 130,
  357. xtype:'datecolumn'
  358. },{
  359. text: '计划完工日期',
  360. dataIndex: 'ma_planenddate',
  361. width: 130,
  362. xtype:'datecolumn'
  363. },{
  364. text: '实际开工日期',
  365. dataIndex: 'ma_actbegindate',
  366. width: 130,
  367. xtype:'datecolumn'
  368. },{
  369. text: '实际完工日期',
  370. dataIndex: 'ma_actenddate',
  371. width: 130,
  372. xtype:'datecolumn'
  373. },{
  374. text: '结案日期',
  375. dataIndex: 'ma_enddate',
  376. width: 130,
  377. xtype:'datecolumn'
  378. },{
  379. text: '备注',
  380. dataIndex: 'ma_remark',
  381. width: 100
  382. }],
  383. relativeColumn: []
  384. }
  385. });
  386. this.callParent(arguments);
  387. },
  388. });