| | |
| | | v-hasPermi="['code:engineering:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['code:engineering:edit']" |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="deleteByIds" |
| | | v-hasPermi="['code:engineering:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['code:engineering:export']" |
| | | >导出</el-button> |
| | | </el-col> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="success"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-edit"--> |
| | | <!-- size="mini"--> |
| | | <!-- :disabled="single"--> |
| | | <!-- @click="handleUpdate"--> |
| | | <!-- v-hasPermi="['code:engineering:edit']"--> |
| | | <!-- >修改</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="danger"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-delete"--> |
| | | <!-- size="mini"--> |
| | | <!-- :disabled="multiple"--> |
| | | <!-- @click="deleteByIds"--> |
| | | <!-- v-hasPermi="['code:engineering:remove']"--> |
| | | <!-- >删除</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="warning"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-download"--> |
| | | <!-- size="mini"--> |
| | | <!-- @click="handleExport"--> |
| | | <!-- v-hasPermi="['code:engineering:export']"--> |
| | | <!-- >导出</el-button>--> |
| | | <!-- </el-col>--> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table |
| | | ref="elTable" |
| | | v-loading="loading" |
| | | style="margin-top: 20px" |
| | | :data="engineeringList" |
| | | height="100%" |
| | | sortable="custom" |
| | | row-key="id" |
| | | border |
| | | default-expand-all |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | :show-overflow-tooltip="true" |
| | | @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="工程名称" align="center" prop="projectName" /> |
| | | <el-table-column label="主项目名称" align="center" prop="projectInfoName" /> |
| | | :show-overflow-tooltip="true"> |
| | | <el-table-column label="项目名称" align="center" prop="projectName" /> |
| | | <el-table-column label="项目推进类型" align="center" prop="projectType"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_project_type" :value="scope.row.projectType"/> |
| | |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-plus" |
| | | @click="handleadd(scope.row)" |
| | | >添加子工程</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['code:engineering:edit']" |
| | | >修改</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="deleteById(scope.row)" |
| | | v-hasPermi="['code:engineering:remove']" |
| | | >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | type="date" |
| | | value-format="yyyy-MM-dd HH:mm:ss"/> |
| | | </el-form-item> |
| | | <el-form-item label="父工程" prop="parent"> |
| | | <treeselect v-model="form.parent" @input="getProjectOwnerUnit" noChildrenText="无匹配数据" :options="selectOptions" :normalizer="normalizer" placeholder="选择单位" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确 定</el-button> |
| | |
| | | projectType: null, |
| | | status: null, |
| | | }, |
| | | addId:null, |
| | | // 表单参数 |
| | | form: {}, |
| | | // 表单校验 |
| | |
| | | year:null, |
| | | parent:null, |
| | | }; |
| | | this.addId = null; |
| | | this.resetForm("form"); |
| | | }, |
| | | |
| | | /** 搜索按钮操作 */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | |
| | | this.ids = selection.map(item => item.id) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | handleadd(row){ |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "添加工程"; |
| | | this.addId = row.id; |
| | | }, |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | |
| | | /** 提交按钮 */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | console.log(this.form) |
| | | if (valid) { |
| | | if (this.addId != null){ |
| | | this.form.parent = this.addId; |
| | | addProjectEngineering(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | return; |
| | | } |
| | | //修改 |
| | | if (this.form.id != null) { |
| | | editProjectEngineering(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | } else {//不存在addId父工程新增 |
| | | addProjectEngineering(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |