| | |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | <el-select v-model="query.projectStatus" clearable filterable placeholder="项目状态" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-select v-model="query.projectStatusIn" multiple clearable filterable collapse-tags placeholder="项目状态" style="width: 185px;" class="filter-item" @change="$forceUpdate()"> |
| | | <el-option |
| | | v-for="item in dict[projectStatus]" |
| | | :key="item.id" |
| | |
| | | <el-form-item label="名称" prop="name"> |
| | | <el-input v-model="form.name" style="width: 523px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="项目类型" prop="projectTypeId"> |
| | | <el-select v-model="form.projectTypeId" clearable filterable placeholder="请选择" style="width: 200px;" :disabled="disabledFlagByApprove" @change="projectTypeChange"> |
| | | <el-option |
| | | v-for="item in projectTypeList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="项目区分" prop="projectDistinguish"> |
| | | <el-select v-model="form.projectDistinguish" clearable filterable placeholder="请选择" style="width: 200px;" :disabled="disabledFlagByApprove"> |
| | | <el-option |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="项目类型" prop="projectTypeId"> |
| | | <el-select v-model="form.projectTypeId" clearable filterable placeholder="请选择" style="width: 200px;" :disabled="disabledFlagByApprove" @change="projectTypeChange"> |
| | | <el-option |
| | | v-for="item in projectTypeList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="公司" prop="companyId"> |
| | | <el-select v-model="form.companyId" clearable filterable placeholder="请选择" style="width: 523px;"> |
| | | <el-option |
| | | v-for="item in companyIdList" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="需求说明"> |
| | | <el-input v-model="form.requirement" :rows="3" type="textarea" style="width: 523px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="报价单金" prop="quotationPrice"> |
| | | <money-input :key="random" v-model="form.quotationPrice" :width="200" :disabled="disabledFlagByApprove" /> |
| | | </el-form-item> |
| | | <el-form-item label="报价币种" prop="unitCurrency"> |
| | | <el-select v-model="form.unitCurrency" clearable filterable placeholder="请选择" style="width: 200px;" :disabled="disabledFlagByApprove"> |
| | | <el-option |
| | | v-for="item in dict[standardUnitCurrency]" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="绩效单金" prop="performancePrice"> |
| | | <money-input :key="random" v-model="form.performancePrice" :width="200" :disabled="disabledFlagByApprove" /> |
| | | </el-form-item> |
| | | <el-form-item label="绩效币种"> |
| | | <el-select v-model="standardUnitCurrencyRenminbi" clearable filterable placeholder="请选择" style="width: 200px;" disabled> |
| | | <el-option |
| | | v-for="item in dict[standardUnitCurrency]" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="绩效目标" prop="performanceObjectives"> |
| | | <el-input :key="random" v-model="form.performanceObjectives" style="width: 200px;" :disabled="disabledFlagByApprove"> |
| | | <template slot="append">%</template> |
| | | <el-form-item label="合同总金额" prop="contractPrice"> |
| | | <el-input v-model="form.contractPrice" style="width: 200px;"> |
| | | <template slot="append">万元</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="合同总金额" prop="contractPrice"> |
| | | <money-input :key="random" v-model="form.contractPrice" :width="200" /> |
| | | <el-form-item label="拟定合同额" prop="contractPrePrice"> |
| | | <el-input v-model="form.contractPrePrice" style="width: 200px;"> |
| | | <template slot="append">万元</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="入项目金额" prop="projectPrice"> |
| | | <el-input v-model="form.projectPrice" style="width: 200px;"> |
| | | <template slot="append">万元</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="绩效目标" prop="performanceObjectives"> |
| | | <el-input v-model="performanceObjectives" style="width: 200px;" :disabled="true"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | <span style="margin-left: 30px;"> |
| | | <el-tag v-if="performanceObjectives < 20" type="danger">战略项目</el-tag> |
| | | <el-tag v-else-if="performanceObjectives < 25" type="warning">低利润</el-tag> |
| | | <el-tag v-else-if="performanceObjectives < 30" type="info">正常利润</el-tag> |
| | | <el-tag v-else type="success">高利润</el-tag> |
| | | </span> |
| | | </el-form-item> |
| | | <el-form-item label="计划开始日期" prop="planStartDate"> |
| | | <el-date-picker v-model="form.planStartDate" type="date" :picker-options="pickerOptionsStart" placeholder="选择日期" style="width: 200px;" /> |
| | |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | :disabled="!item.enabled" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="actualLaborCost" label="其他成本" width="110"> |
| | | <el-table-column :show-overflow-tooltip="true" prop="actualOtherCost" label="其他成本" width="110"> |
| | | 未实装 |
| | | </el-table-column> |
| | | </el-table-column> |
| | |
| | | <el-button size="mini" type="text" @click="canel(scope.row)">取消</el-button> |
| | | <el-button type="primary" size="mini" @click="projectAdmit(scope.row)">确定</el-button> |
| | | </div> |
| | | <el-button slot="reference" type="primary" icon="el-icon-check" size="mini" /> |
| | | <el-button |
| | | v-if="scope.row.approveStatus !== 'approve_status_acknowledged'" |
| | | :key="scope.row.id" |
| | | slot="reference" |
| | | :disabled="!( |
| | | (scope.row.approveStatus === 'approve_status_master_acknowledged' && userRolesLevelMin === 1) || |
| | | (scope.row.approveStatus === 'approve_status_leader_acknowledged' && userRolesLevelMin === 2) || |
| | | (scope.row.approveStatus === 'approve_status_unrecognized' && (userRolesLevelMin === 3 || userRolesLevelMin === 2)) |
| | | )" |
| | | type="primary" |
| | | icon="el-icon-check" |
| | | size="mini" |
| | | /> |
| | | </el-popover> |
| | | <el-popover |
| | | slot="left" |
| | |
| | | <el-button size="mini" type="text" @click="canel(scope.row)">取消</el-button> |
| | | <el-button type="primary" size="mini" @click="projectDisavow(scope.row)">确定</el-button> |
| | | </div> |
| | | <el-button slot="reference" type="primary" icon="el-icon-close" size="mini" style="margin-left: 3px;" /> |
| | | <el-button |
| | | v-if="scope.row.approveStatus === 'approve_status_acknowledged'" |
| | | slot="reference" |
| | | :disabled="userRolesLevelMin !== 1" |
| | | type="primary" |
| | | icon="el-icon-close" |
| | | size="mini" |
| | | style="margin-left: 3px;" |
| | | /> |
| | | </el-popover> |
| | | </udOperation> |
| | | </template> |
| | |
| | | <script> |
| | | import crudProject from '@/api/project/project' |
| | | import crudUser from '@/api/system/user' |
| | | import crudCompany from '@/api/system/sysCompany' |
| | | import crudProjectType from '@/api/project/projectType' |
| | | import CRUD, { presenter, header, form, crud } from '@crud/crud' |
| | | import rrOperation from '@crud/RR.operation' |
| | |
| | | import moneyInput from '@/views/assembly/moneyInput/index.vue' |
| | | import constant from '@/utils/constant' |
| | | |
| | | const defaultForm = { id: null, name: null, projectTypeId: null, projectDistinguish: null, requirement: null, unitCurrency: null, performanceObjectives: null, quotationPrice: null, performancePrice: null, contractPrice: null, liableUserId: null, liableUserIdList: [], planStartDate: null, planEndDate: null, projectStatus: null, approveStatus: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | const defaultForm = { id: null, name: null, projectTypeId: null, projectDistinguish: null, companyId: null, requirement: null, unitCurrency: null, performanceObjectives: null, quotationPrice: null, performancePrice: null, contractPrice: null, contractPrePrice: null, projectPrice: null, liableUserId: null, liableUserIdList: [], planStartDate: null, planEndDate: null, projectStatus: null, approveStatus: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | export default { |
| | | name: 'Project', |
| | | components: { pagination, crudOperation, rrOperation, udOperation, moneyInput }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | dicts: [constant.STANDARD_UNIT_CURRENCY, constant.PROJECT_DISTINGUISH, constant.PROJECT_STATUS, constant.APPROVE_STATUS], |
| | | cruds() { |
| | | return CRUD({ title: '项目详情', url: 'api/project', idField: 'id', sort: 'id,desc', crudMethod: { ...crudProject }}) |
| | | return CRUD({ queryOnPresenterCreated: false, title: '项目详情', url: 'api/project', idField: 'id', sort: 'id,desc', crudMethod: { ...crudProject }}) |
| | | }, |
| | | data() { |
| | | // 指针重指向 |
| | |
| | | projectTypeId: [ |
| | | { required: true, message: '项目类型不能为空', trigger: 'change' } |
| | | ], |
| | | companyId: [ |
| | | { required: true, message: '公司不能为空', trigger: 'change' } |
| | | ], |
| | | projectDistinguish: [ |
| | | { required: true, message: '项目区分不能为空', trigger: 'change' } |
| | | ], |
| | | unitCurrency: [ |
| | | { required: true, message: '单价币种不能为空', trigger: 'change' } |
| | | ], |
| | | quotationPrice: [ |
| | | { required: true, message: '报价单金不能为空', trigger: 'blur' }, |
| | | projectPrice: [ |
| | | { required: true, message: '入项目金额不能为空', trigger: 'blur' }, |
| | | { validator: priceValidate, trigger: 'blur' } |
| | | ], |
| | | performancePrice: [ |
| | | { required: true, message: '绩效单金不能为空', trigger: 'blur' }, |
| | | { validator: priceValidate, trigger: 'blur' } |
| | | ], |
| | | performanceObjectives: [ |
| | | { required: true, message: '绩效目标不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | projectStatus: [ |
| | | { required: true, message: '项目状态不能为空', trigger: 'change' } |
| | |
| | | { key: 'projectTypeId', display_name: '项目类型' }, |
| | | { key: 'projectDistinguish', display_name: '项目区分' }, |
| | | { key: 'liableUserId', display_name: '责任人' }, |
| | | { key: 'projectStatus', display_name: '项目状态' }, |
| | | { key: 'projectStatusIn', display_name: '项目状态' }, |
| | | { key: 'approveStatus', display_name: '批准状态' } |
| | | ], |
| | | // 标准单价币种 |
| | |
| | | random: 0, |
| | | // 项目类型列表 |
| | | projectTypeList: [], |
| | | // 公司列表 |
| | | companyIdList: [], |
| | | // 用户列表 |
| | | userList: [], |
| | | // 选中的id |
| | |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'user' |
| | | ]) |
| | | ]), |
| | | performanceObjectives() { |
| | | if (this.form && (this.form.contractPrePrice || this.form.contractPrice) && this.form.projectPrice) { |
| | | let contractPrice = this.form.contractPrePrice |
| | | if (this.form.contractPrice) { |
| | | contractPrice = this.form.contractPrice |
| | | } |
| | | if (parseInt(contractPrice) === 0) { |
| | | return 0 |
| | | } |
| | | return ((contractPrice - this.form.projectPrice) / contractPrice * 100).toFixed(0) |
| | | } else { |
| | | return 0 |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.query.projectStatusIn = ['project_status_not_started', 'project_status_under_way'] |
| | | this.crud.toQuery() |
| | | }, |
| | | methods: { |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | |
| | | this.userRolesLevelMin = Math.min(...userRolesLevel) |
| | | // 获取项目类型 |
| | | this.getPackageTypeAll() |
| | | // 项目 |
| | | this.getCompanyIdAll() |
| | | // 获取责任人 |
| | | this.getUserListAll() |
| | | return true |
| | | }, |
| | | // 钩子:提交 - 之前 |
| | | [CRUD.HOOK.beforeSubmit]() { |
| | | this.form.performanceObjectives = this.performanceObjectives |
| | | // 责任人ID |
| | | this.form.liableUserId = null |
| | | // 循环责任人ID列表 |
| | | for (let i = 0; i < this.form.liableUserIdList.length; i++) { |
| | | // 责任人ID |
| | | this.form.liableUserId = this.form.liableUserId === null ? '-' + this.form.liableUserIdList[i] + '-' : this.form.liableUserId + ',' + '-' + this.form.liableUserIdList[i] + '-' |
| | | } |
| | | }, |
| | | // 新增与编辑前做的操作 |
| | | [CRUD.HOOK.afterToCU](crud, form) { |
| | |
| | | } |
| | | // 随机数 |
| | | this.random = Math.random() |
| | | }, |
| | | // 获取公司 |
| | | getCompanyIdAll() { |
| | | crudCompany.getAll().then(res => { |
| | | // 公司列表 |
| | | this.companyIdList = res |
| | | }).catch(() => { |
| | | |
| | | }) |
| | | }, |
| | | // 获取项目类型 |
| | | getPackageTypeAll() { |
| | |
| | | this.form.quotationPrice = res[0].standardQuotationPrice |
| | | // 单价金额赋值 |
| | | this.form.performancePrice = res[0].standardPerformancePrice |
| | | // 绩效目标赋值 |
| | | this.form.performanceObjectives = res[0].standardPerformanceObjectives |
| | | // 随机数 |
| | | this.random = Math.random() |
| | | // // 绩效目标赋值 |
| | | // this.form.performanceObjectives = res[0].standardPerformanceObjectives |
| | | }) |
| | | }, |
| | | // 取消 |
| | |
| | | projectId: data.id |
| | | } |
| | | }) |
| | | }, |
| | | // 钩子:提交 - 之前 |
| | | [CRUD.HOOK.beforeSubmit]() { |
| | | // 责任人ID |
| | | this.form.liableUserId = null |
| | | // 循环责任人ID列表 |
| | | for (let i = 0; i < this.form.liableUserIdList.length; i++) { |
| | | // 责任人ID |
| | | this.form.liableUserId = this.form.liableUserId === null ? '-' + this.form.liableUserIdList[i] + '-' : this.form.liableUserId + ',' + '-' + this.form.liableUserIdList[i] + '-' |
| | | } |
| | | } |
| | | } |
| | | } |