| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="工程名称" prop="projectName"> |
| | | <el-form-item label="项目名称" prop="projectName"> |
| | | <el-input |
| | | v-model="queryParams.projectName" |
| | | placeholder="请输入工程名称" |
| | | placeholder="项目名称搜索" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="主项目" prop="projectInfoId"> |
| | | <el-row> |
| | | <el-select v-model="queryParams.projectInfoId" filterable clearable style="width: 100%" placeholder="请选择主项目"> |
| | | <el-option |
| | | v-for="item in projectList" |
| | | :key="'pp1' + item.id" |
| | | :label="item.projectName" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-row> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="主项目" prop="projectInfoId">--> |
| | | <!-- <el-row>--> |
| | | <!-- <el-select v-model="queryParams.projectInfoId" filterable clearable style="width: 100%" placeholder="请选择主项目">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in projectList"--> |
| | | <!-- :key="'pp1' + item.id"--> |
| | | <!-- :label="item.projectName"--> |
| | | <!-- :value="item.id">--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-row>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="项目推进类型" label-width="120px" prop="projectType"> |
| | | <el-select v-model="queryParams.projectType" placeholder="请选择项目推进类型" clearable> |
| | | <el-option |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['code:engineering:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <!-- <el-row :gutter="10" class="mb8">--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="success"--> |
| | | <!-- type="primary"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-edit"--> |
| | | <!-- icon="el-icon-plus"--> |
| | | <!-- size="mini"--> |
| | | <!-- :disabled="single"--> |
| | | <!-- @click="handleUpdate"--> |
| | | <!-- v-hasPermi="['code:engineering:edit']"--> |
| | | <!-- >修改</el-button>--> |
| | | <!-- @click="handleAdd"--> |
| | | <!-- v-hasPermi="['code:engineering:add']"--> |
| | | <!-- >新增</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-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" |
| | |
| | | default-expand-all |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | :show-overflow-tooltip="true"> |
| | | <el-table-column label="项目名称" prop="projectName" /> |
| | | <el-table-column label="项目名称" min-width="250" :show-overflow-tooltip="true" 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"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="主管部门" align="center" prop="competentDepartmentName"> |
| | | </el-table-column> |
| | | <el-table-column label="业主单位" align="center" prop="projectOwnerUnitName"> |
| | | </el-table-column> |
| | | <el-table-column label="年份" align="center" prop="year"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.year ? scope.row.year + '年' : '' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="投资额(万)" align="center" prop="investmentAmount" /> |
| | | <el-table-column label="开工状态" align="center" prop="status"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_project_status" :value="scope.row.status"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="主管部门" align="center" prop="departmentName"> |
| | | |
| | | </el-table-column> |
| | | <el-table-column label="业主单位" align="center" prop="unitName"> |
| | | </el-table-column> |
| | | <el-table-column label="年份" align="center" prop="year"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.year ? scope.row.year.split('-')[0] + '年' : '' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | |
| | | type="text" |
| | | icon="el-icon-plus" |
| | | style="margin-right: 10px" |
| | | @click="handleadd(scope.row)" |
| | | @click="handleAdd(scope.row)" |
| | | >添加子工程</el-button> |
| | | <el-button |
| | | size="mini" |
| | |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="工程名称" prop="projectName"> |
| | | <el-input v-model="form.projectName" placeholder="请输入工程名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="主项目" prop="projectInfoId"> |
| | | <el-row> |
| | | <el-select v-model="form.projectInfoId" filterable style="width: 100%" placeholder="请选择主项目"> |
| | | <el-option |
| | | v-for="item in projectList" |
| | | :key="'pp' + item.id" |
| | | :label="item.projectName" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-row> |
| | | </el-form-item> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | |
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
| | | |
| | | import {approvalList,listDept} from "@/api/system/dept"; |
| | | import {getProjectProcess} from "@/api/projectProcess/projectProcess"; |
| | | |
| | | |
| | | export default { |
| | |
| | | /** 查询工程库列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | getProjectEngineerings(this.queryParams).then(res => { |
| | | this.engineeringList = res.data; |
| | | console.log(this.engineeringList) |
| | | this.total = res.total; |
| | | |
| | | getProjectProcess(this.queryParams).then(response => { |
| | | this.engineeringList = response.data; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | handleadd(row){ |
| | | handleAdd(row){ |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "添加工程"; |
| | | this.addId = row.id; |
| | | }, |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "添加工程"; |
| | | if (this.isProject(row.id)) { |
| | | this.form.projectInfoId = row.id |
| | | this.form.parent = '0' |
| | | } else { |
| | | this.form.projectInfoId = row.projectInfoId |
| | | this.form.parent = row.id |
| | | } |
| | | |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.addId != null){ |
| | | this.form.parent = this.addId; |
| | | if (! this.form.id){ |
| | | addProjectEngineering(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | return; |
| | | } |
| | | //修改 |
| | | if (this.form.id != null) { |
| | | } else { |
| | | editProjectEngineering(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else {//不存在addId父工程新增 |
| | | addProjectEngineering(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |