Commit 9aa06f49 authored by yaqizhang's avatar yaqizhang

详情页加按钮

parent e8ee48b8
......@@ -178,6 +178,49 @@
</el-col>
</el-row>
</template>
<div class="" style="width: 95%; height: 60px;margin-left: 50px;text-align: center;" v-if="form.orderId == '' || form.orderId == null">
<el-button
size="normal"
type="primary"
icon="el-icon-edit"
@click="handleIssue(form.alarmId)"
v-hasPermi="['workOrder:basicsInfo:add']">
生成工单
</el-button>
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-form-item label="报警设备" prop="deviceName">
<font>{{ form.deviceName }}</font>
</el-form-item>
<el-form-item label="报警类型" prop="alarmType">
<font>{{ form.alarmType }}</font>
</el-form-item>
<el-form-item label="报警值" prop="alarmValue">
<font>{{ form.alarmValue }}</font>
</el-form-item>
<el-form-item label="工单名称" prop="orderName">
<el-input v-model="form.orderName" placeholder="请输入工单名称" />
</el-form-item>
<el-form-item label="指定执行人员" prop="appointInspector">
<el-select v-model="form.appointInspector" placeholder="请选择执行人员" clearable size="small" @change="setUserId">
<el-option
v-for="item in inspector"
:key="item.userId"
:label="item.nickName"
:value="item.userId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="工单描述" prop="remarks">
<el-input type="textarea" v-model="form.remarks" placeholder="请输入工单描述" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</div>
</div>
</template>
......@@ -186,6 +229,7 @@
import { getDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
import { deviceTree } from "@/api/device/deviceInfo";
import { addBasicsInfo } from "@/api/workOrder/basicsInfo";
import gaodeMap from "utils/gaodeMap.js";
import { map, DEVICE_TYPE } from "utils/gaodeMap.js";
import { inspectorList } from "@/api/system/user";
......@@ -201,9 +245,21 @@ export default {
alarmId:'',
// 折线图标题
title: "",
open: false,
// 巡检员列表
inspector: [],
// 表单参数
form: { },
rule: { },
// 表单校验
rules: {
orderName: [
{ required: true, message: "工单名称不能为空", trigger: "blur" },
],
appointInspector: [
{ required: true, message: "请选择巡检人员", trigger: "blur" },
],
},
};
},
created() {
......@@ -536,6 +592,48 @@ export default {
});
},
/** 下发按钮操作 */
handleIssue(alarmId) {
// this.reset();
this.getInspectorList();
// const alarmId = row.alarmId || this.ids;
getDeviceAlarm(alarmId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "填写工单信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.resourceId = this.form.alarmId;
this.form.orderType = "3";
addBasicsInfo(this.form).then((response) => {
this.msgSuccess("生成工单成功");
this.open = false;
this.getList();
});
}
});
},
getInspectorList() {
this.loading = true;
inspectorList().then((response) => {
this.inspector = response.data;
this.loading = false;
});
},
setUserId(val) {
this.form.appointInspector = val;
},
// 取消按钮
cancel() {
this.open = false;
// this.reset();
},
/** 详细信息跳转 */
showDetail(orderId) {
this.$router.push({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment