| | |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['oa:ipc:add']" |
| | | >新增</el-button> |
| | | >新增 |
| | | </el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['oa:ipc:edit']" |
| | | >修改</el-button> |
| | | >修改 |
| | | </el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['oa:ipc:remove']" |
| | | >删除</el-button> |
| | | >删除 |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['oa:ipc:edit']" |
| | | >修改</el-button> |
| | | >修改 |
| | | </el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['oa:ipc:remove']" |
| | | >删除</el-button> |
| | | >删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | /> |
| | | |
| | | <!-- 添加或修改ipc设备对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="700px" :append-to-body="true" :close-on-click-modal="false" :destroy-on-close="true"> |
| | | <el-dialog :title="title" :visible.sync="open" width="700px" :append-to-body="true" :close-on-click-modal="false" |
| | | :destroy-on-close="true"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-row> |
| | | <el-col :span="9"> |
| | |
| | | </el-row> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="copy">复制上一条信息</el-button> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { listIpc, getIpc, delIpc, addIpc, updateIpc } from "@/api/oa/ipc"; |
| | | import {listIpc, getIpc, delIpc, addIpc, updateIpc, getCopyIpc} from "@/api/oa/ipc"; |
| | | import building from "../../components/building"; |
| | | import organization from "../../components/organization"; |
| | | import constructionBatch from "../../components/constructionBatch"; |
| | |
| | | constructionBatchId: [ |
| | | { required: true, message: "施工批次不能为空", trigger: "blur" } |
| | | ], |
| | | passageway: [] |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | getNvrId() { |
| | | return this.form.nvrId |
| | | } |
| | | }, |
| | | watch: { |
| | | 'schoolId': function () { |
| | | this.getList() |
| | | }, |
| | | getNvrId: function (v) { |
| | | if (v) { |
| | | this.rules.passageway = [{required: true, message: "通道不能为空", trigger: "blur"}] |
| | | } else { |
| | | this.rules.passageway = [] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | copy() { |
| | | this.buttonLoading = true; |
| | | getCopyIpc().then(res => { |
| | | const obj = res.data; |
| | | // 编辑 |
| | | if (this.form.id) { |
| | | obj.id = this.form.id; |
| | | } |
| | | // 新增 |
| | | else { |
| | | obj.id = undefined; |
| | | } |
| | | this.form = this.shallowCopy(obj); |
| | | this.$modal.msgSuccess("修改成功"); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | }, |
| | | shallowCopy(src) { |
| | | var dst = {}; |
| | | for (var prop in src) { |
| | | if (src.hasOwnProperty(prop)) { |
| | | dst[prop] = src[prop]; |
| | | } |
| | | } |
| | | return dst; |
| | | }, |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |