Ext.define('make.view.osmake.osMakeCheckIn.QueryPanel_3', {
extend: 'saas.view.core.query.QueryPanel',
xtype: 'osmake-osmakecheckin-querypanel-3',
controller: 'osmake-osmakecheckin-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,//单独显示反审核按钮
cancelEnable:false, //单独显示取消
openEnable:false, //显示开启 针对已取消列表
configurable: true, // 允许列设置
}
},
viewName: 'osmake-osmakecheckin-querypanel',
caller: 'OsMakeIn',
//importUploadPath: '/api/osmake/osmakecheckin/saveToFormal',
initComponent: function () {
var me = this;
Ext.apply(me, {
queryFormItems: [ {
xtype: 'condatefield',
name: 'pi_date',
fieldLabel: '日期',
columnWidth: 0.5,
value: '7',
operation: 'between',
},{
xtype: 'multiqueryField',
columnWidth: 0.4,
name: 'multi_query',
querys: {
"Vend":{"field": "pi_vendname", "dbfinds": [{//仓库
from: 've_name',
to: 'pi_vendname'
}]},
"BillCode": {"field": "pi_inoutno" ,"desc": "验收单号"},
"MakeCode": {"field": "prodiodetail.pd_ordercode" ,"desc": "外协单号"},
"Prod": {"field": "pr_code", "dbfinds": [{//物料
from: 'pr_code',
to: 'pr_code'
},{
from: 'pr_detail',
to: 'pr_detail'
}]},
"Emp":{"field": "prodinout.creatorName", "dbfinds": [{
from: 'em_name',
to: 'prodinout.creatorName'
}]},
},
setShowDetail: function(v){
this.showDetail = (v == 'Prod' ||v=='MakeCode');
},
}],
moreQueryFormItems: [{
xtype: 'condatefield',
name: 'pi_date',
fieldLabel: '单据日期',
columnWidth: 1
},{
xtype: 'vendorDbfindTrigger',
name: 'pi_vendname',
fieldLabel: '外协厂商'
},{
xtype: 'combobox',
name: 'pi_currency',
fieldLabel: '币别',
queryMode: 'local',
displayField: 'pi_currency',
valueField: 'pi_currency',
emptyText :'',
editable:false,
store: Ext.create('Ext.data.ArrayStore', {
fields: ['pi_currency', 'pi_currency'],
data: [
["RMB", "RMB"],
["USD", "USD"],
["HKD", "HKD"]
]
}),
getCondition: function(value) {
if(!value) {
return '1=1';
}else {
return 'pi_currency=\'' + value + '\'';
}
}
},{
xtype: 'warehouseDbfindTrigger',
name: 'pi_whname',
fieldLabel: '仓库'
},{
xtype: 'productDbfindTrigger',
name: 'prodiodetail.pd_prodcode',
showDetail: true,
fieldLabel: '物料编号'
},{
xtype: 'textfield',
name: 'pr_detail',
fieldLabel: '产品名称',
readOnly: true,
}, {
xtype: 'textfield',
name: 'pr_orispeccode',
fieldLabel: '产品型号',
readOnly: true,
}, {
editable: false,
xtype: "remotecombo",
storeUrl: '/api/document/productbrand/getCombo',
name: "pr_brand",
fieldLabel: "厂家/品牌",
hiddenBtn:true
},{
xtype: 'combobox',
name: 'pi_statuscode',
fieldLabel: '审核状态',
queryMode: 'local',
displayField: 'pi_status',
valueField: 'pi_statuscode',
emptyText :'全部',
editable:false,
store: Ext.create('Ext.data.ArrayStore', {
fields: ['pi_statuscode', 'pi_status'],
data: [
["ALL", "全部"],
["AUDITED", "已审核"],
["UNAUDITED", "未审核"]
]
}),
getCondition: function(value) {
if(value == 'ALL') {
return '1=1';
}else {
return 'pi_statuscode=\'' + value + '\'';
}
}
}, {
xtype: 'employeeDbfindTrigger',
name: 'creatorName',
fieldLabel: '录入人',
emptyText:'请输入账户名称或姓名',
getCondition: function(value) {
if(!value) {
return '1=1';
}else {
return 'prodinout.creatorName like\'%' + value + '%\'';
}
}
}, {
xtype: 'employeeDbfindTrigger',
name: 'pi_auditman',
fieldLabel: '审核人',
emptyText:'请输入账户名称或姓名',
}],
queryGridConfig: {
idField: 'id',
codeField: 'pi_inoutno',
mainIdField:'_id',
detailIdField:'pd_id',
addTitle: me.addTitle,
addXtype: me.addXtype,
defaultCondition: me.defaultCondition,
baseVastUrl: me.baseVastUrl,
groupField: 'vendname_currency',
groupHeaderTpl: Ext.create('Ext.XTemplate',
'
'
),
openTab:function(record,codeValue,idValue){
if(record.get('pi_class')=='OSMAKEIN'){
openXtype = 'osmake-osmakecheckin-formpanel';
addTitle = '外协验收';
}else{
openXtype = 'osmake-osmakecheckreturn-formpanel';
addTitle = '外协验退';
}
id = openXtype + '-' + idValue;
saas.util.BaseUtil.openTab(openXtype, addTitle+"("+codeValue+")", id, {
initId: idValue
});
},
onGroupClick: function(view, group, idx, e){
},
caller: 'OsMakeIn',
toolBtns: [{
xtype: 'button',
text: '对账',
handler: 'turnApCheck'
}],
baseColumn: [{
text: 'id',
dataIndex: 'id',
hidden: true,
xtype: 'numbercolumn'
}, {
text: '入库单号',
dataIndex: 'pi_inoutno',
width: 150
},{
text: '供应商币别',
dataIndex: 'vendname_currency',
hidden:true
}, {
text: '单据类型',
dataIndex: 'pi_class',
hidden: true
}, {
text: '单据日期',
dataIndex: 'pi_date',
xtype: 'datecolumn',
width: 110
}, {
text: '供应商名称',
dataIndex: 'pi_vendname',
width: 200
}, {
text: '金额(元)',
xtype: 'numbercolumn',
dataIndex: 'pi_nettotal',
width: 110,
renderer: function(v, m, r) {
let inqty=r.get('pd_inqty');
inqty= inqty==null ? 0: inqty;
if(inqty>0){
return saas.util.BaseUtil.numberFixFormat(v,2, true);
}else{
return saas.util.BaseUtil.numberFixFormat((0-v),2, true);
}
}
}, {
text: '价税合计(元)',
xtype: 'numbercolumn',
dataIndex: 'pi_total',
width: 110,
renderer: function(v, m, r) {
let inqty=r.get('pd_inqty');
inqty= inqty==null ? 0: inqty;
if(inqty>0){
return saas.util.BaseUtil.numberFixFormat(v,2, true);
}else{
return saas.util.BaseUtil.numberFixFormat((0-v),2, true);
}
}
}, {
text: '币种',
dataIndex: 'pi_currency',
align: 'center',
width: 65
}, {
text: '审核状态',
align: 'center',
dataIndex: 'pi_status',
width: 80
}, {
text: '付款状态',
align: 'center',
dataIndex: 'pi_prstatus',
width: 80
}, {
text: '关联委协工单号',
dataIndex: 'pd_ordercode',
width: 150
}, {
text: '备注',
dataIndex: 'pi_remark',
width: 250
}],
relativeColumn: [{
text: 'id',
dataIndex: 'id',
xtype: 'numbercolumn',
hidden: true
},{
text: '供应商币别',
dataIndex: 'vendname_currency',
hidden:true
},{
text: 'pd_id',
dataIndex: 'pd_id',
xtype: 'numbercolumn',
hidden: true
}, {
text: '入库单号',
dataIndex: 'pi_inoutno',
width: 150,
exportStyle:{
width: 150
}
}, {
text: '单据日期',
dataIndex: 'pi_date',
xtype: 'datecolumn',
hidden:true,
exportStyle:{
width: 110
}
}, {
text: '供应商名称',
dataIndex: 'pi_vendname',
hidden:true,
exportStyle:{
width: 200
}
},{
text: '币种',
dataIndex: 'pi_currency',
align: 'center',
hidden:true,
exportStyle:{
width: 65
}
},{
text: '序号',
dataIndex: 'pd_pdno',
xtype: 'numbercolumn',
align:'center',
width: 60,
renderer : function(v, m, r) {
return saas.util.BaseUtil.numberFormat(v, 0, false);
},
}, {
text: '物料名称',
dataIndex: 'pr_detail',
width: 150
}, {
text: '型号',
dataIndex: 'pr_orispeccode',
width: 200,
renderer: saas.util.RenderUtil['renderer_prod']
}, {
text: '入库数',
dataIndex: 'pd_inqty',
xtype: 'numbercolumn',
width: 110,
renderer: function(v, m, r) {
let outqty=r.get('pd_outqty'),
inqty=r.get('pd_inqty');
inqty= inqty==null ? 0: inqty;
outqty= outqty==null ? 0: outqty;
return saas.util.BaseUtil.numberFormat((inqty-outqty), 6, true);
}
}, {
text: '类型',
dataIndex: 'pi_class',
width: 110,
renderer: function(v) {
if(v=="OSMAKEIN"){
return "外协验收";
}else if(v=="OSMAKEINBACK"){
return "外协验退";
}else if(v=="ESTIMATE"){
return "应付暂估";
}else{
return v;
}
}
}, {
text: '物料编号',
dataIndex: 'pr_code',
width: 150
}, {
text: '厂家/品牌',
dataIndex: 'pr_brand',
width: 100
}, {
text: '规格',
dataIndex: 'pr_spec',
width: 200
}, {
text: '不含税单价(元)',
dataIndex: 'pd_netprice',
xtype: 'numbercolumn',
renderer: function(v, m, r) {
return saas.util.BaseUtil.numberFormat(v, 8, true);
},
width: 110
}, {
text: '含税单价(元)',
dataIndex: 'pd_orderprice',
xtype: 'numbercolumn',
renderer: function(v, m, r) {
return saas.util.BaseUtil.numberFormat(v, 8, true);
},
width: 110
}, {
text: '不含税金额(元)',
dataIndex: 'pd_nettotal',
xtype: 'numbercolumn',
width: 110,
renderer: function(v, m, r) {
let inqty=r.get('pd_inqty');
inqty= inqty==null ? 0: inqty;
if(inqty>0){
return saas.util.BaseUtil.numberFixFormat(v,2, true);
}else{
return saas.util.BaseUtil.numberFixFormat((0-v),2, true);
}
},
}, {
text: '关联委协工单号',
dataIndex: 'pd_ordercode',
width: 150
}, {
text: '备注',
dataIndex: 'pd_remark',
width: 250
}]
}
});
this.callParent(arguments);
},
getQueryMode: function () {
return 'DETAIL';
}
});