| | |
| | | <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="运维单位" align="center" prop="unitId" /> |
| | | <el-table-column label="运维单位" align="center" prop="unitName" /> |
| | | <el-table-column label="运维状态" align="center" prop="status" /> |
| | | <el-table-column label="备注" align="center" prop="remark" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | |
| | | |
| | | <!-- 添加运维点位对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body> |
| | | <el-form ref="form" :model="tempForm" :rules="rules" label-width="120px"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
| | | <el-form-item label="点位名称" prop="pointName"> |
| | | <el-input v-model="tempForm.pointName" placeholder="请输入点位名称" /> |
| | | <el-input v-model="form.pointName" placeholder="请输入点位名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="运维单位" prop="unitId"> |
| | | <el-select :disabled="title === '修改运维点位'" v-model="tempForm.unitId" placeholder="运维单位"> |
| | | <el-select :disabled="title === '修改运维点位'" v-model="form.unitId" placeholder="运维单位"> |
| | | <el-option |
| | | v-for="item in unitList" |
| | | :key="item.id" |
| | |
| | | <el-date-picker |
| | | :disabled="title === '修改运维点位'" |
| | | @change="dateChange" |
| | | v-model="tempForm.timezone" |
| | | v-model="form.timezone" |
| | | type="daterange" |
| | | align="right" |
| | | unlink-panels |
| | |
| | | // 继续添加点位 |
| | | nextAdd() { |
| | | let item = {} |
| | | this.formList.push(item); |
| | | // this.formList.push(item); |
| | | this.tempFormList.push(item); |
| | | }, |
| | | getUnitSelect() { |
| | |
| | | remark: null, |
| | | createTime: null, |
| | | updateTime: null, |
| | | deleted: null |
| | | deleted: null, |
| | | pointDetail: "" |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | |
| | | // 多选框选中数据 |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.id) |
| | | this.single = selection.length!==1 |
| | | this.single = selection.length !== 1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** 新增按钮操作 */ |
| | |
| | | getPoint(id).then(response => { |
| | | this.form = response.data; |
| | | this.form.timezone = [this.form.startTime, this.form.endTime] |
| | | if (this.form.pointDetail) { |
| | | this.tempFormList = JSON.parse(this.form.pointDetail) |
| | | } |
| | | this.open = true; |
| | | this.title = "修改运维点位"; |
| | | }); |
| | | }, |
| | | /** 提交按钮 */ |
| | | submitForm() { |
| | | if (this.formList.length > 0) { |
| | | // 批量增加 |
| | | if (this.formList.every(item => !item.hasOwnProperty("id"))) { |
| | | addPointBatch(this.formList).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | // 重置 |
| | | this.tempForm = {}; |
| | | this.tempFormList = []; |
| | | this.formList = []; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | }else { |
| | | if (this.form.id != null) { |
| | | updatePoint(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.editOpen = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addPoint(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | if (this.tempFormList) { |
| | | this.form.pointDetail = JSON.stringify(this.tempFormList) |
| | | } |
| | | if (this.form.id != null) { |
| | | updatePoint(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addPoint(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.reset() |
| | | this.getList(); |
| | | }); |
| | | } |
| | | }, |
| | | /** 删除按钮操作 */ |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | }).catch(() => { |
| | | }); |
| | | }, |
| | | /** 导出按钮操作 */ |
| | | handleExport() { |