@nstc-business/imes 1.0.31 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/measureCalc/MeasureEvalFlatTable.vue +1 -0
- package/src/components/measureCalc/MeasureQualAnalysis.vue +1 -1
- package/src/components/measureCalc/MeasureStatFlatTable.vue +1 -0
- package/src/components/measureCalc/MeasureTreeTable.vue +1 -1
- package/src/components/measureCalc/index.vue +107 -8
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<vxe-table
|
|
3
3
|
border
|
|
4
4
|
ref="xTable"
|
|
5
|
-
:class="['measure-tree-table', 'level-' + level]"
|
|
5
|
+
:class="['measure-tree-table', 'v3-n20-table-pro', 'level-' + level]"
|
|
6
6
|
:row-config="{ keyField: '_rowKey' }"
|
|
7
7
|
:data="nodes"
|
|
8
8
|
:expand-config="{ lazy: false, visibleMethod: canExpand }"
|
|
@@ -191,6 +191,42 @@
|
|
|
191
191
|
</div>
|
|
192
192
|
</div>
|
|
193
193
|
<calculate-detail-dialog ref="calculateDetailDialog" />
|
|
194
|
+
<el-dialog
|
|
195
|
+
title="选择打印"
|
|
196
|
+
:visible.sync="printDialogVisible"
|
|
197
|
+
width="480px"
|
|
198
|
+
append-to-body
|
|
199
|
+
@closed="onPrintDialogClosed"
|
|
200
|
+
>
|
|
201
|
+
<el-form label-width="90px">
|
|
202
|
+
<el-form-item label="打印选项" required>
|
|
203
|
+
<el-select
|
|
204
|
+
v-model="selectedTemplateName"
|
|
205
|
+
placeholder="请选择"
|
|
206
|
+
clearable
|
|
207
|
+
filterable
|
|
208
|
+
:loading="printTemplateLoading"
|
|
209
|
+
style="width: 100%"
|
|
210
|
+
>
|
|
211
|
+
<el-option
|
|
212
|
+
v-for="item in printTemplateList"
|
|
213
|
+
:key="item.ptId || item.ptNo || item.ptName"
|
|
214
|
+
:label="item.ptName"
|
|
215
|
+
:value="item.ptName"
|
|
216
|
+
/>
|
|
217
|
+
</el-select>
|
|
218
|
+
</el-form-item>
|
|
219
|
+
</el-form>
|
|
220
|
+
<div slot="footer" class="dialog-footer">
|
|
221
|
+
<el-button type="primary" size="small" :loading="printLoading" @click="confirmPrintDownload('download')">
|
|
222
|
+
下载
|
|
223
|
+
</el-button>
|
|
224
|
+
<el-button type="primary" size="small" :loading="printLoading" @click="confirmPrintDownload('print')">
|
|
225
|
+
打印
|
|
226
|
+
</el-button>
|
|
227
|
+
<el-button size="small" @click="printDialogVisible = false">取消</el-button>
|
|
228
|
+
</div>
|
|
229
|
+
</el-dialog>
|
|
194
230
|
</div>
|
|
195
231
|
</template>
|
|
196
232
|
|
|
@@ -341,6 +377,10 @@ export default {
|
|
|
341
377
|
loading: false,
|
|
342
378
|
calcLoading: false,
|
|
343
379
|
printLoading: false,
|
|
380
|
+
printDialogVisible: false,
|
|
381
|
+
printTemplateList: [],
|
|
382
|
+
selectedTemplateName: '',
|
|
383
|
+
printTemplateLoading: false,
|
|
344
384
|
model: { type: 1, name: '', code: '', digits: 2, modelTreeVO: {} },
|
|
345
385
|
sections: [],
|
|
346
386
|
anchorTabs: [],
|
|
@@ -1082,6 +1122,42 @@ export default {
|
|
|
1082
1122
|
}
|
|
1083
1123
|
},
|
|
1084
1124
|
async printFn() {
|
|
1125
|
+
const logId = this.currentLogId()
|
|
1126
|
+
const modelId = this.currentModelId()
|
|
1127
|
+
if (!logId || !modelId) {
|
|
1128
|
+
this.$message.warning('请先完成测算后再打印')
|
|
1129
|
+
return
|
|
1130
|
+
}
|
|
1131
|
+
this.selectedTemplateName = ''
|
|
1132
|
+
this.printDialogVisible = true
|
|
1133
|
+
await this.loadPrintTemplates()
|
|
1134
|
+
},
|
|
1135
|
+
onPrintDialogClosed() {
|
|
1136
|
+
this.selectedTemplateName = ''
|
|
1137
|
+
},
|
|
1138
|
+
async loadPrintTemplates() {
|
|
1139
|
+
this.printTemplateLoading = true
|
|
1140
|
+
try {
|
|
1141
|
+
const ptType =
|
|
1142
|
+
this.model && this.model.type != null && this.model.type !== '' ? String(this.model.type) : undefined
|
|
1143
|
+
const res = await this.$axios.get(
|
|
1144
|
+
'/imes/print-template/list',
|
|
1145
|
+
ptType ? { ptType } : {},
|
|
1146
|
+
{ loading: false }
|
|
1147
|
+
)
|
|
1148
|
+
const list = Array.isArray(res) ? res : (res && res.data) || []
|
|
1149
|
+
this.printTemplateList = Array.isArray(list) ? list : []
|
|
1150
|
+
} catch (e) {
|
|
1151
|
+
this.printTemplateList = []
|
|
1152
|
+
} finally {
|
|
1153
|
+
this.printTemplateLoading = false
|
|
1154
|
+
}
|
|
1155
|
+
},
|
|
1156
|
+
async confirmPrintDownload(action) {
|
|
1157
|
+
if (!this.selectedTemplateName) {
|
|
1158
|
+
this.$message.warning('请选择打印选项')
|
|
1159
|
+
return
|
|
1160
|
+
}
|
|
1085
1161
|
const logId = this.currentLogId()
|
|
1086
1162
|
const modelId = this.currentModelId()
|
|
1087
1163
|
if (!logId || !modelId) {
|
|
@@ -1095,24 +1171,47 @@ export default {
|
|
|
1095
1171
|
{
|
|
1096
1172
|
...extra,
|
|
1097
1173
|
logId,
|
|
1098
|
-
modelId
|
|
1174
|
+
modelId,
|
|
1175
|
+
templateName: this.selectedTemplateName
|
|
1099
1176
|
}
|
|
1100
1177
|
])
|
|
1101
1178
|
if (res.code !== 0) {
|
|
1102
|
-
// this.$message.error(res.msg || '打印失败')
|
|
1103
1179
|
return
|
|
1104
1180
|
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1181
|
+
if (action === 'print') {
|
|
1182
|
+
printJS({
|
|
1183
|
+
printable: res.data,
|
|
1184
|
+
type: 'pdf',
|
|
1185
|
+
base64: true
|
|
1186
|
+
})
|
|
1187
|
+
} else {
|
|
1188
|
+
this.downloadPdfBase64(res.data)
|
|
1189
|
+
}
|
|
1190
|
+
this.printDialogVisible = false
|
|
1110
1191
|
} catch (e) {
|
|
1111
|
-
//
|
|
1192
|
+
// keep quiet consistent with previous print catch
|
|
1112
1193
|
} finally {
|
|
1113
1194
|
this.printLoading = false
|
|
1114
1195
|
}
|
|
1115
1196
|
},
|
|
1197
|
+
downloadPdfBase64(base64) {
|
|
1198
|
+
const pure = String(base64 || '').replace(/^data:application\/pdf;base64,/, '')
|
|
1199
|
+
const binary = atob(pure)
|
|
1200
|
+
const len = binary.length
|
|
1201
|
+
const bytes = new Uint8Array(len)
|
|
1202
|
+
for (let i = 0; i < len; i++) {
|
|
1203
|
+
bytes[i] = binary.charCodeAt(i)
|
|
1204
|
+
}
|
|
1205
|
+
const blob = new Blob([bytes], { type: 'application/pdf' })
|
|
1206
|
+
const url = URL.createObjectURL(blob)
|
|
1207
|
+
const a = document.createElement('a')
|
|
1208
|
+
a.href = url
|
|
1209
|
+
a.download = `${(this.model && this.model.code) || '测算结果'}.pdf`
|
|
1210
|
+
document.body.appendChild(a)
|
|
1211
|
+
a.click()
|
|
1212
|
+
document.body.removeChild(a)
|
|
1213
|
+
URL.revokeObjectURL(url)
|
|
1214
|
+
},
|
|
1116
1215
|
hasPrintObj(val) {
|
|
1117
1216
|
return val && typeof val === 'object' && Object.keys(val).length > 0
|
|
1118
1217
|
},
|