修改表 pt

This commit is contained in:
zty 2024-05-08 14:31:26 +08:00
parent a59d2c16a7
commit 704ca815d3
7 changed files with 38 additions and 19 deletions

BIN
client/dist.zip Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -136,7 +136,6 @@ export default {
console.log(this.form)
parsePDF(this.form).then(res=>{
if(res.code>=200){
// downloadFile(res.data.url)
this.saveLoading = false;
// this.$message.success("解析成功");
this.fileList = [];
@ -167,7 +166,7 @@ export default {
this.dialogTableVisible=true;
getpdf(scope.row.id).then((response) => {
if (response.code>=200) {
downloadFile(response.data.excel_path)
this.downloadFile(response.data.parse_excel)
this.listLoading = false;
}else{
alert('服务器内部错误,请稍后再试')
@ -179,20 +178,19 @@ export default {
},
downloadFile(url) {
const link = document.createElement('a');
link.href = url;
// link.download = '检验检测服务业统计.xlsx';
link.href = url;
link.setAttribute('download', '检验检测服务业统计.xlsx'); // 设置下载文件名
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
},
handlePreview(file) {
if ("url" in file) {
window.open(file.url);
} else {
window.open(file.response.data.path);
if ("url" in file) {
window.open(file.url);
} else {
window.open(file.response.data.path);
}
},
},
handleUpSuccess(res, file, filelist) {
this.fileList = [file];
this.form.pdf_file = res.data.path;
@ -202,8 +200,7 @@ export default {
this.fileList = [];
},
checkPermission,
},
}
};
</script>
<style></style>

View File

@ -801,7 +801,8 @@
data(){
return{
pageSizes:[10,20,50,100,1000,2000,5000],
downloadUrl: process.env.VUE_APP_BASE_API,
downloadUrl:'',
downloadSrc: process.env.VUE_APP_BASE_API,
leftHeight:null,
tableHeight:null,
upHeaders: upHeaders(),
@ -1343,6 +1344,7 @@
},
handleImport(type){
this.impDialogVisible = true;
this.downloadUrl = '';
this.impType = type;
let file_url = '';
if(type=='rc'){
@ -1358,7 +1360,8 @@
}else if(type=='oinspect'){
file_url = "media/default/模板-外部监督检查信息登记表.xlsx";
}
let base_url = this.downloadUrl.substr(0, this.downloadUrl.length - 3);
let base_url = this.downloadSrc.substr(0, this.downloadSrc.length - 3);
console.log(base_url);
this.downloadUrl = base_url+file_url;
},
imporCconfirm(){

View File

@ -1,5 +1,5 @@
from rest_framework import status
from django.conf import settings
from server import settings
from rest_framework.decorators import action
from rest_framework.viewsets import ModelViewSet
from apps.system.permission_data import RbacFilterSet
@ -377,7 +377,8 @@ class ParsePdfViewSet(RbacFilterSet, CreateUpdateCustomMixin, ModelViewSet):
os.makedirs(media_excel)
shutil.copy(EXCEL_PATH, media_excel)
save_path = os.path.join(media_excel, os.path.basename(EXCEL_PATH))
server_pdf_path = os.path.join(settings.BASE_DIR, pdf_file)
server_pdf_path = settings.BASE_DIR + pdf_file
download_excel_path = save_path.split("server")[-1]
run(server_pdf_path, save_path)
except Exception:
traceback.print_exc()
@ -385,7 +386,7 @@ class ParsePdfViewSet(RbacFilterSet, CreateUpdateCustomMixin, ModelViewSet):
Parsepdf.objects.create(
pdf_path=pdf_file,
excel_path= EXCEL_PATH,
parse_excel = save_path,
parse_excel = download_excel_path,
belong_dept = request.user.dept,
create_by = request.user,
create_time = datetime.now(),

View File

@ -0,0 +1,18 @@
# Generated by Django 3.2.12 on 2024-05-08 06:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('supervision', '0067_auto_20240507_1751'),
]
operations = [
migrations.AlterField(
model_name='pt',
name='certificate_date',
field=models.DateField(blank=True, default='', null=True, verbose_name='证书日期'),
),
]

View File

@ -256,7 +256,7 @@ class Pt(CommonBDModel):
params = models.TextField('参加参数名称')
result = models.PositiveSmallIntegerField('结果', choices=pt_result_choices, default=0, help_text=str(pt_result_choices))
handle_result = models.PositiveSmallIntegerField('处理结果', choices = pt_hresult_choices, default=0, help_text=str(pt_hresult_choices))
certificate_date = models.DateField('证书日期',null=True, blank=True)
certificate_date = models.DateField('证书日期', null=True, blank=True, default='')
field = models.PositiveSmallIntegerField('领域', choices=field_choices, help_text=str(field_choices),default=0)
a_class = models.BooleanField('A类', default=True)
task2do = models.ForeignKey('supervision.task2do', verbose_name= '关联任务执行', on_delete=models.SET_NULL, null=True, blank=True)