feat(wms, crm): 新增导出模式选择并修复canvas图片缩放问题
1. 为Wms异常报表页面新增多行/单行导出切换功能 2. 拆分导出菜单为单行、多行两种导出选项 3. 修复ContractExportDialog中图片缩放比例的冗余限制
This commit is contained in:
@@ -489,7 +489,7 @@ export default {
|
||||
actx.fillStyle = '#ffffff';
|
||||
actx.fillRect(0, 0, canvasPageW, canvasTotalH);
|
||||
|
||||
const imgScale = Math.min(canvasPageW / img.width, canvasImageH / img.height, 1);
|
||||
const imgScale = Math.min(canvasPageW / img.width, canvasImageH / img.height);
|
||||
const imgDrawW = img.width * imgScale;
|
||||
const imgDrawH = img.height * imgScale;
|
||||
const imgX = (canvasPageW - imgDrawW) / 2;
|
||||
|
||||
@@ -41,15 +41,24 @@
|
||||
<muti-select v-model="queryParams.qualityStatusCsv" :options="dict.type.coil_quality_status"
|
||||
placeholder="请选择品质" clearable />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="导出模式" prop="abnormalExportCount">
|
||||
<el-radio-group v-model="abnormalExportCount">
|
||||
<el-radio-button :label="0">多行导出</el-radio-button>
|
||||
<el-radio-button :label="1">单行拼接</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<!-- <el-button type="primary" @click="getList">查询</el-button> -->
|
||||
<el-dropdown split-button type="primary" @click="getList" @command="handleCommand">
|
||||
查询
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="exportData">导出产出钢卷</el-dropdown-item>
|
||||
<el-dropdown-item command="exportLossData">导出消耗钢卷</el-dropdown-item>
|
||||
<el-dropdown-item command="saveOutputReport">保存产出报表</el-dropdown-item>
|
||||
<el-dropdown-item command="saveLossReport">保存消耗报表</el-dropdown-item>
|
||||
<el-dropdown-item command="exportData">导出产出钢卷(单行)</el-dropdown-item>
|
||||
<el-dropdown-item command="exportLossData">导出消耗钢卷(单行)</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item command="exportDataMore">导出产出钢卷(多行)</el-dropdown-item>
|
||||
<el-dropdown-item command="exportLossDataMore">导出消耗钢卷(多行)</el-dropdown-item>
|
||||
<!-- <el-dropdown-item command="saveOutputReport">保存产出报表</el-dropdown-item>
|
||||
<el-dropdown-item command="saveLossReport">保存消耗报表</el-dropdown-item> -->
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<!-- <el-button type="primary" @click="exportData">导出产出钢卷</el-button>
|
||||
@@ -191,6 +200,7 @@ export default {
|
||||
lossColumns: [],
|
||||
outputColumns: [],
|
||||
actionTypes: '',
|
||||
abnormalExportCount: 1,
|
||||
lineOptions: [
|
||||
{ label: '酸轧线', value: '11,120,201,520' },
|
||||
{ label: '镀锌线', value: '202,501,521' },
|
||||
@@ -317,7 +327,8 @@ export default {
|
||||
return
|
||||
}
|
||||
this.download('wms/materialCoil/exportAbnormal', {
|
||||
coilIds: this.outList.map(item => item.coilId).join(',')
|
||||
coilIds: this.outList.map(item => item.coilId).join(','),
|
||||
abnormalExportCount: 1
|
||||
}, `abnormalCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
@@ -328,7 +339,32 @@ export default {
|
||||
return
|
||||
}
|
||||
this.download('wms/materialCoil/export', {
|
||||
coilIds: this.lossList.map(item => item.coilId).join(',')
|
||||
coilIds: this.lossList.map(item => item.coilId).join(','),
|
||||
abnormalExportCount: 1
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
// 导出产出钢卷(多行)
|
||||
exportDataMore() {
|
||||
if (this.outList.length === 0) {
|
||||
this.$message.warning('暂无数据可导出')
|
||||
return
|
||||
}
|
||||
this.download('wms/materialCoil/exportAbnormal', {
|
||||
coilIds: this.outList.map(item => item.coilId).join(','),
|
||||
abnormalExportCount: 0
|
||||
}, `abnormalCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
// 导出消耗钢卷(多行)
|
||||
exportLossDataMore() {
|
||||
if (this.lossList.length === 0) {
|
||||
this.$message.warning('暂无数据可导出')
|
||||
return
|
||||
}
|
||||
this.download('wms/materialCoil/export', {
|
||||
coilIds: this.lossList.map(item => item.coilId).join(','),
|
||||
abnormalExportCount: 0
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 处理命令
|
||||
@@ -341,6 +377,10 @@ export default {
|
||||
this.saveOutputReport()
|
||||
} else if (command === 'saveLossReport') {
|
||||
this.saveLossReport()
|
||||
} else if (command === 'exportDataMore') {
|
||||
this.exportDataMore()
|
||||
} else if (command === 'exportLossDataMore') {
|
||||
this.exportLossDataMore()
|
||||
}
|
||||
},
|
||||
// 加载列设置
|
||||
|
||||
Reference in New Issue
Block a user