|
|
@@ -19,15 +19,18 @@
|
|
|
@resetColumn="resetColumnTwo('documentCrud', 'documentOption', 'documentOptionBack', 312.1)"
|
|
|
@saveColumn="saveColumnTwo('documentCrud', 'documentOption', 'documentOptionBack', 312.1)">
|
|
|
<template slot="menuLeft">
|
|
|
- <el-button type="primary" size="small" icon="el-icon-plus" :disabled="disabled"
|
|
|
+<!-- :disabled="disabled"-->
|
|
|
+ <el-button type="primary" size="small" icon="el-icon-plus"
|
|
|
@click="addbtnfun()">新增
|
|
|
</el-button>
|
|
|
<spa style="color: #d4791a; " v-text="'单证类别:' + (businesstypeData && businesstypeData.label ? businesstypeData.label : '未选择')"></spa>
|
|
|
</template>
|
|
|
<template slot-scope="scope" slot="menu">
|
|
|
- <el-button type="text" size="small" :disabled="disabled"
|
|
|
+<!-- :disabled="disabled"-->
|
|
|
+ <el-button type="text" size="small"
|
|
|
@click="printEditing(scope.row)">编辑</el-button>
|
|
|
- <el-button type="text" size="small" :disabled="disabled" @click="printDelete(scope.row)">
|
|
|
+<!-- :disabled="disabled"-->
|
|
|
+ <el-button type="text" size="small" @click="printDelete(scope.row)">
|
|
|
<span v-if="disabled">删除</span>
|
|
|
<span v-else style="color: red">删除</span>
|
|
|
</el-button>
|
|
|
@@ -99,8 +102,14 @@ import {
|
|
|
getList,
|
|
|
getDocumentTypesList,
|
|
|
getDocumentTypesListAll,
|
|
|
+ buildExportFileName,
|
|
|
} from "@/api/iosBasicData/reports";
|
|
|
-import { reportslogList, reportslogSubmit } from "@/api/iosBasicData/bills";
|
|
|
+import {
|
|
|
+ reportslogList,
|
|
|
+ reportslogSubmit,
|
|
|
+ getReportslogPrintCount,
|
|
|
+ addReportPrintCount,
|
|
|
+} from "@/api/iosBasicData/bills";
|
|
|
import { bbusinesstypeList } from "@/api/iosBasicData/bbusinesstype";
|
|
|
import bbusinesstype from "@/views/iosBasicData/bbusinesstype/index.vue";
|
|
|
import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
|
|
|
@@ -165,15 +174,15 @@ export default {
|
|
|
trigger: "blur"
|
|
|
}]
|
|
|
},
|
|
|
- {
|
|
|
- label: "报表编码",
|
|
|
- prop: "code",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入报表编码",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // label: "报表编码",
|
|
|
+ // prop: "code",
|
|
|
+ // rules: [{
|
|
|
+ // required: true,
|
|
|
+ // message: "请输入报表编码",
|
|
|
+ // trigger: "blur"
|
|
|
+ // }]
|
|
|
+ // },
|
|
|
{
|
|
|
label: "中文名称",
|
|
|
prop: "cnName",
|
|
|
@@ -188,14 +197,18 @@ export default {
|
|
|
prop: "enName"
|
|
|
},
|
|
|
{
|
|
|
- label: "报表格式",
|
|
|
- prop: "content",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入报表格式",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
+ label: "已打印次数",
|
|
|
+ prop: "printCount"
|
|
|
},
|
|
|
+ // {
|
|
|
+ // label: "报表格式",
|
|
|
+ // prop: "content",
|
|
|
+ // rules: [{
|
|
|
+ // required: true,
|
|
|
+ // message: "请输入报表格式",
|
|
|
+ // trigger: "blur"
|
|
|
+ // }]
|
|
|
+ // },
|
|
|
{
|
|
|
label: "备注",
|
|
|
prop: "remarks"
|
|
|
@@ -445,7 +458,8 @@ export default {
|
|
|
const data = await this.PreviewOnLoad(this.PreviewPage, {
|
|
|
businessType: 'HYCK',
|
|
|
classifyCode: '单证',
|
|
|
- groupCode: row.groupCode == '提单详情(H)' ? '提单详情' : row.groupCode
|
|
|
+ groupCode: row.groupCode == '提单详情(H)' ? '提单详情' : row.groupCode,
|
|
|
+ logId: row.id,
|
|
|
});
|
|
|
this.$nextTick(() => {
|
|
|
if (data.length == 1) {
|
|
|
@@ -511,12 +525,14 @@ export default {
|
|
|
this.PreviewOnLoad(this.PreviewPage, {
|
|
|
businessType: 'HYCK',
|
|
|
classifyCode: '单证',
|
|
|
- groupCode: this.editData.groupCode
|
|
|
+ groupCode: this.editData.groupCode,
|
|
|
+ logId: this.editData.id,
|
|
|
});
|
|
|
},
|
|
|
PreviewSearchChange(params, done) {
|
|
|
this.PreviewQuery = params;
|
|
|
this.PreviewPage.currentPage = 1;
|
|
|
+ params.logId=this.editData.id,
|
|
|
this.PreviewOnLoad(this.PreviewPage, params);
|
|
|
done();
|
|
|
},
|
|
|
@@ -530,7 +546,8 @@ export default {
|
|
|
this.PreviewOnLoad(this.PreviewPage, {
|
|
|
businessType: 'HYCK',
|
|
|
classifyCode: '单证',
|
|
|
- groupCode: this.editData.groupCode
|
|
|
+ groupCode: this.editData.groupCode,
|
|
|
+ logId: this.editData.id,
|
|
|
});
|
|
|
},
|
|
|
// 打印预览弹窗数据
|
|
|
@@ -543,8 +560,6 @@ export default {
|
|
|
},
|
|
|
// 新建单证按钮
|
|
|
addbtnfun() {
|
|
|
- console.log("this.businesstypeData", this.businesstypeData)
|
|
|
-
|
|
|
if (!this.assemblyForm.id) {
|
|
|
this.$message.warning("请先保存数据");
|
|
|
return;
|
|
|
@@ -556,10 +571,12 @@ export default {
|
|
|
this.addShow = false
|
|
|
reportsGetReportData({
|
|
|
billId: this.assemblyForm.id,
|
|
|
+ businessType: this.assemblyForm.businessType,
|
|
|
reportCode: this.businesstypeData.classifyCode,
|
|
|
groupCode: this.businesstypeData.groupCode,
|
|
|
reportsType: this.businesstypeData.reportsType,
|
|
|
type: 'HYCK',
|
|
|
+ allowCreateCount: this.businesstypeData.allowCreateCount,
|
|
|
params: this.businesstypeData.params,
|
|
|
}).then(res => {
|
|
|
this.editData.groupCode = this.businesstypeData.groupCode
|
|
|
@@ -576,7 +593,6 @@ export default {
|
|
|
},
|
|
|
focusBusinesstypeData(row){
|
|
|
var bus = this.reportTypeData.find(b=>b.groupCode==row.groupCode && b.reportsType==row.reportsCode)
|
|
|
- console.log('bus', bus)
|
|
|
this.businesstypeData = bus ? bus : {}
|
|
|
},
|
|
|
// 编辑
|
|
|
@@ -613,7 +629,7 @@ export default {
|
|
|
if (this.editData.id) {
|
|
|
obj = this.editData
|
|
|
} else {
|
|
|
- obj.remarks = this.assemblyForm.remarks
|
|
|
+ // obj.remarks = this.assemblyForm.remarks
|
|
|
obj.businessType = this.assemblyForm.businessType
|
|
|
obj.billId = this.assemblyForm.id
|
|
|
obj.billNo = this.assemblyForm.billNo
|
|
|
@@ -622,21 +638,22 @@ export default {
|
|
|
obj.reportsCode = this.businesstypeData.reportsType
|
|
|
obj.groupCode = this.businesstypeData.groupCode
|
|
|
obj.reportsType = this.businesstypeData.reportsType
|
|
|
+ obj.allowPrintCount = 0
|
|
|
+ obj.printCount = 0
|
|
|
}
|
|
|
- console.log(this.documentForm)
|
|
|
obj.printContent = JSON.stringify({
|
|
|
data: {
|
|
|
...this.documentForm,
|
|
|
- to: this.documentForm.corpCnName,
|
|
|
- attn: this.documentForm.corpAttnName,
|
|
|
+ // to: this.documentForm.corpCnName,
|
|
|
+ // attn: this.documentForm.corpAttnName,
|
|
|
fm: this.documentForm.createUserName,
|
|
|
fax: this.documentForm.fax,
|
|
|
cc: this.documentForm.cc,
|
|
|
- email: this.documentForm.ematl,
|
|
|
+ email: this.documentForm.email,
|
|
|
department: this.documentForm.corpAttnName,
|
|
|
operate: this.documentForm.operatorName,
|
|
|
mobilePhone: this.documentForm.mobilePhone,
|
|
|
- remarks: this.documentForm.remarks,
|
|
|
+ // remarks: this.documentForm.remarks,
|
|
|
contacts: this.documentForm.cyContacts,
|
|
|
deliverylocation: this.documentForm.cyCnName,
|
|
|
shippingAgency: this.documentForm.bookingAgentCnName,
|
|
|
@@ -645,7 +662,6 @@ export default {
|
|
|
}
|
|
|
// url:this.documenturl
|
|
|
})
|
|
|
- console.log(obj)
|
|
|
// 保存
|
|
|
reportslogSubmit(obj).then(res => {
|
|
|
if (type) {
|
|
|
@@ -801,6 +817,9 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this.loading = true;
|
|
|
+ if(this.businesstypeData && this.businesstypeData.reportsType){
|
|
|
+ params = {...params, reportsType: this.businesstypeData.reportsType}
|
|
|
+ }
|
|
|
reportslogList(documentPage.currentPage, documentPage.pageSize, {
|
|
|
...Object.assign(params, this.query),
|
|
|
billId: this.assemblyForm.id
|
|
|
@@ -894,11 +913,9 @@ export default {
|
|
|
|
|
|
return lines
|
|
|
},
|
|
|
- handleReportPreview(row, url, data) {
|
|
|
+ async handleReportPreview(row, url, data) {
|
|
|
let rptType = this.reportTypeData.find(r=>r.groupCode == row.groupCode)
|
|
|
- console.log('rptType', rptType)
|
|
|
- // console.log(url, 1670)
|
|
|
- // console.log(data, 1671)
|
|
|
+
|
|
|
// 处理时间
|
|
|
data.end = data.end ? data.end.slice(0, 10) : ''
|
|
|
data.goodsTime = data.goodsTime ? data.goodsTime.slice(0, 10) : ''
|
|
|
@@ -934,13 +951,8 @@ export default {
|
|
|
// 是创建一个 Stimulsoft 报表查看器的实例的代码
|
|
|
let viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false)
|
|
|
|
|
|
- // 报表
|
|
|
- console.log("创建一个报表实例");
|
|
|
- console.log()
|
|
|
let report = new window.Stimulsoft.Report.StiReport();
|
|
|
|
|
|
- // 加载文件
|
|
|
- console.log("从url加载报表");
|
|
|
// report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
|
|
|
report.load(url)
|
|
|
|
|
|
@@ -1038,14 +1050,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
*/
|
|
|
- console.log('rptType.params', rptType.params)
|
|
|
if(rptType && rptType.params){
|
|
|
let m = rptType.params.marks
|
|
|
if(m){
|
|
|
- console.log('rptType.params.marks', m)
|
|
|
if(m.lineLength && m.lineLength>0){
|
|
|
data.marks = this.formatBLText(data.marks, m.lineLength).join('\n')
|
|
|
- console.log('data.marks', data.marks)
|
|
|
}
|
|
|
if(m.lineCount && m.lineCount>0){
|
|
|
var lns1=data.marks.split(/\r\n|\r|\n/)
|
|
|
@@ -1054,15 +1063,12 @@ export default {
|
|
|
data.largeMarks = data.marks
|
|
|
data.marks = " SEE ATTACHED PAPER"
|
|
|
}
|
|
|
- console.log('data.marks.lns1', lns1.Count)
|
|
|
}
|
|
|
}
|
|
|
m = rptType.params.commodityDescr
|
|
|
if(m){
|
|
|
- console.log('rptType.params.commodityDescr', m)
|
|
|
if(m.lineLength && m.lineLength>0){
|
|
|
data.commodityDescr = this.formatBLText(data.commodityDescr, m.lineLength).join('\n')
|
|
|
- console.log('data.commodityDescr', data.marks)
|
|
|
}
|
|
|
if(m.lineCount && m.lineCount>0){
|
|
|
var lns1=data.commodityDescr.split(/\r\n|\r|\n/)
|
|
|
@@ -1071,13 +1077,10 @@ export default {
|
|
|
data.largeCommodityDescr = data.commodityDescr
|
|
|
data.commodityDescr = " SEE ATTACHED PAPER"
|
|
|
}
|
|
|
- console.log('data.commodityDescr.lns1', lns1.Count)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // console.log(data.hshipperDetails, 'hshipperDetails2')
|
|
|
-
|
|
|
// 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
|
|
|
var dataSet = new Stimulsoft.System.Data.DataSet(
|
|
|
'reportData'
|
|
|
@@ -1093,6 +1096,53 @@ export default {
|
|
|
// 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
|
|
|
viewer.report = report;
|
|
|
|
|
|
+ let printData = this.editData
|
|
|
+ let printRow = row
|
|
|
+
|
|
|
+ viewer.los={
|
|
|
+ logId: printData.id,
|
|
|
+ reportId: printRow.id,
|
|
|
+ allowPrintCount: printRow.allowPrintCount,
|
|
|
+ printCount: 0,
|
|
|
+ canPrint: printRow.allowPrintCount>=0,
|
|
|
+ fileName: buildExportFileName(printRow, printData),
|
|
|
+ }
|
|
|
+
|
|
|
+ if(printRow.allowPrintCount>0) {
|
|
|
+ let pc = await getReportslogPrintCount(printData.id, printRow.id)
|
|
|
+ viewer.los.printCount = pc.data.data.count
|
|
|
+ viewer.los.canPrint = pc.data.data.canPrint
|
|
|
+ }
|
|
|
+
|
|
|
+ viewer.onPrintReport = function (sender, args){
|
|
|
+ sender.preventDefault = !viewer.los.canPrint
|
|
|
+
|
|
|
+ if(viewer.los.allowPrintCount>0){
|
|
|
+ addReportPrintCount(viewer.los.logId, viewer.los.reportId)
|
|
|
+ viewer.los.printCount += 1
|
|
|
+ viewer.los.canPrint = viewer.los.allowPrintCount==0 || viewer.los.printCount<viewer.los.allowPrintCount
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ viewer.onBeginExportReport = async (args) => {
|
|
|
+ // if (args.format == Stimulsoft.Report.StiExportFormat.Pdf)
|
|
|
+ // args.settings.imageQuality = 0.5;
|
|
|
+ args.preventDefault= !viewer.los.canPrint
|
|
|
+ }
|
|
|
+
|
|
|
+ viewer.onEndExportReport = async (args) => {
|
|
|
+ // args.fileName = "SampleFileName.txt";
|
|
|
+ // args.preventDefault=true
|
|
|
+ if(viewer.los.fileName){
|
|
|
+ args.fileName = viewer.los.fileName;
|
|
|
+ }
|
|
|
+ if(viewer.los.allowPrintCount>0){
|
|
|
+ addReportPrintCount(viewer.los.logId, viewer.los.reportId)
|
|
|
+ viewer.los.printCount += 1
|
|
|
+ viewer.los.canPrint = viewer.los.allowPrintCount==0 || viewer.los.printCount<viewer.los.allowPrintCount
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
this.$refs.reportContainer.showContainer(
|
|
|
() => {
|
|
|
setTimeout(() => {
|
|
|
@@ -1104,7 +1154,6 @@ export default {
|
|
|
|
|
|
},
|
|
|
)
|
|
|
- console.log("加载成功完成!");
|
|
|
},
|
|
|
createViewerButtons(viewer) {
|
|
|
viewer.jsObject.collections.images['myClose.png'] =
|
|
|
@@ -1128,28 +1177,31 @@ export default {
|
|
|
// 获取打印按钮的位置
|
|
|
const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild // 打印按钮
|
|
|
const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0] // 打印按钮dom位置
|
|
|
-
|
|
|
+ const userButtonSave = buttonsTablePrint.rows[0].childNodes[1] // 保存按钮dom位置
|
|
|
|
|
|
userButtonPrint.addEventListener("click", (event) => {
|
|
|
- console.log("打印点击");
|
|
|
+ // console.log("打印点击");
|
|
|
// event.preventDefault()
|
|
|
});
|
|
|
userButtonPrint.addEventListener("mouseover", (event) => {
|
|
|
- console.log("移入打印按钮");
|
|
|
- console.log(event, 1035)
|
|
|
+ // console.log("移入打印按钮");
|
|
|
+ // console.log(event, 1035)
|
|
|
|
|
|
});
|
|
|
|
|
|
+ if(!viewer.los.canPrint) {
|
|
|
+ userButtonPrint.hidden=true
|
|
|
+ userButtonSave.hidden=true
|
|
|
+ }
|
|
|
+
|
|
|
userButtonCell.className = 'stiJsViewerClearAllStyles'
|
|
|
userButtonCell.appendChild(closeBtn) // 添加关闭节点
|
|
|
|
|
|
// userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
|
|
|
|
|
|
-
|
|
|
let that = this
|
|
|
// 关闭按钮的监听点击
|
|
|
closeBtn.action = function () {
|
|
|
- console.log(that.$refs.ReportContainer, '1022')
|
|
|
if (that.$refs.reportContainer)
|
|
|
that.$refs.reportContainer.hideContainer()
|
|
|
}
|
|
|
@@ -1165,8 +1217,8 @@ export default {
|
|
|
//自定义列保存
|
|
|
async saveColumnTwo(ref, option, optionBack, code) {
|
|
|
/**
|
|
|
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
+ * 已定义全局方法,直接使用,saveColumnData 保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
+ * 已定义全局方法,直接使用,getColumnName 方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
* 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
*/
|
|
|
const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
|