update 未符合项跟踪流程
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
v-decorator="['processDueDate']"
|
||||
:disabled="disabled"
|
||||
:disabled="disabledProcessInfo"
|
||||
style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -50,7 +50,7 @@
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:maxLength="500"
|
||||
type="textarea"
|
||||
:disabled="disabled"
|
||||
:disabled="disabledProcessInfo"
|
||||
v-decorator="['processDescription']" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
@@ -65,34 +65,41 @@
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('projectLibrary.vehicleItemLibrary.standardNumberStandardName')"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:maxLength="50"
|
||||
v-decorator="['standardNumberName', validatorRules.standardNumberName]" />
|
||||
v-decorator="['standardNumberOrName', validatorRules.standardNumberOrName]" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
<!--项目名称-->
|
||||
<div class="form-flex-item custom-flex-form-item">
|
||||
<a-form-item :label="$t('projectLibrary.projectName')">
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('projectLibrary.vehicleItemLibrary.standardNumberStandardName')"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:maxLength="50"
|
||||
v-decorator="['projectName']" />
|
||||
<a-select :placeholder="$t('pleaseSelect') + $t('project')"
|
||||
v-decorator="['projectId']"
|
||||
show-search
|
||||
allowClear
|
||||
:filter-option="filterOption">
|
||||
<a-select-option v-for="item in projectSelectOptions" :key="item.id">{{ item.projectName }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<!--设计工程师-->
|
||||
<div class="form-flex-item custom-flex-form-item">
|
||||
<a-form-item :label="$t('workCenter.standardConsultationProcess.designEngineer')">
|
||||
<user-selection v-decorator="['designEngineer', validatorRules.designEngineer]"
|
||||
type="checkbox"
|
||||
:placeholder="$t('pleaseSelect') + $t('workCenter.standardConsultationProcess.designEngineer')" />
|
||||
<user-selection v-decorator="['engineerId', validatorRules.engineerId]"
|
||||
:name-str="businessInfo.engineerId_dictText"
|
||||
:placeholder="$t('pleaseSelect') + $t('workCenter.standardConsultationProcess.designEngineer')"
|
||||
@nameChange="handleDesignEngineerNameChange" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
|
||||
<!--按条件查询-->
|
||||
<a-button type="primary" class="form-search-btn" @click="selectStandard">{{ $t('workCenter.noMatchTracking.queryByCondition') }}</a-button>
|
||||
<a-button type="primary" class="form-search-btn" @click="selectStandard">
|
||||
{{ $t('workCenter.noMatchTracking.queryByCondition') }}
|
||||
</a-button>
|
||||
</div>
|
||||
|
||||
</a-form>
|
||||
|
||||
<component v-if="tableComponent"
|
||||
<component ref="expandTable"
|
||||
v-if="tableComponent"
|
||||
:is="tableComponent"
|
||||
:columns="columns"
|
||||
:data-source="dataSource"
|
||||
@@ -162,7 +169,9 @@
|
||||
</div>
|
||||
|
||||
<!--按条件查询选择标准弹框-->
|
||||
<no-match-item-select-drawer ref="selectStandardDrawer" @listChange="handleStandardSelected" />
|
||||
<no-match-item-select-drawer ref="selectStandardDrawer" @ok="handleStandardSelected" />
|
||||
<!--转办选人-->
|
||||
<user-select-modal type="radio" ref="userSelectModal" @change="continueTransfer" />
|
||||
</internal-detail-page>
|
||||
</template>
|
||||
|
||||
@@ -174,16 +183,24 @@ import { WorkCenterMixin } from '../../../mixins/WorkCenterMixin'
|
||||
import { ProcessKey, NoMatchTrackingNodes } from '../../../enums/commonEnums'
|
||||
import UserSelection from '../../../components/selection/UserSelection'
|
||||
import NoMatchItemSelectDrawer from './modules/NoMatchItemSelectDrawer'
|
||||
import { getCarTypeProjectList } from '../../../api/projectLibraryApi'
|
||||
import {
|
||||
saveNoMatchTrackingProcess,
|
||||
queryNoMatchTrackingProcess,
|
||||
initialNoMatchTrackingProcess,
|
||||
submitNoMatchTrackingProcess, processTransfer, agreeNoMatchTrackingProcess, rejectNoMatchTrackingProcess
|
||||
} from '../../../api/workCenter'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import UserSelectModal from '../../../components/selection/UserSelectModal'
|
||||
|
||||
export default {
|
||||
name: 'NoMatchTrackingProcess',
|
||||
components: { ProcessDetailList, InternalDetailPage, PersonnelInfo, UserSelection, NoMatchItemSelectDrawer },
|
||||
components: { UserSelectModal, ProcessDetailList, InternalDetailPage, PersonnelInfo, UserSelection, NoMatchItemSelectDrawer },
|
||||
mixins: [WorkCenterMixin],
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
btnList: [],
|
||||
disabled: false,
|
||||
// 流程信息表单
|
||||
processInfoForm: this.$form.createForm(this),
|
||||
processInfo: {},
|
||||
@@ -193,7 +210,7 @@ export default {
|
||||
// 业务基本信息表单(发起时候的查询条件)
|
||||
businessInfoForm: this.$form.createForm(this),
|
||||
businessInfo: {},
|
||||
currentNode: '2',
|
||||
currentNode: null,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 4 }
|
||||
@@ -217,12 +234,15 @@ export default {
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
// 标准编号/标准名称
|
||||
standardNumberName: {
|
||||
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('projectLibrary.vehicleItemLibrary.standardNumberStandardName') }],
|
||||
standardNumberOrName: {
|
||||
rules: [{
|
||||
required: true,
|
||||
message: this.$t('pleaseEnter') + this.$t('projectLibrary.vehicleItemLibrary.standardNumberStandardName')
|
||||
}],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
// 设计工程师
|
||||
designEngineer: {
|
||||
engineerId: {
|
||||
rules: [{ required: true, message: this.$t('pleaseSelect') + this.$t('workCenter.standardConsultationProcess.designEngineer') }],
|
||||
validateTrigger: 'change'
|
||||
}
|
||||
@@ -243,17 +263,9 @@ export default {
|
||||
width: 150,
|
||||
scopedSlots: { customRender: 'detail' }
|
||||
},
|
||||
// 问题类型
|
||||
{
|
||||
dataIndex: '1',
|
||||
title: this.$t('workCenter.noMatchTracking.problemTypes'),
|
||||
width: 150,
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
// 条款号
|
||||
{
|
||||
dataIndex: 'termNumber',
|
||||
dataIndex: 'termNum',
|
||||
title: this.$t('workCenter.enStandardRevision.clauseNumber'),
|
||||
width: 150,
|
||||
align: 'center',
|
||||
@@ -267,11 +279,19 @@ export default {
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
// 问题类型
|
||||
{
|
||||
dataIndex: 'assessResults_dictText',
|
||||
title: this.$t('workCenter.noMatchTracking.problemTypes'),
|
||||
width: 150,
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
// 相关项目
|
||||
{
|
||||
title: this.$t('projectLibrary.noncoincidenceItem.relevantProject'),
|
||||
width: 150,
|
||||
dataIndex: '2',
|
||||
dataIndex: 'projectName',
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
@@ -285,7 +305,7 @@ export default {
|
||||
},
|
||||
// 设计工程师
|
||||
{
|
||||
dataIndex: 'engineerName',
|
||||
dataIndex: 'engineerId_dictText',
|
||||
title: this.$t('workCenter.standardConsultationProcess.designEngineer'),
|
||||
width: 120,
|
||||
align: 'center',
|
||||
@@ -300,18 +320,18 @@ export default {
|
||||
scopedSlots: { customRender: 'text' }
|
||||
}
|
||||
],
|
||||
dataSource: [{ id: 1, standardNumber: '124' }],
|
||||
dataSource: [],
|
||||
// 展开表格的规则
|
||||
extraForm: {
|
||||
rules: {
|
||||
// 依据描述
|
||||
basisDescription: {
|
||||
description: {
|
||||
required: true,
|
||||
message: this.$t('pleaseEnter') + this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
// 佐证材料
|
||||
basisFile: {
|
||||
fileId: {
|
||||
required: false,
|
||||
message: this.$t('pleaseUpload') + this.$t('projectLibrary.specialProjectLibrary.supportingMaterial'),
|
||||
trigger: 'change'
|
||||
@@ -321,20 +341,22 @@ export default {
|
||||
{
|
||||
fieldShowType: 1,
|
||||
dbFieldTxt: this.$t('projectLibrary.specialProjectLibrary.basisDescription'),
|
||||
dbFieldName: 'basisDescription'
|
||||
dbFieldName: 'description'
|
||||
},
|
||||
{
|
||||
fieldShowType: 2,
|
||||
dbFieldTxt: this.$t('projectLibrary.specialProjectLibrary.supportingMaterial'),
|
||||
dbFieldName: 'basisFile'
|
||||
dbFieldName: 'fileId'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
projectSelectOptions: [] // 项目下拉数据
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
pageTitle () {
|
||||
return `${this.$t('flowCenter')}${this.$route.meta.title}`
|
||||
const subTitle = this.$route.query.taskName || NoMatchTrackingNodes.initial.text
|
||||
return `${this.$t('flowCenter')}${this.$route.meta.title}(${subTitle})`
|
||||
},
|
||||
// 是否展示选择标准的表单
|
||||
showSelectStandardForm () {
|
||||
@@ -350,27 +372,78 @@ export default {
|
||||
// 展开表格是否禁用,设计工程师上传整改材料节点不禁用
|
||||
expandTableDisabled () {
|
||||
return this.currentNode !== NoMatchTrackingNodes.designEngineer.value
|
||||
},
|
||||
// 禁用流程信息部分表单
|
||||
disabledProcessInfo () {
|
||||
return this.currentNode !== NoMatchTrackingNodes.initial.value
|
||||
}
|
||||
},
|
||||
created () {
|
||||
// if (this.$route.query.processInstanceId || this.$route.query.draftId) {
|
||||
// this.currentNode = this.$route.query.nodeId
|
||||
// this.initProcessInfo()
|
||||
// } else {
|
||||
// this.currentNode = NoMatchTrackingNodes.initial.value
|
||||
// }
|
||||
this.initDict()
|
||||
if (this.$route.query.processInstanceId || this.$route.query.draftId) {
|
||||
this.currentNode = this.$route.query.nodeId || NoMatchTrackingNodes.initial.value
|
||||
this.initProcessInfo()
|
||||
} else {
|
||||
this.currentNode = NoMatchTrackingNodes.initial.value
|
||||
}
|
||||
// 如果节点不是固定节点,就默认显示审批节点的信息
|
||||
this.btnList = NoMatchTrackingNodes.propertyOfValue('btn', this.currentNode) || NoMatchTrackingNodes.regulatoryEngineer.btn
|
||||
this.getPersonInfoStructure(ProcessKey.NO_MATCH_TRACKING.value, () => {
|
||||
this.initPersonInfoData(this.current)
|
||||
this.initPersonInfoData(this.currentNode === NoMatchTrackingNodes.initial.value)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取下拉数据
|
||||
*/
|
||||
initDict () {
|
||||
getCarTypeProjectList().then(res => {
|
||||
if (res.success) {
|
||||
this.projectSelectOptions = res.result
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取流程信息
|
||||
*/
|
||||
initProcessInfo () {
|
||||
|
||||
this.loading = true
|
||||
const params = {
|
||||
taskId: this.$route.query.taskId
|
||||
}
|
||||
if (this.$route.query.draftId) {
|
||||
params.draftId = this.$route.query.draftId
|
||||
} else {
|
||||
params.processInstanceId = this.$route.query.processInstanceId
|
||||
}
|
||||
queryNoMatchTrackingProcess(params).then(res => {
|
||||
if (res.success) {
|
||||
const { result = {} } = res
|
||||
// 草稿从json里取得
|
||||
if (this.$route.query.draftId) {
|
||||
const draftResult = JSON.parse(result.infoJsonStr)
|
||||
this.processInfo = draftResult.processInfo
|
||||
this.businessInfo = draftResult.businessInfo
|
||||
this.dataSource = draftResult.dataSource || []
|
||||
this.approvalInfo = draftResult.approvalInfo
|
||||
} else {
|
||||
this.processInfo = result.basicProcessInfoDTO || {}
|
||||
this.dataSource = result.businessInfoDTO.processProjectNotMetLinks || []
|
||||
this.approvalInfo = result.basicTaskInfoDTO || {}
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.processInfoForm.setFieldsValue(this.processInfo)
|
||||
this.businessInfoForm.setFieldsValue(this.businessInfo)
|
||||
this.approvalInfoForm.setFieldsValue(this.approvalInfo)
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 选择标准
|
||||
@@ -378,7 +451,8 @@ export default {
|
||||
selectStandard () {
|
||||
this.businessInfoForm.validateFields((errors, values) => {
|
||||
if (!errors) {
|
||||
this.$refs.selectStandardDrawer.open(values)
|
||||
const selectedNoMatchItemKeys = this.dataSource.map(item => item.id)
|
||||
this.$refs.selectStandardDrawer.open(values, selectedNoMatchItemKeys)
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -417,6 +491,182 @@ export default {
|
||||
this.$openPageNewSheet({
|
||||
path, query
|
||||
})
|
||||
},
|
||||
filterOption (input, option) {
|
||||
return (
|
||||
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
)
|
||||
},
|
||||
/**
|
||||
* 转办
|
||||
*/
|
||||
handleTurnTo () {
|
||||
this.$refs.userSelectModal.open()
|
||||
},
|
||||
continueTransfer (userId) {
|
||||
const params = {
|
||||
taskId: this.$route.query.taskId,
|
||||
userId
|
||||
}
|
||||
this.loading = true
|
||||
processTransfer(params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
handleSave () {
|
||||
const processInfo = Object.assign(this.processInfo, this.processInfoForm.getFieldsValue())
|
||||
const businessInfo = Object.assign(this.businessInfo, this.businessInfoForm.getFieldsValue())
|
||||
const approvalInfo = Object.assign(this.approvalInfo, this.approvalInfoForm.getFieldsValue())
|
||||
const checkValueArr = Object.values({ ...processInfo, ...businessInfo, ...approvalInfo })
|
||||
if (!checkValueArr.some(tt => !tt) && this.dataSource.length === 0) {
|
||||
// 提示至少填写一项
|
||||
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
|
||||
return
|
||||
}
|
||||
const formData = { processInfo, businessInfo, approvalInfo, dataSource: this.dataSource }
|
||||
this.loading = true
|
||||
saveNoMatchTrackingProcess({ infoJsonStr: JSON.stringify(formData) }).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 处理表单数据
|
||||
*/
|
||||
dealFormData () {
|
||||
let flag = true, basicProcessInfoDTO = {}, basicTaskInfoDTO = {}, userInfoMap = {}
|
||||
this.processInfoForm.validateFields((errors, values) => {
|
||||
if (!errors) {
|
||||
basicProcessInfoDTO = Object.assign(this.processInfo, values)
|
||||
} else {
|
||||
flag = false
|
||||
}
|
||||
})
|
||||
this.approvalInfoForm.validateFields((errors, values) => {
|
||||
if (!errors) {
|
||||
basicTaskInfoDTO = Object.assign(this.approvalInfo, values)
|
||||
basicTaskInfoDTO.taskId = this.$route.query.taskId
|
||||
} else {
|
||||
flag = false
|
||||
}
|
||||
})
|
||||
// 发起节点表格无数据需要提示
|
||||
if (this.currentNode === NoMatchTrackingNodes.initial.value && this.dataSource.length === 0) {
|
||||
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
|
||||
flag = false
|
||||
}
|
||||
// 展示展开表格,且不被禁用,需要校验表格的表单
|
||||
if (!this.showSelectStandardForm && !this.expandTableDisabled && !this.$refs.expandTable.submit()) {
|
||||
this.$message.warning(this.$t('workCenter.checkTableRequired'))
|
||||
flag = false
|
||||
}
|
||||
const basicFlag = flag
|
||||
// 用户信息
|
||||
const userInfo = this.$refs.personnelInfo.getDataObjVerify()
|
||||
if (!userInfo) {
|
||||
flag = false
|
||||
} else {
|
||||
userInfoMap = userInfo
|
||||
}
|
||||
if (!flag && !basicFlag) {
|
||||
this.switchValue = 'base'
|
||||
} else if (!flag && !userInfo) {
|
||||
this.switchValue = 'user'
|
||||
}
|
||||
const formData = {
|
||||
basicProcessInfoDTO,
|
||||
basicTaskInfoDTO,
|
||||
businessInfoDTO: {
|
||||
processProjectNotMetLinks: cloneDeep(this.dataSource)
|
||||
},
|
||||
userInfoMap
|
||||
}
|
||||
return !flag ? false : formData
|
||||
},
|
||||
/**
|
||||
* 提交
|
||||
*/
|
||||
handleSubmit () {
|
||||
const formData = this.dealFormData()
|
||||
if (!formData) {
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
const submitFunc = this.currentNode === NoMatchTrackingNodes.initial.value ? initialNoMatchTrackingProcess : submitNoMatchTrackingProcess
|
||||
submitFunc(formData).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 同意
|
||||
*/
|
||||
handleAgree () {
|
||||
this.validatorRules.handleText.rules[0].required = false
|
||||
if (!this.approvalInfoForm.getFieldValue('handleText')) {
|
||||
this.approvalInfoForm.setFieldsValue({ handleText: '同意' })
|
||||
}
|
||||
const formData = this.dealFormData()
|
||||
if (!formData) {
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
agreeNoMatchTrackingProcess(formData).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 驳回
|
||||
*/
|
||||
handleReject () {
|
||||
this.validatorRules.handleText.rules[0].required = true
|
||||
const formData = this.dealFormData()
|
||||
if (!formData) {
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
rejectNoMatchTrackingProcess(formData).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleDesignEngineerNameChange (name) {
|
||||
this.businessInfo.engineerId_dictText = name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user