|
|
@ -10,40 +10,42 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="项目名称" prop="projectName"> |
|
|
<el-form-item label="项目名称" prop="projectName"> |
|
|
<el-input v-model="dataForm.projectName" ></el-input> |
|
|
|
|
|
|
|
|
<el-input v-model="dataForm.projectName" :disabled="isProjectFieldDisabled('projectName')" ></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item prop="projectTypeDb" label="项目类型"> |
|
|
<el-form-item prop="projectTypeDb" label="项目类型"> |
|
|
<dict-data-select dict-type="project_info_type_db" v-if="visible" v-model="dataForm.projectTypeDb"></dict-data-select> |
|
|
|
|
|
|
|
|
<dict-data-select dict-type="project_info_type_db" v-if="visible" v-model="dataForm.projectTypeDb" :disabled="isProjectFieldDisabled('projectTypeDb')"></dict-data-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item prop="industry" label="行业"> |
|
|
<el-form-item prop="industry" label="行业"> |
|
|
<dict-data-select dict-type="project_info_industry" v-if="visible" v-model="dataForm.industry"></dict-data-select> |
|
|
|
|
|
|
|
|
<dict-data-select dict-type="project_info_industry" v-if="visible" v-model="dataForm.industry" :disabled="isProjectFieldDisabled('industry')"></dict-data-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item prop="priority" label="优先级"> |
|
|
<el-form-item prop="priority" label="优先级"> |
|
|
<dict-data-select dict-type="project_info_priority" v-if="visible" v-model="dataForm.priority"></dict-data-select> |
|
|
|
|
|
|
|
|
<dict-data-select dict-type="project_info_priority" v-if="visible" v-model="dataForm.priority" :disabled="isProjectFieldDisabled('priority')"></dict-data-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item prop="projectManagerName"> |
|
|
<el-form-item prop="projectManagerName"> |
|
|
<span slot="label" style="" @click="managerChooseModal()"><a herf="#">项目经理</a></span> |
|
|
|
|
|
|
|
|
<span v-if="isProjectTeamFieldDisabled('projectManagerList')" slot="label">项目经理</span> |
|
|
|
|
|
<span v-else slot="label" @click="managerChooseModal()"><a herf="#">项目经理</a></span> |
|
|
<el-input v-model="dataForm.projectManagerName" readonly ></el-input> |
|
|
<el-input v-model="dataForm.projectManagerName" readonly ></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item prop="projectOwnerName" :rules="projectRole.projectOwnerName"> |
|
|
<el-form-item prop="projectOwnerName" :rules="projectRole.projectOwnerName"> |
|
|
<span slot="label" style="" @click="ownerChooseModal()"><a herf="#">项目审批人</a></span> |
|
|
|
|
|
|
|
|
<span v-if="isProjectTeamFieldDisabled('projectOwnerList')" slot="label">项目审批人</span> |
|
|
|
|
|
<span v-else slot="label" @click="ownerChooseModal()"><a herf="#">项目审批人</a></span> |
|
|
<el-input v-model="dataForm.projectOwnerName" readonly></el-input> |
|
|
<el-input v-model="dataForm.projectOwnerName" readonly></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item prop="customerId"> |
|
|
<el-form-item prop="customerId"> |
|
|
<span slot="label" style="" @click="getBaseList(102,1)"><a herf="#">客户</a></span> |
|
|
|
|
|
<el-input v-model="dataForm.customerId" @blur="getCustomerName(1)"></el-input> |
|
|
|
|
|
|
|
|
<span slot="label" style="" @click="!isProjectFieldDisabled('customerId') && getBaseList(102,1)"><a herf="#">客户</a></span> |
|
|
|
|
|
<el-input v-model="dataForm.customerId" @blur="getCustomerName(1)" :disabled="isProjectFieldDisabled('customerId')"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
@ -65,37 +67,51 @@ |
|
|
<!-- </el-col>--> |
|
|
<!-- </el-col>--> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item label="客户项目号"> |
|
|
<el-form-item label="客户项目号"> |
|
|
<el-input v-model="dataForm.customerProjectNo" ></el-input> |
|
|
|
|
|
|
|
|
<el-input v-model="dataForm.customerProjectNo" :disabled="isProjectFieldDisabled('customerProjectNo')" ></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item label="项目年销售额"> |
|
|
<el-form-item label="项目年销售额"> |
|
|
<el-input v-model="dataForm.projectAmount" @input="dataForm.projectAmount = dataForm.projectAmount.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace(/^(\d+\.\d{1,6}).*$/, '$1')"></el-input> |
|
|
|
|
|
|
|
|
<el-input v-model="dataForm.projectAmount" :disabled="isProjectFieldDisabled('projectAmount')" @input="dataForm.projectAmount = dataForm.projectAmount.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace(/^(\d+\.\d{1,6}).*$/, '$1')"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="直接客户"> |
|
|
<el-form-item label="直接客户"> |
|
|
<el-input v-model="dataForm.finalCustomerId"></el-input> |
|
|
|
|
|
|
|
|
<el-input v-model="dataForm.finalCustomerId" :disabled="isProjectFieldDisabled('finalCustomerId')"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
<el-form-item label="项目描述" style="height: 70px"> |
|
|
<el-form-item label="项目描述" style="height: 70px"> |
|
|
<el-input type="textarea" resize="none" :autosize="{minRows: 2, maxRows: 2}" v-model="dataForm.projectDesc" ></el-input> |
|
|
|
|
|
|
|
|
<el-input type="textarea" resize="none" :autosize="{minRows: 2, maxRows: 2}" v-model="dataForm.projectDesc" :disabled="isProjectFieldDisabled('projectDesc')" ></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="客户应用/要求" style="height: 70px"> |
|
|
<el-form-item label="客户应用/要求" style="height: 70px"> |
|
|
<el-input type="textarea" resize="none" :autosize="{minRows: 2, maxRows: 2}" v-model="dataForm.customerRemark" ></el-input> |
|
|
|
|
|
|
|
|
<el-input type="textarea" resize="none" :autosize="{minRows: 2, maxRows: 2}" v-model="dataForm.customerRemark" :disabled="isProjectFieldDisabled('customerRemark')" ></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="其他要求" style="height: 70px"> |
|
|
<el-form-item label="其他要求" style="height: 70px"> |
|
|
<el-input type="textarea" resize="none" :autosize="{minRows: 2, maxRows: 2}" v-model="dataForm.remark" ></el-input> |
|
|
|
|
|
|
|
|
<el-input type="textarea" resize="none" :autosize="{minRows: 2, maxRows: 2}" v-model="dataForm.remark" :disabled="isProjectFieldDisabled('remark')" ></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item prop="userRoleName" :rules="projectRole.userRoleName"> |
|
|
<el-form-item prop="userRoleName" :rules="projectRole.userRoleName"> |
|
|
<span slot="label" style="" @click="userRollModal()"><a herf="#">项目权限</a></span> |
|
|
|
|
|
<el-input v-model="dataForm.userRoleName" ></el-input> |
|
|
|
|
|
|
|
|
<span slot="label" style="" @click="!isProjectFieldDisabled('userRoleName') && userRollModal()"><a herf="#">项目权限</a></span> |
|
|
|
|
|
<el-input v-model="dataForm.userRoleName" :disabled="isProjectFieldDisabled('userRoleName')" ></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<el-button type="primary" @click="dataFormSubmit()">{{'确定'}}</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" v-if="canSaveAction()" @click="dataFormSubmit()">{{'确定'}}</el-button> |
|
|
<el-button type="primary" @click="visible = false">{{'关闭'}}</el-button> |
|
|
<el-button type="primary" @click="visible = false">{{'关闭'}}</el-button> |
|
|
|
|
|
<el-button type="primary" v-if="canAgreeAction()" :loading="submitLoading" @click="agreeSubmit">同意</el-button> |
|
|
|
|
|
<el-button type="primary" v-if="canRejectAction()" :loading="submitLoading" @click="openRejectModal">驳回</el-button> |
|
|
|
|
|
</span> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="驳回" top="30vh" :close-on-click-modal="false" :visible.sync="submitModalFlag" width="500px"> |
|
|
|
|
|
<el-form label-position="top"> |
|
|
|
|
|
<el-form-item label="驳回意见"> |
|
|
|
|
|
<el-input type="textarea" v-model="rejectOpinion" :rows="3" resize="none"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button type="primary" :loading="submitLoading" @click="rejectSubmit">确定</el-button> |
|
|
|
|
|
<el-button type="primary" @click="submitModalFlag = false">取消</el-button> |
|
|
</span> |
|
|
</span> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
@ -248,6 +264,7 @@ |
|
|
searchUserRoll, |
|
|
searchUserRoll, |
|
|
searchSelectionUserRole, |
|
|
searchSelectionUserRole, |
|
|
saveProjectInfo, |
|
|
saveProjectInfo, |
|
|
|
|
|
submitProjectInfo, |
|
|
} from "@/api/project/project.js" |
|
|
} from "@/api/project/project.js" |
|
|
import Chooselist from '@/views/modules/common/Chooselist' |
|
|
import Chooselist from '@/views/modules/common/Chooselist' |
|
|
import DictDataSelect from "../../sys/dict-data-select.vue"; |
|
|
import DictDataSelect from "../../sys/dict-data-select.vue"; |
|
|
@ -255,6 +272,8 @@ |
|
|
} from "@/api/customer/customerInformation"; |
|
|
} from "@/api/customer/customerInformation"; |
|
|
import item from "../../code/item.vue"; |
|
|
import item from "../../code/item.vue"; |
|
|
import {queryUsernameByRoleSuperFlag} from "../../../../api/project/project"; |
|
|
import {queryUsernameByRoleSuperFlag} from "../../../../api/project/project"; |
|
|
|
|
|
import {getNodeAuthority, checkSuperAdmin} from "@/api/changeManagement/changeManagement" |
|
|
|
|
|
import {isAuth} from "../../../../utils"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
@ -281,6 +300,17 @@ |
|
|
managerFlag:false, |
|
|
managerFlag:false, |
|
|
userRoleFlag:false, |
|
|
userRoleFlag:false, |
|
|
ownerFlag:false, |
|
|
ownerFlag:false, |
|
|
|
|
|
submitModalFlag:false, |
|
|
|
|
|
submitLoading:false, |
|
|
|
|
|
rejectOpinion:'', |
|
|
|
|
|
nodeAuthorityLoaded: true, |
|
|
|
|
|
plmProjectAuthorityArr: [], |
|
|
|
|
|
plmProjectTeamAuthorityArr: [], |
|
|
|
|
|
menuId: '101002001', |
|
|
|
|
|
authSubmit: false, |
|
|
|
|
|
authReject: false, |
|
|
|
|
|
superAdmin: false, |
|
|
|
|
|
createBy2: this.$store.state.user.name, |
|
|
operatorList:[], |
|
|
operatorList:[], |
|
|
dataForm: { |
|
|
dataForm: { |
|
|
id: 0, |
|
|
id: 0, |
|
|
@ -313,6 +343,11 @@ |
|
|
userRoleList:[], |
|
|
userRoleList:[], |
|
|
productSet:'', |
|
|
productSet:'', |
|
|
projectAmount:'', |
|
|
projectAmount:'', |
|
|
|
|
|
status:'草稿', |
|
|
|
|
|
stepId: 10, |
|
|
|
|
|
rejectFlag: 'N', |
|
|
|
|
|
createBy2: '', |
|
|
|
|
|
isReject: 'N' |
|
|
}, |
|
|
}, |
|
|
userRoleForm:{ |
|
|
userRoleForm:{ |
|
|
username:'', |
|
|
username:'', |
|
|
@ -374,7 +409,12 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created () { |
|
|
created () { |
|
|
|
|
|
|
|
|
|
|
|
this.menuId = (this.$route.meta && this.$route.meta.menuId) || this.menuId |
|
|
|
|
|
this.authSubmit = isAuth(this.menuId + ':submit') |
|
|
|
|
|
this.authReject = isAuth(this.menuId + ':reject') |
|
|
|
|
|
checkSuperAdmin().then(({data}) => { |
|
|
|
|
|
this.superAdmin = !!(data && data.superAdmin) |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
watch:{ |
|
|
watch:{ |
|
|
userRoleFlag(newVal,oldVal){ |
|
|
userRoleFlag(newVal,oldVal){ |
|
|
@ -544,6 +584,7 @@ |
|
|
this.dataForm.projectOwnerList=data.rows |
|
|
this.dataForm.projectOwnerList=data.rows |
|
|
}) |
|
|
}) |
|
|
this.searchUserRollAll(); |
|
|
this.searchUserRollAll(); |
|
|
|
|
|
this.loadNodeAuthority(this.dataForm.site, this.dataForm.stepId || 10) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else { // 项目新增 |
|
|
} else { // 项目新增 |
|
|
@ -578,7 +619,15 @@ |
|
|
userRoleList: [], |
|
|
userRoleList: [], |
|
|
productSet: '', |
|
|
productSet: '', |
|
|
projectAmount: '', |
|
|
projectAmount: '', |
|
|
|
|
|
status: '草稿', |
|
|
|
|
|
stepId: 10, |
|
|
|
|
|
rejectFlag: 'N', |
|
|
|
|
|
createBy2: '', |
|
|
|
|
|
isReject: 'N' |
|
|
} |
|
|
} |
|
|
|
|
|
this.plmProjectAuthorityArr = [] |
|
|
|
|
|
this.plmProjectTeamAuthorityArr = [] |
|
|
|
|
|
this.nodeAuthorityLoaded = true |
|
|
// 默认插入当前用户 |
|
|
// 默认插入当前用户 |
|
|
this.addRollForUsername(this.$store.state.user.name,this.$store.state.user.userDisplay) |
|
|
this.addRollForUsername(this.$store.state.user.name,this.$store.state.user.userDisplay) |
|
|
// this.searchUserRollAll(); |
|
|
// this.searchUserRollAll(); |
|
|
@ -658,13 +707,6 @@ |
|
|
return this.projectManagerList.includes(item.operatorId); |
|
|
return this.projectManagerList.includes(item.operatorId); |
|
|
}) |
|
|
}) |
|
|
projectManagerName=selectionManagerList.map(item => item.operatorName).join(';'); |
|
|
projectManagerName=selectionManagerList.map(item => item.operatorName).join(';'); |
|
|
// for (let i = 0; i < this.projectManagerList.length; i++) { |
|
|
|
|
|
// let select= this.operatorList.filter(item => item.operatorId === this.projectManagerList[i]) |
|
|
|
|
|
// if(select.length > 0){ |
|
|
|
|
|
// projectManagerName+=select[0].operatorName+';' |
|
|
|
|
|
// this.addRollForUsername(select[0].operatorId,select[0].operatorName); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
for (let i = 0; i < selectionManagerList.length; i++) { |
|
|
for (let i = 0; i < selectionManagerList.length; i++) { |
|
|
let row = selectionManagerList[i] |
|
|
let row = selectionManagerList[i] |
|
|
this.addRollForUsername(row.operatorId,row.operatorName) |
|
|
this.addRollForUsername(row.operatorId,row.operatorName) |
|
|
@ -702,8 +744,6 @@ |
|
|
this.dataForm.projectOwnerName = projectOwnerName |
|
|
this.dataForm.projectOwnerName = projectOwnerName |
|
|
this.dataForm.projectOwnerList=JSON.parse(JSON.stringify(this.projectOwnerList)); |
|
|
this.dataForm.projectOwnerList=JSON.parse(JSON.stringify(this.projectOwnerList)); |
|
|
this.ownerFlag=false |
|
|
this.ownerFlag=false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
addRollForUsername(username,userDisplay){ |
|
|
addRollForUsername(username,userDisplay){ |
|
|
if(this.dataForm.userRoleList.length>0) { |
|
|
if(this.dataForm.userRoleList.length>0) { |
|
|
@ -910,6 +950,173 @@ |
|
|
this.$refs.saveForm.resetFields(); |
|
|
this.$refs.saveForm.resetFields(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
isCurrentApprover () { |
|
|
|
|
|
return this.superAdmin || (this.dataForm.createBy2 && String(this.dataForm.createBy2).split(';').includes(this.createBy2)) |
|
|
|
|
|
}, |
|
|
|
|
|
canSaveAction () { |
|
|
|
|
|
if (this.dataForm.status === '已完成') { |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
if (!this.dataForm.status || this.dataForm.status === '草稿') { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
return this.dataForm.status === '审批中' && this.isCurrentApprover() |
|
|
|
|
|
}, |
|
|
|
|
|
canAgreeAction () { |
|
|
|
|
|
return this.authSubmit && this.isCurrentApprover() && this.dataForm.status === '审批中' |
|
|
|
|
|
}, |
|
|
|
|
|
canRejectAction () { |
|
|
|
|
|
return this.authReject && this.isCurrentApprover() && this.dataForm.status === '审批中' && this.dataForm.isReject === 'Y' |
|
|
|
|
|
}, |
|
|
|
|
|
projectFieldFlag (fieldId) { |
|
|
|
|
|
if (!this.plmProjectAuthorityArr || this.plmProjectAuthorityArr.length === 0) { |
|
|
|
|
|
return this.dataForm.id ? 'N' : 'Y' |
|
|
|
|
|
} |
|
|
|
|
|
let target = this.plmProjectAuthorityArr.find(item => item.fieldId === fieldId) |
|
|
|
|
|
return target ? target.updateFlag : 'N' |
|
|
|
|
|
}, |
|
|
|
|
|
isProjectFieldDisabled (fieldId) { |
|
|
|
|
|
if (this.dataForm.status === '已完成') { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
if (!this.dataForm.id) { |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
return this.projectFieldFlag(fieldId) === 'N' |
|
|
|
|
|
}, |
|
|
|
|
|
plmProjectTeamArrFlag (fieldId) { |
|
|
|
|
|
if (!this.plmProjectTeamAuthorityArr) { |
|
|
|
|
|
return 'N' |
|
|
|
|
|
} |
|
|
|
|
|
let arr = this.plmProjectTeamAuthorityArr.filter(a => a.fieldId === fieldId) |
|
|
|
|
|
if (arr.length > 0) { |
|
|
|
|
|
return arr[0].updateFlag |
|
|
|
|
|
} |
|
|
|
|
|
return 'N' |
|
|
|
|
|
}, |
|
|
|
|
|
isProjectTeamFieldDisabled (fieldId) { |
|
|
|
|
|
if (this.dataForm.status === '已完成') { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
if (!this.dataForm.id || this.dataForm.status === '草稿') { |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
return this.plmProjectTeamArrFlag(fieldId) === 'N' |
|
|
|
|
|
}, |
|
|
|
|
|
loadNodeAuthority (site, stepId) { |
|
|
|
|
|
if (!site || stepId === null || stepId === undefined || !this.menuId) { |
|
|
|
|
|
this.plmProjectAuthorityArr = [] |
|
|
|
|
|
this.plmProjectTeamAuthorityArr = [] |
|
|
|
|
|
this.nodeAuthorityLoaded = true |
|
|
|
|
|
return Promise.resolve() |
|
|
|
|
|
} |
|
|
|
|
|
this.nodeAuthorityLoaded = false |
|
|
|
|
|
return getNodeAuthority({ |
|
|
|
|
|
site: site, |
|
|
|
|
|
stepId: stepId, |
|
|
|
|
|
menuId: this.menuId |
|
|
|
|
|
}).then(({data}) => { |
|
|
|
|
|
if (data && data.code === 0 && data.rows) { |
|
|
|
|
|
this.plmProjectAuthorityArr = data.rows.plm_project_info || [] |
|
|
|
|
|
this.plmProjectTeamAuthorityArr = data.rows.plm_project_team || [] |
|
|
|
|
|
} else { |
|
|
|
|
|
this.plmProjectAuthorityArr = [] |
|
|
|
|
|
this.plmProjectTeamAuthorityArr = [] |
|
|
|
|
|
} |
|
|
|
|
|
this.nodeAuthorityLoaded = true |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.plmProjectAuthorityArr = [] |
|
|
|
|
|
this.plmProjectTeamAuthorityArr = [] |
|
|
|
|
|
this.nodeAuthorityLoaded = true |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
validateSubmitRequiredFields () { |
|
|
|
|
|
if (this.plmProjectAuthorityArr) { |
|
|
|
|
|
for (let i = 0; i < this.plmProjectAuthorityArr.length; i++) { |
|
|
|
|
|
const fieldConfig = this.plmProjectAuthorityArr[i] |
|
|
|
|
|
if (fieldConfig.required !== 'Y') { |
|
|
|
|
|
continue |
|
|
|
|
|
} |
|
|
|
|
|
const value = this.dataForm[fieldConfig.fieldId] |
|
|
|
|
|
if (value === null || value === undefined || String(value).trim() === '') { |
|
|
|
|
|
this.$message.warning((fieldConfig.fieldName || fieldConfig.fieldId) + '不能为空!') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (this.plmProjectTeamAuthorityArr) { |
|
|
|
|
|
for (let i = 0; i < this.plmProjectTeamAuthorityArr.length; i++) { |
|
|
|
|
|
const fieldConfig = this.plmProjectTeamAuthorityArr[i] |
|
|
|
|
|
if (fieldConfig.required !== 'Y') { |
|
|
|
|
|
continue |
|
|
|
|
|
} |
|
|
|
|
|
const value = this.dataForm[fieldConfig.fieldId] |
|
|
|
|
|
if (!value || value.length === 0) { |
|
|
|
|
|
this.$message.warning((fieldConfig.fieldName || fieldConfig.fieldId) + '不能为空!') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return true |
|
|
|
|
|
}, |
|
|
|
|
|
agreeSubmit () { |
|
|
|
|
|
if (!this.canAgreeAction()) { |
|
|
|
|
|
this.$message.warning('当前状态不允许同意') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.$confirm('确认同意该项目?', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
this.submitProject('Y') |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
openRejectModal () { |
|
|
|
|
|
if (!this.canRejectAction()) { |
|
|
|
|
|
this.$message.warning('当前状态不允许驳回') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.rejectOpinion = '' |
|
|
|
|
|
this.submitModalFlag = true |
|
|
|
|
|
}, |
|
|
|
|
|
rejectSubmit () { |
|
|
|
|
|
if (!this.rejectOpinion || !this.rejectOpinion.trim()) { |
|
|
|
|
|
this.$message.warning('请填写驳回意见') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.submitProject('N') |
|
|
|
|
|
}, |
|
|
|
|
|
submitProject (nodeConclusion) { |
|
|
|
|
|
if (!this.nodeAuthorityLoaded) { |
|
|
|
|
|
this.$message.warning('节点权限加载中,请稍后重试') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (nodeConclusion === 'Y' && !this.validateSubmitRequiredFields()) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.submitLoading = true |
|
|
|
|
|
submitProjectInfo({ |
|
|
|
|
|
...this.dataForm, |
|
|
|
|
|
nodeConclusion: nodeConclusion, |
|
|
|
|
|
rejectOpinion: this.rejectOpinion, |
|
|
|
|
|
menuId: this.menuId |
|
|
|
|
|
}).then(({data}) => { |
|
|
|
|
|
this.submitLoading = false |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.$message.success(nodeConclusion === 'Y' ? '同意成功' : '驳回成功') |
|
|
|
|
|
this.submitModalFlag = false |
|
|
|
|
|
this.visible = false |
|
|
|
|
|
this.$emit('refreshDataList', this.dataForm.projectId) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error((data && data.msg) || '提交失败') |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
this.submitLoading = false |
|
|
|
|
|
this.$message.error((err && err.message) || '提交失败') |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
updateDataForm (val) { |
|
|
updateDataForm (val) { |
|
|
this.dataForm.projectId = val; |
|
|
this.dataForm.projectId = val; |
|
|
}, |
|
|
}, |
|
|
|