|
@@ -192,15 +192,17 @@
|
192
|
192
|
size="small"
|
193
|
193
|
icon="el-icon-circle-plus-outline"
|
194
|
194
|
style="float:left"
|
195
|
|
- @click="toSavePDFInformation">生成PDF</el-button>
|
|
195
|
+ @click="toSavePDFInformation">生成PDF</el-button> -->
|
196
|
196
|
|
197
|
197
|
|
198
|
|
- <el-button
|
|
198
|
+ <!-- <el-button
|
199
|
199
|
type="primary"
|
200
|
200
|
size="small"
|
201
|
201
|
icon="el-icon-circle-plus-outline"
|
202
|
202
|
style="float:left"
|
203
|
203
|
@click="toCheckPDFInformation">PDF验证</el-button> -->
|
|
204
|
+
|
|
205
|
+
|
204
|
206
|
</div>
|
205
|
207
|
|
206
|
208
|
|
|
@@ -499,7 +501,7 @@
|
499
|
501
|
|
500
|
502
|
<script>
|
501
|
503
|
import { adminMainView, getAdmins, setAdminStatus,toSign,toTestOne,toTestTwo,toTestThree,toTestFour,toTestFive,toTestSeven,toTestEight,toTestNight,toTestTen,toTestElement,toTestThrityMent,saveEnterprise,getEnterPriseById,getMobileCode,savePersionEnterPrise,getPerseEnterPriseById,CreatePersionSeal,CreateNewEnterPrise,toTestThrity,toEndEnterPrise,getEnterPriseDetail
|
502
|
|
- ,CreateQianshuUserName,CreateSKDSendInformation,toSavePDFInformation,toCheckPDFInformation} from "@/api/role/admin";
|
|
504
|
+ ,CreateQianshuUserName,CreateSKDSendInformation,toSavePDFInformation,toCheckPDFInformation,getdruginfoInformation} from "@/api/role/admin";
|
503
|
505
|
import { getRoles } from "@/api/role/role";
|
504
|
506
|
|
505
|
507
|
import { parseTime } from "@/utils";
|
|
@@ -1068,13 +1070,58 @@ export default {
|
1068
|
1070
|
var information = response.data.data.information
|
1069
|
1071
|
|
1070
|
1072
|
var orderId = response.data.data.orderId
|
|
1073
|
+
|
|
1074
|
+ var base64Img = 'data:image/png;base64'+","+orderId
|
|
1075
|
+ console.log("base64Img",base64Img)
|
|
1076
|
+ var imgFile = this.base64ImgtoFile(base64Img)
|
|
1077
|
+ this.downloadBlob(imgFile, 'test.png')
|
|
1078
|
+ console.log("imgFilewoowow",imgFile)
|
1071
|
1079
|
|
1072
|
|
- var imgFile = this.base64ImgtoFile(orderId)
|
|
1080
|
+ const blob = this.base64ToBlob(orderId, 'application/pdf');
|
|
1081
|
+ this.openPdf(blob);
|
1073
|
1082
|
|
1074
|
|
- console.log("imgFilewoowow",imgFile)
|
1075
|
1083
|
}
|
1076
|
1084
|
})
|
1077
|
1085
|
},
|
|
1086
|
+ openPdf(blob) {
|
|
1087
|
+ const objectUrl = URL.createObjectURL(blob);
|
|
1088
|
+ const a = document.createElement('a');
|
|
1089
|
+ a.href = objectUrl;
|
|
1090
|
+ a.target = '_blank';
|
|
1091
|
+ a.click();
|
|
1092
|
+ URL.revokeObjectURL(objectUrl);
|
|
1093
|
+ },
|
|
1094
|
+ base64ToBlob(base64Data, contentType) {
|
|
1095
|
+ contentType = contentType || '';
|
|
1096
|
+ const sliceSize = 1024;
|
|
1097
|
+ const byteCharacters = window.atob(base64Data);
|
|
1098
|
+ const bytesLength = byteCharacters.length;
|
|
1099
|
+ const slicesCount = Math.ceil(bytesLength / sliceSize);
|
|
1100
|
+ const byteArrays = new Array(slicesCount);
|
|
1101
|
+
|
|
1102
|
+ for (let sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
|
|
1103
|
+ const begin = sliceIndex * sliceSize;
|
|
1104
|
+ const end = Math.min(begin + sliceSize, bytesLength);
|
|
1105
|
+
|
|
1106
|
+ const bytes = new Array(end - begin);
|
|
1107
|
+ for (let offset = begin, i = 0; offset < end; ++i, ++offset) {
|
|
1108
|
+ bytes[i] = byteCharacters[offset].charCodeAt(0);
|
|
1109
|
+ }
|
|
1110
|
+ byteArrays[sliceIndex] = new Uint8Array(bytes);
|
|
1111
|
+ }
|
|
1112
|
+
|
|
1113
|
+ return new Blob(byteArrays, {
|
|
1114
|
+ type: contentType
|
|
1115
|
+ });
|
|
1116
|
+ },
|
|
1117
|
+ downloadBlob(blob, filename) {
|
|
1118
|
+ const url = URL.createObjectURL(blob);
|
|
1119
|
+ const a = document.createElement('a');
|
|
1120
|
+ a.href = url;
|
|
1121
|
+ a.download = filename;
|
|
1122
|
+ a.click();
|
|
1123
|
+ URL.revokeObjectURL(url);
|
|
1124
|
+ },
|
1078
|
1125
|
toCheckPDFInformation(){
|
1079
|
1126
|
toCheckPDFInformation().then(response=>{
|
1080
|
1127
|
if(response.data.data == 1){
|
|
@@ -1096,7 +1143,14 @@ export default {
|
1096
|
1143
|
return new File([u8arr], `${filename}.${suffix}`, {
|
1097
|
1144
|
type: mime
|
1098
|
1145
|
})
|
1099
|
|
- }
|
|
1146
|
+ },
|
|
1147
|
+ // toDrugInfo(){
|
|
1148
|
+ // getdruginfoInformation().then(response=>{
|
|
1149
|
+ // if(response.data.state==1){
|
|
1150
|
+
|
|
1151
|
+ // }
|
|
1152
|
+ // })
|
|
1153
|
+ // }
|
1100
|
1154
|
|
1101
|
1155
|
},
|
1102
|
1156
|
watch: {
|