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