123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403 |
- Ext.define('make.view.make.makeDetail.QueryPanel_3', {
- extend: 'saas.view.core.query.QueryPanel',
- xtype: 'make-makedetail-querypanel-3',
- controller: 'make-makedetail-querypanel',
- viewModel: {
- extend: 'saas.view.core.query.QueryPanelModel',
- data: {
- form: {}, // 查询字段记录
- addEnable: false, // 显示新增按钮
- auditEnable: false, // 显示审核按钮
- printEnable: false, // 显示打印按钮
- importEnable: false, // 显示导入按钮
- exportEnable: true, // 显示导出按钮
- closeEnable: false, // 显示关闭按钮
- deleteEnable: false, // 显示删除按钮
- deleteDisable:false, //删除按钮是否可使用
-
- openAudit:false,//单独显示审核按钮
- openUnAudit:false,//单独显示反审核按钮
- openEnable:false, //显示开启 针对已取消列表
- configurable: true, // 允许列设置
-
- }
- },
- viewName: 'make-makedetail-querypanel-3',
- caller: 'MakeDetail',
- //importUploadPath: '/api/purchse/makereturn/saveToFormal',
- initComponent: function () {
- var me = this ;
- Ext.apply(this, {
- queryFormItems: [{
- xtype: 'condatefield',
- name: 'make.createTime',
- fieldLabel: '日期',
- columnWidth: 0.5,
- operation: 'between',
- },{
- xtype: 'multiqueryField',
- columnWidth: 0.4,
- name: 'multi_query',
- querys: {
- "MakeCode": {"field": "ma_code" ,"desc": "制造单号"},
- "BillCode": {"field": "ma_salecode" ,"desc": "订单号"},
- "Cust": {"field": "ma_custcode" ,"desc": "客户"},
- "Prod": {"field": "ma_prodcode", "dbfinds": [{//物料
- from: 'pr_code',
- to: 'ma_prodcode'
- },{
- from: 'pr_detail',
- to: 'pr_detail'
- }]},
- "Emp":{"field": "prodinout.creatorName", "dbfinds": [{
- from: 'em_name',
- to: 'prodinout.creatorName'
- }]},
- },
- setShowDetail: function(v){
- this.showDetail = false;
- }
- }],
- moreQueryFormItems: [{
- xtype: 'saledetailDbfindTrigger',
- name: 'ma_salecode',
- fieldLabel: '订单编号'
- },{
- xtype: "customerDbfindTrigger",
- name: "ma_custname",
- fieldLabel: "客户名称",
- },{
- xtype: 'condatefield',
- name: 'ma_delivery',
- fieldLabel: '交货日期',
- value:7,
- columnWidth: 1
- },{
- xtype: 'productDbfindTrigger',
- name: 'ma_prodcode',
- fieldLabel: '物料编号'
- },{
- xtype: 'textfield',
- name: 'pr_detail',
- fieldLabel: '产品名称',
- readOnly: true,
- getCondition: function(value) {
- if(!value) {
- return '1=1';
- }else {
- return 'p.pr_detail like\'%' + value + '%\'';
- }
- }
- }, {
- xtype: 'textfield',
- name: 'pr_orispeccode',
- fieldLabel: '产品型号',
- readOnly: true,
- getCondition: function(value) {
- if(!value) {
- return '1=1';
- }else {
- return 'p.pr_orispeccode like\'%' + value + '%\'';
- }
- }
- }, {
- xtype: "remotecombo",
- name: "pr_brand",
- fieldLabel: "厂家/品牌",
- storeUrl: '/api/document/productbrand/getCombo',
- editable: false,
- hiddenBtn:true,
- getCondition: function(value) {
- if(!value) {
- return '1=1';
- }else {
- return 'p.pr_brand like\'%' + value + '%\'';
- }
- }
- },{
- xtype: "remotecombo",
- name: "ma_kind",
- fieldLabel: "制造类型",
- storeUrl:'/api/make/kind/list/make',
- valueField:'mk_name',
- displayField: 'mk_name',
- editable: false,
- hiddenBtn:true
- },{
- xtype: 'remotecombo',
- name: "ma_wcname",
- fieldLabel: "工作中心",
- storeUrl: '/api/document/workcenter/getCombo',
- editable: false,
- hiddenBtn:true
- },{
- xtype: 'combobox',
- name: 'ma_statuscode',
- fieldLabel: '审核状态',
- queryMode: 'local',
- displayField: 'ma_status',
- valueField: 'ma_statuscode',
- emptyText :'全部',
- editable:false,
- store: Ext.create('Ext.data.ArrayStore', {
- fields: ['ma_statuscode', 'ma_status'],
- data: [
- ["ALL", "全部"],
- ["AUDITED", "已审核"],
- ["UNAUDITED", "未审核"]
- ]
- }),
- getCondition: function(value) {
- if(value == 'ALL') {
- return '1=1';
- }else {
- return 'ma_statuscode=\'' + value + '\'';
- }
- }
- }, {
- xtype: 'employeeDbfindTrigger',
- name: 'creatorName',
- fieldLabel: '录入人',
- emptyText:'请输入账户名称或姓名',
- getCondition: function(value) {
- if(!value) {
- return '1=1';
- }else {
- return 'make.creatorName like\'%' + value + '%\'';
- }
- }
- },{
- xtype: 'condatefield',
- name: 'ma_planbegindate',
- fieldLabel: '计划开工日期',
- value:7,
- columnWidth: 1
- },{
- xtype: 'condatefield',
- name: 'ma_planenddate',
- fieldLabel: '计划完工日期',
- value:7,
- columnWidth: 1
- },{
- xtype: 'condatefield',
- name: 'make.createTime',
- fieldLabel: '录入日期',
- value:7,
- columnWidth: 1
- }, {
- xtype: 'employeeDbfindTrigger',
- name: 'ma_auditman',
- fieldLabel: '审核人',
- emptyText:'请输入账户名称或姓名',
- }],
- queryGridConfig: {
- idField: 'ma_id',
- codeField: 'ma_code',
- mainIdField:'ma_id',
- detailIdField:'mm_id',
- addTitle: '制造单',
- addXtype: 'make-makebase-formpanel',
- baseVastUrl:me.baseVastUrl,
- defaultCondition: me.defaultCondition,
- caller: me.caller,
- useGridCaller :true,
- toolBtns: [{
- text: '转退料',
- xtype: 'button',
- handler: 'turnBack'
- },{
- text: '转报废',
- xtype: 'button',
- handler: 'turnScrap'
- }],
- groupField:'ma_code',
- groupHeaderTpl: Ext.create('Ext.XTemplate',
- '<div class="groupHeaderTpl" style="margin:0px 0px 0px 100px">',
- '<span style="width:250px">制造单号:{[values.rows[0].data.ma_code]}</span>',
- '<span style="width:200px">销售单号:{[values.rows[0].data.ma_salecode]}</span>',
- '<span style="width:280px">客户名称:{[values.rows[0].data.ma_custname]}</span>',
- '<span style="width:200px">产品编号:{[values.rows[0].data.ma_prcode]}</span>',
- '<span style="width:200px">产品型号:{[values.rows[0].data.ma_prorispeccode]}</span>',
- '<span style="width:140px">数量:{[values.rows[0].data.ma_qty]}</span>',
- '<span style="width:140px">已完工数:{[values.rows[0].data.ma_madeqty]}</span>',
- '</div>'
- ),
- onGroupClick: function(view, group, idx, e){
- if(e.target && e.target.nodeName == 'A'){
- var grid = view.up('grid'),
- rec = e.record,
- idValue = rec.get('ma_id'),
- codeValue = rec.get('ma_code');
- saas.util.BaseUtil.openTab(grid.addXtype, grid.addTitle+"("+codeValue+")", grid.addXtype + '-' + idValue, {
- initId: idValue
- });
- }
- },
- baseColumn: [{
- text: 'id',
- dataIndex: 'ma_id',
- hidden: true,
- xtype: 'numbercolumn'
- },{
- text: '交货日期',
- dataIndex: 'ma_delivery',
- hidden: true,
- },{
- text: '产品名称',
- dataIndex: 'ma_prdetail',
- hidden: true,
- },{
- text: '产品规格',
- dataIndex: 'ma_prspec',
- hidden: true,
- },{
- text: '本次数量',
- align: 'center',
- dataIndex: 'mm_thisqty',
- xtype: 'widgetcolumn',
- width: 110,
- /* renderer : function(val, meta, record, x, y, store, view) {
- var data = record.data;
- v = data.sd_qty-data.sd_yqty;
- if(!val){
- val=v;
- }
- var maxValue=(data.sd_qty-data.sd_yqty);
- val =Ext.Number.from(val,maxValue);
- if(val> maxValue){
- val = maxValue;
- saas.util.BaseUtil.showErrorToast('请不要输入超过最大数量' + maxValue + "的值!");
- }
- record.data['this_yqty']=val;
- return val;
- }, */
- widget: {
- xtype: "numberfield",
- cls:'widget-number',
- bind: '{record.mm_thisqty}',
- decimalPrecision: 6,
- minValue: 0,
- listeners:{
- blur: function(f ,event, e){
- var record = f.lookupViewModel().data.record,
- maxVal,nowVal;
- if(record){
- if(!Ext.isEmpty(record.modified['mm_thisqty'])){ //若存在修改
- maxVal = record.modified['mm_thisqty'];
- nowVal = f.value;
- if(Ext.isEmpty(nowVal)){
- record.set('mm_thisqty', maxVal)
- }else if(nowVal>maxVal){
- record.set('mm_thisqty', maxVal)
- saas.util.BaseUtil.showErrorToast('请不要输入超过最大数量' + maxVal + "的值!");
- }
- }
- }
- }
- }
- }
- },{
- text: '工单序号',
- dataIndex: 'mm_detno',
- align: 'center',
- width: 80
- },{
- text: '物料编号',
- dataIndex: 'mm_prodcode',
- width: 150
- },{
- text: '物料名称',
- dataIndex: 'pr_detail',
- width: 150
- },{
- text: '物料规格',
- dataIndex: 'pr_desc',
- width: 150
- },{
- text: '单位',
- align: 'center',
- dataIndex: 'pr_unit',
- width: 80
- },{
- text: '单位用量',
- align: 'center',
- dataIndex: 'mm_oneuseqty',
- width: 80
- },{
- text: '需求数',
- align: 'center',
- dataIndex: 'ma_qty',
- xtype: 'numbercolumn',
- width: 110,
- renderer : function(v, m, r) {
- return saas.util.BaseUtil.numberFormat(v, 6, true);
- },
- },{
- text: '已领数',
- align: 'center',
- dataIndex: 'mm_havegetqty',
- xtype: 'numbercolumn',
- width: 110,
- renderer : function(v, m, r) {
- return saas.util.BaseUtil.numberFormat(v, 6, true);
- },
- },{
- text: '未领数',
- align: 'center',
- dataIndex: 'mm_restgetqty',
- xtype: 'numbercolumn',
- width: 110,
- renderer : function(v, m, r) {
- v = r.get('mm_qty') + (r.get('mm_scrapqty')||0) - (r.get('mm_havegetqty')||0);
- return saas.util.BaseUtil.numberFormat(v, 6, true);
- }
- },{
- text: '制程不良数',
- align: 'center',
- dataIndex: 'mm_returnmqty',
- xtype: 'numbercolumn',
- width: 110,
- renderer : function(v, m, r) {
- return saas.util.BaseUtil.numberFormat(v, 6, true);
- },
- },{
- text: '已转退料数',
- align: 'center',
- dataIndex: 'mm_turnbackqty',
- xtype: 'numbercolumn',
- width: 110,
- renderer : function(v, m, r) {
- return saas.util.BaseUtil.numberFormat(v, 6, true);
- },
- },{
- text: '报废数',
- align: 'center',
- dataIndex: 'mm_turnscrapqty',
- xtype: 'numbercolumn',
- width: 110,
- renderer : function(v, m, r) {
- return saas.util.BaseUtil.numberFormat(v, 6, true);
- },
- },{
- text: '已转报废数',
- align: 'center',
- dataIndex: 'mm_turnscrapqty',
- xtype: 'numbercolumn',
- width: 110,
- renderer : function(v, m, r) {
- return saas.util.BaseUtil.numberFormat(v, 6, true);
- },
- },{
- text: '备注',
- dataIndex: 'ma_remark',
- width: 100
- }],
- relativeColumn: []
- }
- });
- this.callParent(arguments);
- },
- });
|