| | |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="engineeringList" @selection-change="handleSelectionChange"> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="engineeringList" |
| | | 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" /> |
| | |
| | | <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"> |
| | |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="主管部门" prop="department"> |
| | | <treeselect v-model="form.department" @input="getCompetentDepartmentInfo" noChildrenText="无匹配数据" :options="approvalList" :normalizer="normalizer" placeholder="请选择主管部门"> |
| | | </treeselect> |
| | | </el-form-item> |
| | | <el-form-item label="业主单位" prop="unit"> |
| | | <treeselect v-model="form.unit" @input="getProjectOwnerUnit" noChildrenText="无匹配数据" :options="selectOptions" :normalizer="normalizer" placeholder="选择单位" /> |
| | | </el-form-item> |
| | | <el-form-item label="年份" prop="year"> |
| | | <el-date-picker v-model="form.year " |
| | | placeholder="选择时间" |
| | | style="width: 100%" |
| | | 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> |
| | |
| | | <script> |
| | | import { getProjectEngineerings, getProjectEngineeringById, deleteProjectEngineeringByIds, deleteProjectEngineeringById, editProjectEngineering, addProjectEngineering } from "@/api/projectEngineering/projectEngineering"; |
| | | import {list} from "@/api/projectEngineering/projectInfo"; |
| | | import Treeselect from '@riophae/vue-treeselect' |
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
| | | |
| | | import {approvalList,listDept} from "@/api/system/dept"; |
| | | |
| | | |
| | | export default { |
| | | name: "Engineering", |
| | | components: { Treeselect }, |
| | | dicts: ['sys_project_type', 'sys_project_status'], |
| | | data() { |
| | | return { |
| | |
| | | title: "", |
| | | // 是否显示弹出层 |
| | | open: false, |
| | | //主管部门 |
| | | approvalList: [], |
| | | //业主单位 |
| | | selectOptions: [], |
| | | // 查询参数 |
| | | queryParams: { |
| | | currentPage: 1, |
| | |
| | | investmentAmount: [{required: true, message: '请输入投资额', trigger: 'change'}], |
| | | projectType: [{required: true, message: '请选择流程推进类型', trigger: 'change'}], |
| | | status: [{required: true, message: '请选择开工状态', trigger: 'change'}], |
| | | department: [{required: true, message: '请选择主管部门', trigger: 'change'}], |
| | | unit: [{required: true, message: '请选择项目业主单位', trigger: 'change'}], |
| | | year: [{required: true, message: '请选择计划开工时间', trigger: 'change'}], |
| | | parent: [{required: false, message: '请选择父工程', trigger: 'change'}], |
| | | } |
| | | }; |
| | | }, |
| | |
| | | this.getList(); |
| | | this.getProjectList(); |
| | | }, |
| | | mounted() { |
| | | //初始化主管部门下拉框 |
| | | this.getApprovalList(); |
| | | //单位 |
| | | this.getDeptList(); |
| | | }, |
| | | methods: { |
| | | getProjectOwnerUnit(unitId) { |
| | | console.log(unitId) |
| | | // if (deptId) { |
| | | // this.projectForm.unit = deptId |
| | | // } else { |
| | | // this.projectForm.unit = '' |
| | | // } |
| | | }, |
| | | getCompetentDepartmentInfo(deptId) { |
| | | console.log(deptId) |
| | | // if (deptId) { |
| | | // if (this.projectForm.department != deptId) { |
| | | // this.projectForm.competentDepartmentPerson = "" |
| | | // this.projectForm.competentDepartmentPhone = "" |
| | | // } |
| | | // this.projectForm.department = deptId |
| | | // this.getCompetentDepartmentPeople(deptId) |
| | | // } else { |
| | | // this.projectForm.department = '' |
| | | // this.deptPersonList = []; |
| | | // } |
| | | }, |
| | | getDeptList(){ |
| | | listDept().then(response => { |
| | | console.log(response.data) |
| | | this.selectOptions = this.handleTree(response.data, "deptId"); |
| | | this.selectOptions.push({deptId: '', deptName: '无', children: []}) |
| | | }); |
| | | }, |
| | | getApprovalList() { |
| | | approvalList().then(res => { |
| | | this.approvalList = this.handleTree(res.data, "deptId"); |
| | | this.approvalList.push({deptId: '', deptName: '无', children: []}) |
| | | console.log(this.approvalList) |
| | | }); |
| | | }, |
| | | /** 转换部门数据结构 */ |
| | | normalizer(node) { |
| | | if (node.children && !node.children.length) { |
| | | delete node.children; |
| | | } |
| | | return { |
| | | id: node.deptId, |
| | | label: node.deptName, |
| | | children: node.children |
| | | }; |
| | | }, |
| | | getProjectList() { |
| | | list().then(res => { |
| | | this.projectList = res.data |
| | |
| | | this.loading = true; |
| | | getProjectEngineerings(this.queryParams).then(res => { |
| | | this.engineeringList = res.data; |
| | | console.log(this.engineeringList) |
| | | this.total = res.total; |
| | | this.loading = false; |
| | | }); |
| | |
| | | status: null, |
| | | gmtCreate: null, |
| | | gmtUpdate: null, |
| | | deleted: null |
| | | deleted: null, |
| | | department:null, |
| | | unit:null, |
| | | year:null, |
| | | parent:null, |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | |
| | | /** 提交按钮 */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | console.log(this.form) |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | editProjectEngineering(this.form).then(response => { |