feature:<master> feat:增加检验结果告知单和检验通知单功能
This commit is contained in:
parent
d8ae843eca
commit
e5f89ef1f7
|
@ -121,7 +121,7 @@
|
|||
</div>
|
||||
</el-card>
|
||||
<el-row >
|
||||
<el-col style="margin-top:10px" v-for="(item,$index) in subData">
|
||||
<el-col style="margin-top:10px" v-for="(item,$index) in subData" v-bind:key="$index">
|
||||
<el-card>
|
||||
<div style="padding:10px 20px 5px 10px">
|
||||
<div v-if="item.goal_key" style="font-size:18px;height: 25px;">
|
||||
|
@ -263,7 +263,12 @@
|
|||
<el-table-column label="检查日期" prop="date_inspect"></el-table-column>
|
||||
<el-table-column label="检查结果" prop="result"></el-table-column>
|
||||
<el-table-column label="结果日期" prop="result_date"></el-table-column>
|
||||
<el-table-column label="文件路径" prop="file_path"></el-table-column>
|
||||
<el-table-column label="检查通知单" prop="notification_form">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="primary" :href="scope.row.notification_form" target="_blank" v-if="scope.row.notification_form">查看</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结果告知单" prop="result_form"></el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
|
@ -301,7 +306,8 @@
|
|||
<el-table-column label="检查日期" prop="date_inspect"></el-table-column>
|
||||
<el-table-column label="检查结果" prop="result"></el-table-column>
|
||||
<el-table-column label="结果日期" prop="result_date"></el-table-column>
|
||||
<el-table-column label="文件路径" prop="file_path"></el-table-column>
|
||||
<el-table-column label="检查通知单" prop="notification_form"></el-table-column>
|
||||
<el-table-column label="结果告知单" prop="result_form"></el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<saveoin-dialog
|
||||
|
@ -846,7 +852,7 @@
|
|||
task2do:''
|
||||
},
|
||||
rcList:[],//报告证书{应发/超期}
|
||||
rc2List:{},
|
||||
rc2List:{count: 0},
|
||||
dialogRc:false,
|
||||
ptList:[],//能力验证
|
||||
dialogPt:false,
|
||||
|
@ -993,7 +999,7 @@
|
|||
getPgoalDeptList({task2do:item.id}).then(res=>{
|
||||
let data = res.data.results;
|
||||
that.subData = [];
|
||||
data.forEach(item => {
|
||||
data.forEach(item => {
|
||||
let obj = item;
|
||||
let goal_value_a = item.goal_value_a+'';
|
||||
if(item.goal_name=='重大质量事故'){
|
||||
|
@ -1218,6 +1224,7 @@
|
|||
this.$refs.saveComDialog.open("add",this.task2do);
|
||||
});
|
||||
}else if(type=='oinspect'){
|
||||
console.log('x')
|
||||
this.dialogOin = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveOinDialog.open("add",this.task2do);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="">
|
||||
<el-dialog
|
||||
:title="titleOption[type]"
|
||||
:title="num_oinspect[type]"
|
||||
:visible.sync="dialogVisible"
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
|
@ -52,34 +52,73 @@
|
|||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件路径" >
|
||||
<el-input v-model="form.file_path"></el-input>
|
||||
<el-form-item label="检查通知单" prop="file">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:action="upUrl"
|
||||
:on-success="handleUpSuccess"
|
||||
:on-remove="handleRemove"
|
||||
:on-preview="handlePreview"
|
||||
:headers="upHeaders"
|
||||
:file-list="fileList"
|
||||
:limit="1"
|
||||
accept=".doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip">
|
||||
<el-button size="small" type="primary">上传文件</el-button>
|
||||
</el-upload>
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="impDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit()">确认</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="结果告知单" prop="file">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:action="upUrl"
|
||||
:on-success="handleUpSuccess_res"
|
||||
:on-remove="handleRemove_res"
|
||||
:on-preview="handlePreview"
|
||||
:headers="upHeaders"
|
||||
:file-list="fileList_res"
|
||||
:limit="1"
|
||||
accept=".doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip">
|
||||
<el-button size="small" type="primary">上传文件</el-button>
|
||||
</el-upload>
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="impDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit_result()">确认</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="isSaveing" @click="onSubmit('Form')">确认</el-button>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createOinspect,updateOinspect} from "@/api/task";
|
||||
import { upUrl, upHeaders } from "@/api/file";
|
||||
import {updateRecord} from "@/api/record";
|
||||
export default {
|
||||
emits: ["onSubmit", "onCancel"],
|
||||
emits: ["onSubmit", "onCancel", "onSubmit_result"],
|
||||
data() {
|
||||
return {
|
||||
type:'add',
|
||||
form:{
|
||||
checker: "",
|
||||
result: "",
|
||||
date_inspect: "",
|
||||
result_date: "",
|
||||
file_path: "",
|
||||
notification_form: "",
|
||||
result_form:"",
|
||||
cate: 10,
|
||||
task2do: 0
|
||||
task2do: 0,
|
||||
},
|
||||
titleOption: {
|
||||
impDialogVisible: false,
|
||||
upUrl: upUrl(),
|
||||
upHeaders: upHeaders(),
|
||||
fileList: [],
|
||||
fileList_res: [],
|
||||
num_oinspect: {
|
||||
add: "新增外部监督检查",
|
||||
edit: "外部监督检查编辑",
|
||||
},
|
||||
|
@ -109,9 +148,49 @@
|
|||
//表单注入数据
|
||||
setData(data) {
|
||||
Object.assign(this.form, data);
|
||||
debugger;
|
||||
console.log(this.form);
|
||||
if(data.notification_form){
|
||||
this.fileList = [{ name: data.notification_form.split('/')[5], value: data.notification_form }];
|
||||
}else if(data.result_form){
|
||||
this.fileList_res = [{ name: data.result_form.split('/')[5], value: data.result_form }];
|
||||
}
|
||||
},
|
||||
beforeUpload(file) {
|
||||
const isLt2M = file.size / 1024 / 1024 < 5;
|
||||
if (!isLt2M) {
|
||||
this.$message.error("单文件不能超过5MB!");
|
||||
}
|
||||
return isLt2M;
|
||||
},
|
||||
handleUpSuccess(res, file) {
|
||||
this.fileList = [file];
|
||||
this.form.notification_form = res.data.path
|
||||
console.log(this.form)
|
||||
},
|
||||
handleUpSuccess_res(res, file) {
|
||||
this.fileList_res = [file];
|
||||
this.form.result_form = res.data.path
|
||||
console.log(this.form)
|
||||
},
|
||||
handleRemove(file) {
|
||||
// 实现删除文件
|
||||
this.fileList = [];
|
||||
this.form.notification_form = null
|
||||
console.log(this.form)
|
||||
},
|
||||
handleRemove_res(file) {
|
||||
// 实现删除文件结果告知单
|
||||
this.fileList_res = [];
|
||||
this.form.result_form = null
|
||||
console.log(this.form)
|
||||
},
|
||||
handlePreview(file) {
|
||||
if ("response" in file) {
|
||||
window.open(file.response.data.path);
|
||||
} else {
|
||||
window.open(file.value);
|
||||
}
|
||||
},
|
||||
//提交
|
||||
onSubmit() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
|
@ -148,9 +227,46 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
//提交检验结果告知单
|
||||
onSubmit_result() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
try {
|
||||
var res;
|
||||
if (this.type == "add") {
|
||||
createOinspect(this.form).then(res=>{
|
||||
this.isSaveing = false;
|
||||
if(res.code>=200){
|
||||
this.dialogVisible = false;
|
||||
this.$emit("success",this.type);
|
||||
}else{
|
||||
this.$message.warning(res.data.msg);
|
||||
}
|
||||
})
|
||||
} else if (this.type == "edit") {
|
||||
updateOinspect(this.form.id,this.form).then(res=>{
|
||||
this.isSaveing = false;
|
||||
if(res.code>=200){
|
||||
this.dialogVisible = false;
|
||||
this.$emit("success",this.type);
|
||||
}else{
|
||||
this.$message.warning(res.data.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
return res;
|
||||
} catch (err) {
|
||||
//可以处理校验错误
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel() {
|
||||
this.$emit("closed");
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -426,7 +426,8 @@
|
|||
<el-table-column label="检查日期" prop="date_inspect"></el-table-column>
|
||||
<el-table-column label="检查结果" prop="result"></el-table-column>
|
||||
<el-table-column label="结果日期" prop="result_date"></el-table-column>
|
||||
<el-table-column label="文件路径" prop="file_path"></el-table-column>
|
||||
<el-table-column label="检查通知单" prop="notification_form"></el-table-column>
|
||||
<el-table-column label="检查结果告知单" prop="result_form"></el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
@ -922,7 +923,6 @@ export default {
|
|||
'检查日期': '',
|
||||
'检查结果': '',
|
||||
'检查日期': '',
|
||||
'文件路径': '',
|
||||
'单位名称': '',
|
||||
}];
|
||||
if (oinspectList.length > 0) {
|
||||
|
@ -935,7 +935,6 @@ export default {
|
|||
'检查日期': item6.date_inspect,
|
||||
'检查结果': item6.result,
|
||||
'结果日期': item6.result_date,
|
||||
'文件路径': item6.file_path,
|
||||
'单位名称': item6.belong_dept_name,
|
||||
};
|
||||
});
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 3.2.12 on 2024-03-26 01:32
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('information', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='abilityreview',
|
||||
name='judging_method',
|
||||
field=models.PositiveSmallIntegerField(choices=[(0, '文审'), (10, '现场')], max_length=20, verbose_name='评审方法'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='abilityreview',
|
||||
name='judging_type',
|
||||
field=models.PositiveSmallIntegerField(choices=[(0, '初次'), (10, '扩项'), (20, '变更'), (30, '复评'), (40, '迁址')], max_length=20, verbose_name='评审类型'),
|
||||
),
|
||||
]
|
|
@ -4,18 +4,18 @@ from django.db import models
|
|||
|
||||
class AbilityReview(models.Model):
|
||||
type_method = (
|
||||
('文审', '文审'),
|
||||
('现场', '现场'))
|
||||
(0, '文审'),
|
||||
(10, '现场'))
|
||||
|
||||
juge_type = ( ('初次', '初次'),
|
||||
('扩项', '扩项'),
|
||||
('变更', '变更'),
|
||||
('复评', '复评'),
|
||||
('迁址', '迁址'))
|
||||
juge_type = ( (0, '初次'),
|
||||
(10, '扩项'),
|
||||
(20, '变更'),
|
||||
(30, '复评'),
|
||||
(40, '迁址'))
|
||||
name = models.CharField(max_length=20, unique=True, verbose_name='公司名称')
|
||||
qualification_name = models.CharField(max_length=20, verbose_name='资质名称')
|
||||
judging_method = models.CharField(max_length=20, choices=type_method, verbose_name='评审方法')
|
||||
judging_type = models.CharField(max_length=20, choices=juge_type, verbose_name='评审类型')
|
||||
judging_method = models.PositiveSmallIntegerField(max_length=20, choices=type_method, verbose_name='评审方法')
|
||||
judging_type = models.PositiveSmallIntegerField(max_length=20, choices=juge_type, verbose_name='评审类型')
|
||||
add_param = models.IntegerField(default=0, verbose_name='新增参数')
|
||||
review_date = models.DateField(verbose_name='评审日期', null=True)
|
||||
now_count = models.IntegerField(default=0, verbose_name='现有场所数量')
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
# Generated by Django 3.2.12 on 2024-03-26 02:04
|
||||
|
||||
import datetime
|
||||
from django.db import migrations, models
|
||||
from django.utils.timezone import utc
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('supervision', '0063_alter_oinspect_result_date'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='oinspect',
|
||||
name='file_path',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='oinspect',
|
||||
name='notification_form',
|
||||
field=models.CharField(max_length=100, null=True, verbose_name='检查通知单'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='oinspect',
|
||||
name='result_form',
|
||||
field=models.CharField(max_length=100, null=True, verbose_name='检查结果告知单'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='oinspect',
|
||||
name='result_date',
|
||||
field=models.DateField(default=datetime.datetime(2024, 3, 26, 2, 4, 32, 900039, tzinfo=utc), verbose_name='检查结果日期'),
|
||||
),
|
||||
]
|
|
@ -294,5 +294,6 @@ class Oinspect(CommonBDModel):
|
|||
date_inspect = models.DateField('检查日期')
|
||||
result = models.TextField('检查结果')
|
||||
result_date = models.DateField('检查结果日期', default=timezone.now())
|
||||
file_path = models.CharField('附件路径', max_length=100)
|
||||
notification_form = models.CharField('检查通知单', max_length=100, null=True)
|
||||
result_form = models.CharField('检查结果告知单', max_length=100, null=True)
|
||||
task2do = models.ForeignKey('supervision.task2do', verbose_name= '关联任务执行', on_delete=models.SET_NULL, null=True, blank=True)
|
Loading…
Reference in New Issue