fix:黑化日志添加检验附件excel

This commit is contained in:
shijing 2024-09-05 12:12:58 +08:00
parent c45d39ff16
commit f93cfa8000
2 changed files with 48 additions and 20 deletions

View File

@ -33,11 +33,14 @@
<el-descriptions-item label="创建时间">{{ <el-descriptions-item label="创建时间">{{
mlogItem.create_time mlogItem.create_time
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="检验表单" v-if="mlogItem.mgroup_name=='退火'||mlogItem.mgroup_name=='黑化'">
<el-link :href="mlogItem.test_file" target="_blank" type="primary" :underline="false">{{mlogItem.test_file}}</el-link>
</el-descriptions-item>
</el-descriptions> </el-descriptions>
<div style="padding: 5px 10px;display: flex;justify-content: end;"> <div style="padding: 5px 10px;display: flex;justify-content: end;">
<el-button <el-button
type="primary" type="primary"
v-if="mlogItem.submit_time == null&&(mlogItem.ticket==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type!==1))" v-if="mlogItem.submit_time == null&&(mlogItem.ticket==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1))"
@click="mlogUpdate" @click="mlogUpdate"
style="margin-right: 10px;" style="margin-right: 10px;"
v-auth="'mlog.update'" v-auth="'mlog.update'"
@ -51,10 +54,11 @@
@click="mlogSubmit" @click="mlogSubmit"
>提交</el-button >提交</el-button
> >
<!-- 退火--> <!-- 退火-->
<el-button <el-button
type="primary" type="primary"
v-if="mlogItem.mgroup_name=='退火'&&(mlogItem.ticket==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type!==1))" v-if="mlogItem.mgroup_name=='退火'&&(mlogItem.ticket==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1))"
:loading="isSaveing" :loading="isSaveing"
@click="createTicket" @click="createTicket"
>放行审批</el-button> >放行审批</el-button>
@ -69,7 +73,7 @@
<div> <div>
<el-button <el-button
type="primary" type="primary"
v-if="mlogItem.submit_time == null&&(mlogItem.ticket==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type!==1))" v-if="mlogItem.submit_time == null&&(mlogItem.ticket==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1))"
icon="el-icon-plus" icon="el-icon-plus"
@click="table_add" @click="table_add"
>新增</el-button >新增</el-button
@ -113,13 +117,13 @@
link link
type="primary" type="primary"
@click="table_in_edit(scope.row)" @click="table_in_edit(scope.row)"
:disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type!==1)" :disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1)"
> >
编辑 编辑
</el-button> </el-button>
<el-button <el-button
link link
:disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type!==1)" :disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1)"
type="danger" type="danger"
@click="table_in_del(scope.row)" @click="table_in_del(scope.row)"
> >
@ -254,7 +258,7 @@
<el-button <el-button
link link
type="primary" type="primary"
:disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type!==1)" :disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1)"
@click="table_out_check(scope.row)" @click="table_out_check(scope.row)"
> >
检验 检验
@ -581,10 +585,7 @@ export default {
let obj = {}; let obj = {};
obj.oinfo_json = that.oinfo_json; obj.oinfo_json = that.oinfo_json;
obj.test_file = that.test_file; obj.test_file = that.test_file;
console.log('test_file',that.test_file) that.$API.wpm.mlog.change.req(that.mlogItem.id, obj).then((res) => {
console.log('oinfo_json',that.oinfo_json)
that.$API.wpm.mlog.change.req(that.mlogItem.id, obj)
.then((res) => {
let ticket = {}; let ticket = {};
that.isSaveing = true; that.isSaveing = true;
ticket.title = '退火放行审批单'; ticket.title = '退火放行审批单';
@ -608,8 +609,9 @@ export default {
this.$refs.tableOut.refresh(); this.$refs.tableOut.refresh();
}, },
fileUPSuccess(res) { fileUPSuccess(res) {
let that = this;
console.log('res',res); console.log('res',res);
this.test_file = res.id; this.test_file = res.path;
}, },
handleEditSuccess() {}, handleEditSuccess() {},
// //

View File

@ -162,6 +162,21 @@
></ehsSelect> ></ehsSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 黑化 -->
<el-col :md="12" :sm="24" v-if="mgroupName=='黑化'">
<el-form-item label="检验文件">
<sc-upload-file
v-model="fileList"
:multiple="false"
:limit="1"
:accept="['.xlsx', '.xls']"
@success = "fileUPSuccess"
>
<el-button type="primary" icon="el-icon-upload"> </el-button>
</sc-upload-file>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="备注"> <el-form-item label="备注">
<el-input <el-input
@ -231,6 +246,8 @@ export default {
edit: "编辑日志", edit: "编辑日志",
show: "查看日志", show: "查看日志",
}, },
test_file:'',
fileList:[],
// //
form: Object.assign({}, defaultForm), form: Object.assign({}, defaultForm),
// //
@ -328,9 +345,17 @@ export default {
setData(data) { setData(data) {
console.log("data", data); console.log("data", data);
Object.assign(this.form, data); Object.assign(this.form, data);
if(data.test_file!==null){
this.form.test_file = data.test_file;
this.fileList = [{name:data.test_file,url:data.test_file}];
}
this.getRoute(data.id); this.getRoute(data.id);
}, },
fileUPSuccess(res) {
let that = this;
console.log('res',res);
this.test_file = res.path;
},
// //
submit() { submit() {
let that = this; let that = this;
@ -350,14 +375,15 @@ export default {
obj.work_end_time = that.form.work_end_time; obj.work_end_time = that.form.work_end_time;
obj.handle_user = that.form.handle_user; obj.handle_user = that.form.handle_user;
obj.note = that.form.note; obj.note = that.form.note;
that.$API.wpm.mlog.change if(that.mgroupName=='黑化'){
.req(that.form.id, that.form) that.form.test_file = that.test_file;
.then((res) => { }
that.isSaveing = false; that.$API.wpm.mlog.change.req(that.form.id, that.form).then((res) => {
that.$emit("success"); that.isSaveing = false;
that.visible = false; that.$emit("success");
that.$message.success("操作成功"); that.visible = false;
}); that.$message.success("操作成功");
});
} }
} }
}); });