This commit is contained in:
caoqianming 2024-04-28 14:14:14 +08:00
commit 12cb9a6bfb
2 changed files with 1992 additions and 492 deletions

File diff suppressed because it is too large Load Diff

View File

@ -20,8 +20,7 @@
<el-card style="margin: 6px; position: relative"> <el-card style="margin: 6px; position: relative">
<el-button <el-button
type="primary" type="primary"
icon="el-icon-plus" @click.stop="addStlog"
@click.stop="addExp"
v-if="activeName == 'fourth'" v-if="activeName == 'fourth'"
style=" style="
position: absolute; position: absolute;
@ -29,7 +28,8 @@
right: 10px; right: 10px;
z-index: 100; z-index: 100;
" "
></el-button> >新增异常</el-button
>
<el-tabs <el-tabs
v-model="activeName" v-model="activeName"
class="demo-tabs" class="demo-tabs"
@ -40,7 +40,7 @@
<el-form <el-form
ref="teamForm" ref="teamForm"
:model="form" :model="form"
label-width="100px" label-width="120px"
label-position="right" label-position="right"
> >
<el-row> <el-row>
@ -96,11 +96,11 @@
:sm="24" :sm="24"
v-if="mgroupId == '3555859873776693248'" v-if="mgroupId == '3555859873776693248'"
> >
<el-form-item label="电石渣干粉"> <el-form-item label="石灰石破碎产量">
<el-input-number <el-input-number
v-model="form.pcoal_heat" v-model="form.pcoal_heat"
controls-position="right" controls-position="right"
placeholder="电石渣干粉" placeholder="石灰石破碎产量"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -299,10 +299,11 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="异常" name="fourth"> <el-tab-pane label="异常" name="fourth">
<el-table <el-table
ref="expTable" ref="stlogTable"
:data="stlogList" :data="stlogList"
row-key="id" row-key="id"
stripe stripe
@row-click="stlogRowClick"
highlightCurrentRow highlightCurrentRow
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
@ -348,7 +349,7 @@
<el-button <el-button
link link
size="small" size="small"
@click="sflogexp_edit(scope.row)" @click="editStlog(scope.row)"
type="primary" type="primary"
>编辑</el-button >编辑</el-button
> >
@ -358,7 +359,7 @@
<el-button <el-button
link link
size="small" size="small"
@click="sflogexp_delete(scope.row)" @click="stlog_delete(scope.row)"
type="danger" type="danger"
>删除</el-button >删除</el-button
> >
@ -366,13 +367,13 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <!-- <el-col :span="12">
<p>异常详情</p> <p>异常详情</p>
<el-form <el-form
ref="expForms" ref="stlogForms"
:rules="rules" :rules="rules"
label-width="100px" label-width="100px"
:model="expForm" :model="stlogForm"
> >
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
@ -399,7 +400,7 @@
prop="title" prop="title"
> >
<el-input <el-input
v-model="expForm.title" v-model="stlogForm.title"
placeholder="异常名称" placeholder="异常名称"
/> />
</el-form-item> </el-form-item>
@ -411,16 +412,16 @@
> >
<el-date-picker <el-date-picker
v-model=" v-model="
expForm.happen_time stlogForm.happen_time
" "
type="datetime" type="datetime"
placeholder="发生时间" placeholder="发生时间"
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" style="width: 100%"
:disabled=" :disabled="
expTitle !== stlogTitle !==
'新增异常' && '新增异常' &&
expForm.duration > 0 stlogForm.duration > 0
" "
> >
</el-date-picker> </el-date-picker>
@ -433,7 +434,7 @@
> >
<el-select <el-select
style="width: 100%" style="width: 100%"
v-model="expForm.cate" v-model="stlogForm.cate"
placeholder="原因类别" placeholder="原因类别"
> >
<el-option <el-option
@ -453,15 +454,15 @@
> >
<el-form-item label="停机时长"> <el-form-item label="停机时长">
<el-input-number <el-input-number
v-model="expForm.duration" v-model="stlogForm.duration"
:precision="2" :precision="2"
:min="0" :min="0"
controls-position="right" controls-position="right"
placeholder="停机时长" placeholder="停机时长"
:disabled=" :disabled="
expTitle !== stlogTitle !==
'新增异常' && '新增异常' &&
expForm.duration > 0 stlogForm.duration > 0
" "
style="width: 100%" style="width: 100%"
/> />
@ -477,7 +478,7 @@
<el-input <el-input
type="textarea" type="textarea"
:rows="2" :rows="2"
v-model="expForm.reason" v-model="stlogForm.reason"
placeholder="异常原因" placeholder="异常原因"
/> />
</el-form-item> </el-form-item>
@ -490,18 +491,19 @@
<el-input <el-input
type="textarea" type="textarea"
:rows="2" :rows="2"
v-model="expForm.measure" v-model="stlogForm.measure"
placeholder="处置措施" placeholder="处置措施"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</el-col> </el-col> -->
<el-col :span="12"> <el-col :span="12">
<el-table <el-table
ref="expTable" ref="expTable"
:data="sflogexpList" :data="sflogexpList"
v-if="sflogExpVisiable"
row-key="id" row-key="id"
stripe stripe
highlightCurrentRow highlightCurrentRow
@ -548,19 +550,19 @@
</el-table> </el-table>
</el-col> </el-col>
</el-row> </el-row>
<el-dialog :title="expTitle" v-model="visible"> <el-dialog :title="stlogTitle" v-model="visible">
<el-form <el-form
ref="expForms" ref="stlogForms"
:rules="rules" :rules="rules"
label-width="100px" label-width="100px"
:model="expForm" :model="stlogForm"
> >
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="异常类别"> <el-form-item label="异常类别">
<el-select <el-select
style="width: 100%" style="width: 100%"
v-model="sflogexpType" v-model="stlogForm.cate"
placeholder="异常类别" placeholder="异常类别"
:disabled="1" :disabled="1"
> >
@ -575,12 +577,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item <el-form-item label="异常名称">
label="异常名称"
prop="title"
>
<el-input <el-input
v-model="expForm.title" v-model="stlogForm.title"
placeholder="异常名称" placeholder="异常名称"
/> />
</el-form-item> </el-form-item>
@ -588,22 +587,43 @@
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item <el-form-item
label="发生时间" label="发生时间"
prop="happen_time" prop="start_time"
> >
<el-date-picker <el-date-picker
v-model="expForm.happen_time" v-model="stlogForm.start_time"
type="datetime" type="datetime"
placeholder="发生时间" placeholder="发生时间"
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" style="width: 100%"
:disabled="
expTitle !== '新增异常' &&
expForm.duration > 0
"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24">
<el-form-item label="结束时间">
<el-date-picker
v-model="stlogForm.end_time"
type="datetime"
placeholder="结束时间"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item
label="处理备注"
prop="current_note"
>
<el-input
type="textarea"
:rows="2"
v-model="stlogForm.current_note"
placeholder="处理备注"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item <el-form-item
label="原因类别" label="原因类别"
@ -611,7 +631,7 @@
> >
<el-select <el-select
style="width: 100%" style="width: 100%"
v-model="expForm.cate" v-model="stlogForm.reason"
placeholder="原因类别" placeholder="原因类别"
> >
<el-option <el-option
@ -624,50 +644,12 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col
:md="12"
:sm="24"
v-if="sflogexpType == 0"
>
<el-form-item label="停机时长">
<el-input-number
v-model="expForm.duration"
:precision="2"
:min="0"
controls-position="right"
placeholder="停机时长"
:disabled="
expTitle !== '新增异常' &&
expForm.duration > 0
"
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item <el-form-item label="处置措施">
label="异常原因"
prop="reason"
>
<el-input <el-input
type="textarea" type="textarea"
:rows="2" :rows="2"
v-model="expForm.reason" v-model="stlogForm.measure"
placeholder="异常原因"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item
label="处置措施"
prop="measure"
>
<el-input
type="textarea"
:rows="2"
v-model="expForm.measure"
placeholder="处置措施" placeholder="处置措施"
/> />
</el-form-item> </el-form-item>
@ -711,31 +693,34 @@ export default {
visible: false, visible: false,
hideDelete: true, hideDelete: true,
isSaveing: false, isSaveing: false,
sflogExpVisiable: false,
activeName: "fourth", activeName: "fourth",
expTitle: "新增异常", stlogTitle: "新增异常",
sflogItem: {}, sflogItem: {},
form: {}, form: {},
thirdForm: { thirdForm: {
num: "", num: "",
}, },
expForm: { stlogForm: {
happen_time: "", current_sflog: "",
cate: "", current_note: "",
title: "", title: "",
start_time: "",
end_time: "",
cate: "",
reason: "", reason: "",
measure: "", measure: "",
duration: 0, handler: "",
sflog: "", mgroup: "",
}, },
query: { query: {
page: 0, page: 0,
}, },
rules: { rules: {
happen_time: [{ required: true, message: "请选择发生时间" }], start_time: [{ required: true, message: "请选择发生时间" }],
title: [{ required: true, message: "请填写异常名称" }], current_note: [
cate: [{ required: true, message: "请选择原因类别" }], { required: true, message: "请填写值班异常处理备注" },
reason: [{ required: true, message: "请填写异常原因" }], ],
measure: [{ required: true, message: "请填写处置措施" }],
}, },
sflogexpType: "1", sflogexpType: "1",
typeOptions: [ typeOptions: [
@ -755,8 +740,9 @@ export default {
this.mgroupId = this.$route.query.mgroupId; this.mgroupId = this.$route.query.mgroupId;
let form = this.$TOOL.data.get("sflogItem"); let form = this.$TOOL.data.get("sflogItem");
this.form = JSON.parse(form); this.form = JSON.parse(form);
console.log(this.form);
this.getTeam(); this.getTeam();
this.getSflogexp(); this.getStlog();
}, },
methods: { methods: {
handleClick(e) { handleClick(e) {
@ -835,80 +821,63 @@ export default {
}, },
//***** fourth ****** */ //***** fourth ****** */
// //
getSflogexp() { getStlog() {
let obj = {}; let obj = {};
obj.page = 0; obj.page = 0;
obj.sflog = this.form.id; obj.sflog = this.form.id;
this.$API.wpm.sflogexp.list.req(obj).then((res) => { this.$API.wpm.stlog.list.req(obj).then((res) => {
this.sflogexpList = res; this.stlogList = res;
}); });
}, },
// //
addExp() { addStlog() {
this.expForm = {}; console.log("USER_INFO", this.$TOOL.data.get("USER_INFO"));
this.expForm.happen_time = ""; this.stlogForm.current_sflog = this.form.id;
this.expForm.cate = ""; this.stlogForm.current_note = "";
this.expForm.title = ""; this.stlogForm.cate = "1";
this.expForm.reason = ""; this.stlogForm.title = "";
this.expForm.measure = ""; this.stlogForm.reason = "";
this.expForm.duration = 0; this.stlogForm.measure = "";
this.expForm.sflog = this.form.id; this.stlogForm.start_time = "";
this.expTitle = "新增异常"; this.stlogForm.end_time = "";
this.stlogForm.handler = this.$TOOL.data.get("USER_INFO").id;
this.stlogForm.mgroup = this.mgroupId;
this.stlogTitle = "新增异常";
this.visible = true; this.visible = true;
}, },
// //
sflogexp_edit(row) { editStlog(row) {
Object.assign(this.expForm, row); this.stlogTitle = "编辑异常";
this.expTitle = "编辑异常"; this.stlogForm = row;
this.expForm.handler = this.$TOOL.data.get("USER_INFO").id;
if (this.expForm.duration > 0) {
this.sflogexpType = "0";
} else {
this.sflogexpType = "1";
}
this.visible = true; this.visible = true;
}, },
// //
async sflogexp_delete(row) {
this.$confirm(`确定删除选中的记录吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.wpm.sflogexp.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.expTable.refresh();
})
.catch((err) => {
this.$message.success(err);
});
});
},
submit4() { submit4() {
let that = this; let that = this;
that.$refs.expForms.validate(async (valid) => { that.$refs.stlogForms.validate(async (valid) => {
if (valid) { if (valid) {
that.isSaveing = true; that.isSaveing = true;
if (that.expTitle == "新增异常") { if (that.stlogTitle == "新增异常") {
that.$API.wpm.stlog.create that.$API.wpm.stlog.create
.req(that.expForm) .req(that.stlogForm)
.then((res) => { .then((res) => {
that.isSaveing = false; that.isSaveing = false;
that.visible = false; that.visible = false;
that.$message.success("操作成功"); that.$message.success("操作成功");
this.$refs.expTable.refresh(); this.getStlog();
}) })
.catch((res) => { .catch((res) => {
that.isSaveing = false; that.isSaveing = false;
}); });
} else { } else {
that.$API.wpm.sflogexp.update that.$API.wpm.stlog.update
.req(that.expForm.id, that.expForm) .req(that.stlogForm.id, that.stlogForm)
.then((res) => { .then((res) => {
that.isSaveing = false; that.isSaveing = false;
that.visible = false; that.visible = false;
that.$message.success("操作成功"); that.$message.success("操作成功");
this.$refs.expTable.refresh(); this.getStlog();
}) })
.catch((res) => { .catch((res) => {
that.isSaveing = false; that.isSaveing = false;
@ -917,7 +886,48 @@ export default {
} }
}); });
}, },
//
async stlog_delete(row) {
this.$confirm(`确定删除选中的异常吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.wpm.stlog.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.getStlog();
})
.catch((err) => {
this.$message.success(err);
});
});
},
//stlogsflogexp
stlogRowClick(row) {
console.log(row);
this.getSflogexp(row.id);
this.sflogExpVisiable = true;
},
getSflogexp(id) {
let obj = {};
obj.page = 0;
obj.sflog = id;
this.$API.wpm.sflogexp.list.req(obj).then((res) => {
this.sflogexpList = res;
});
},
//
sflogexp_edit(row) {
Object.assign(this.stlogForm, row);
this.stlogTitle = "编辑异常";
this.stlogForm.handler = this.$TOOL.data.get("USER_INFO").id;
if (this.stlogForm.duration > 0) {
this.stlogForm.cate = "0";
} else {
this.stlogForm.cate = "1";
}
this.visible = true;
},
handlePrint() { handlePrint() {
this.$PRINT("#myReport"); this.$PRINT("#myReport");
}, },