You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/MvcShipping/Viewsjs/MsOpReceipt/ReceiptDocIndex.js

251 lines
8.4 KiB
JavaScript

Ext.namespace('Shipping');
Shipping.ReceiptDocIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.ReceiptDocIndex.superclass.constructor.call(this);
};
Date.prototype.format = function (format) {
var o = {
"M+": this.getMonth() + 1, //month
"d+": this.getDate(), //day
"h+": this.getHours(), //hour
"m+": this.getMinutes(), //minute
"s+": this.getSeconds(), //second
"q+": Math.floor((this.getMonth() + 3) / 3), //quarter
"S": this.getMilliseconds() //millisecond
}
if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
(this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o) if (new RegExp("(" + k + ")").test(format))
format = format.replace(RegExp.$1,
RegExp.$1.length == 1 ? o[k] :
("00" + o[k]).substr(("" + o[k]).length));
return format;
}
Ext.extend(Shipping.ReceiptDocIndex, Ext.Panel, {
ParentWin: null, //弹出式
ParentPanel: null, //Tab页编辑模式
OpStatus: 'add',
StoreBill: null,
StoreCustType: null,
EditRecord: null,
RefBillNo: '*',
DataLoading: true,
stroplb: '',
strBSNO: '',
_First: true,
BSNO:"",
initUIComponents: function () {
this.formname = "formReceiptDocIndex"; //页面名称
this.ReceiptDrSerialNo = 0;
this.ReceiptDrBodyDel = [];
this.Loading = true;
this.BSNO = getUrlParam('bsno');
//#region 明细表-单据图片档案管理
this.storeISOPEN = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeISOPEN.add({ "FSTATUS": "1", "NAME": "公开" });
this.storeISOPEN.add({ "FSTATUS": "0", "NAME": "不公开" });
this.comboxISOPEN = Ext.create('DsExt.ux.RefTableCombox', {
// fieldLabel: '海运费',
store: this.storeISOPEN,
valueField: 'FSTATUS',
displayField: 'NAME',
// flex: 0.7,
// labelWidth: 55,
forceSelection: true,
name: 'ISPUBLIC'
});
this.storeDocList = Ext.create('Ext.data.Store', {
model: 'ReceiptDocmb',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Import/ReceiptDoc/GetDocList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//明细表表格
this.DocListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.DocCM = Ext.create('Ext.selection.CheckboxModel');
this.gridDocList = new Ext.grid.GridPanel({
store: this.storeDocList,
enableHdMenu: false,
region: 'center',
// width: 350,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.DocListCellEditing],
selModel: this.DocCM,
selType: 'cellmodel',
tbar: [],
columns: [{
sortable: true, hidden: true,
dataIndex: 'GID',
header: 'GID',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'R_GID',
header: 'R_GID',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'BSNO',
header: 'BSNO',
width: 80
},
{
sortable: true,
dataIndex: 'URL',
header: '文件名',
width: 200
//,
//renderer: function (value, p, record) {
// //return '<a href="' + record.data.Driect_URL + '" target="_blank" style=' + '"text-decoration:none"' + ' >' + value + '</a>';
// value
//}
}, {
xtype: 'actioncolumn',
width: 50,
text: "预览",
items: [{
icon: '/images/icons/btnSearch.gif', // Use a URL in the icon config
tooltip: '预览',
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
//Direct_URL=../../UploadFiles/MsOpFiles/OP220700002/20220719151958331COSU 6339847700 BC中远.PDF
var filePath = rec.get('Driect_URL');
//var filePath = "/Areas/Account/Files/" + rec.get('BillNo') + '/' + rec.get('File_Name');
//imgView.show();
DsOpenEditWin(filePath, "", "650", "1250","300","500");
}
}]
},
{
sortable: true,
dataIndex: 'RECEIPTTYPE',
header: '附件类型',
width: 135
},
{
sortable: true, hidden: true,
dataIndex: 'Driect_URL',
header: 'Driect_URL',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'MODIFIEDUSER',
header: 'MODIFIEDUSER',
width: 80
},
{
sortable: true,
dataIndex: 'MODIFIEDUSERRef',
header: '上传人',
width: 80
},
{
sortable: true,
dataIndex: 'MODIFIEDTIME',
header: '上传时间',
width: 135
},
{
sortable: true,
dataIndex: 'DOCUMENTATTACHEDCODE',
header: '随附单证代码', //需求编号SR2017081100003
width: 120
},
{
sortable: true,
dataIndex: 'DOCUMENTATTACHEDNO',
header: '随附单证编号', //需求编号SR2017081100003
width: 120
}, {
sortable: true,
dataIndex: 'ISPUBLIC',
header: '是否公开',
editor: this.comboxISOPEN,
width: 80,
renderer: function (value, cellmeta) {
if (value == '1') {
return "公开";
} else return "不公开";
}
}
]
});
//this.storeDocList.on('beforeload', function (store) {
// var condition = _this.strBSNO;
// var condition2 = " BSNO='" + condition + "' ";
// Ext.apply(store.proxy.extraParams, { condition: condition2 });
//}, this);
this.panelDoc = new Ext.Panel({
id: "panelDoc",
layout: "border",
region: "center",
//autoScroll: true,
frame: false,
split: true,
items: [this.gridDocList]
});
//#endregion
//#region 布局
Ext.apply(this, {
items: [ this.panelDoc]
});
//#endregion
this.opStatus = 'add';
this.InitData();
}, //end initUIComponents
//#region 加载数据
InitData: function () {
var condition = '';
this.LoadData(this.opStatus, condition, this.RefBillNo);
}, //end InitData
LoadData: function (opstatus, condition, refbillno) {
this.opStatus = opstatus;
this.storeDocList.load({ params: { condition: " BSNO='" + this.BSNO + "'" } });
}, // end LoadDate
//#endregion
});