认证清单添加发布、发起任务的截止时间

This commit is contained in:
范强强
2023-04-17 14:05:54 +08:00
parent 57a3fe8695
commit 8c7e99a932
2 changed files with 246 additions and 34 deletions
@@ -0,0 +1,143 @@
<template>
<a-modal
:title="title"
:width="500"
:visible="visible"
:confirm-loading="confirmLoading"
:maskClosable="false"
@ok="handleOk"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text-index">
<div class="title-text-index" style="width: 100px">
<span class="Required">*</span>
<span class="title-text-text"
:title="$t('cutoffTime')">
{{ $t('cutoffTime') }}
</span>
</div>
<a-form-model-item class="itemModel" style="width: calc(100% - 120px)" :prop="queryData.dutyDueDate">
<a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+$t('cutoffTime')"
@change="dateChange({'db_field_name':queryData.dutyDueDate})"
format="YYYY-MM-DD"
:disabledDate="disabledDate"
:getCalendarContainer="(trigger) => trigger.parentNode"
v-model="formInline[queryData.dutyDueDate]"
style="width: 100%"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-spin>
</a-modal>
</template>
<script>
import moment from 'moment'
export default {
name: 'deadlineForm',
data() {
return {
title: '',
visible: false,
confirmLoading: false,
formInline: {},
rules: {},
queryData:{},
}
},
methods: {
getData(val) {
this.queryData = val
this.title = val.title
this.visible = true
this.formInline = {}
this.confirmLoading = false
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
this.rules[val.dutyDueDate] = [
{
required: true,
message: this.$t('cutoffTime') + this.$t('cannotEmpty'),
trigger: 'change'
},
]
})
},
handleOk() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.$emit('deadlineDataForm', this.queryData,this.formInline)
this.confirmLoading = true
}
})
},
handleCancel() {
this.visible = false
},
//时间禁用
disabledDate(current) {
return current && current < moment().subtract(1, 'day')
},
dateChange(item) {
this.formInline[item.db_field_name] = this.formInline[item.db_field_name] ? moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD') : ''
}
}
}
</script>
<style scoped>
.box-title-text-index {
line-height: 1.4;
display: flex;
}
.title-text {
width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.title-text-index {
width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 40px;
}
.box-input {
display: inline-block;
width: calc(100% - 120px);
height: 38px;
margin-top: 2px;
}
.Required {
color: red;
margin-right: 4px;
}
</style>
@@ -423,6 +423,7 @@
<viewFileModel ref="viewFileModelRef"/>
<reasonForReturn ref="reasonForReturnRef" @reasonForReturnForm="reasonForReturnForm"/>
<addConfiguration ref="addConfigurationRef" @addConfigurationForm="transferListForm"/>
<deadlineForm ref="deadlineFormRef" @deadlineDataForm="deadlineDataForm"/>
<JLoading :loading="JTextLoading">{{ $t('Submitting') }}</JLoading>
<!-- <a-modal-->
<!-- :title="listTitle"-->
@@ -510,6 +511,7 @@
import SelectedBy from '@/components/SelectedBy/index'
import reasonForReturn from './components/reasonForReturn'
import addConfiguration from './components/addConfiguration'
import deadlineForm from './components/deadlineForm'
import referenceDeliverablesList from './components/referenceDeliverablesList'
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
@@ -534,7 +536,8 @@
SelectedBy,
viewFileModel,
reasonForReturn,
addConfiguration
addConfiguration,
deadlineForm
},
data() {
return {
@@ -549,9 +552,9 @@
'In progress': 'TrackedColor',
'NA': 'notInvolvedColor',
'Not start': 'submittedColor',
'25181c5a4c044001b4beca539c77a5c8':'accordColor',
'0a384b5475554ae8886b950730a3bff7':'accordColor',
'7cba3c71fd24421eade54c685e3b4444':'TrackedColor',
'25181c5a4c044001b4beca539c77a5c8': 'accordColor',
'0a384b5475554ae8886b950730a3bff7': 'accordColor',
'7cba3c71fd24421eade54c685e3b4444': 'TrackedColor'
},
fieldList: [
{
@@ -986,9 +989,9 @@
}
}
}
if (!isTrue){
this.$refs.batSettingRef.edit(JSON.parse(JSON.stringify(this.selectedRowKeys)), name,this.selectedRowKeysList[0])
}else{
if (!isTrue) {
this.$refs.batSettingRef.edit(JSON.parse(JSON.stringify(this.selectedRowKeys)), name, this.selectedRowKeysList[0])
} else {
this.$refs.batSettingRef.edit(JSON.parse(JSON.stringify(this.selectedRowKeys)), name)
}
@@ -1151,7 +1154,15 @@
data = this.$t('inspectionItems') + '"' + notConditions.join('、') + '"' + this.$t('conditionsNotMet') + ',' + this.$t('onlyDataListReleasedAndCertificationReturnCanSelected')
}
if (ids && ids.length > 0) {
this.releaseData(ids, notConditions, data)
// this.releaseData(ids, notConditions, data)
let query = {
ids: ids,
notConditions: notConditions,
data: data,
dutyDueDate: 'inventoryVerifyEndTime',
title: this.$t('release')
}
this.$refs.deadlineFormRef.getData(JSON.parse(JSON.stringify(query)))
} else {
this.failedMessage(data)
}
@@ -1159,29 +1170,72 @@
this.$message.warning(this.$t('selectLeastOne'))
}
},
releaseData(ids, notConditions, data) {
deadlineDataForm(val, formInline) {
if (val.title == this.$t('release')) {
this.releaseData(val.ids, val.notConditions, val.data, formInline)
} else if (val.title == this.$t('initiateTask')) {
this.initiateTaskClick(val, formInline)
}
},
releaseData(ids, notConditions, data, formInline) {
let _this = this
this.$confirm({
content: _this.$t('confirmRelease'),
onOk() {
postAction('/project/projectCertificationInventoryEO/issue', {
ids: ids.join(','),
projectLibraryId: _this.$route.query.id
}).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.selectedRowKeysList = []
_this.getList()
if (notConditions && notConditions.length > 0) {
_this.failedMessage(data)
}
} else {
_this.$message.warning(res.message)
}
})
// this.$confirm({
// content: _this.$t('confirmRelease'),
// onOk() {
postAction('/project/projectCertificationInventoryEO/issue', {
ids: ids.join(','),
projectLibraryId: _this.$route.query.id,
inventoryVerifyEndTime: formInline.inventoryVerifyEndTime
}).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.selectedRowKeysList = []
_this.getList()
if (notConditions && notConditions.length > 0) {
_this.failedMessage(data)
}
_this.$refs.deadlineFormRef.visible = false
_this.$refs.deadlineFormRef.confirmLoading = false
} else {
_this.$message.warning(res.message)
_this.$refs.deadlineFormRef.confirmLoading = false
}
})
// }
// })
},
initiateTaskClick(val, formInline) {
let _this = this
if (val.NAId && val.NAId.length > 0) {
_this.NASubmitTask(val.NAId, val.ids, val.notConditions, val.data)
}
if (val.ids && val.ids.length > 0) {
let query = {
'nodeKey': val.value,
'projectLibraryId': _this.$route.query.id,
'ids': val.ids.join(','),
taskConfirmEndTime: formInline.taskConfirmEndTime
}
postAction('/project/projectCertificationInventoryEO/submitTask', query).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
_this.selectedRowKeys = []
_this.selectedRowKeysList = []
_this.$refs.deadlineFormRef.visible = false
_this.$refs.deadlineFormRef.confirmLoading = false
if (val.notConditions && val.notConditions.length > 0) {
_this.failedMessage(val.data)
}
} else {
_this.$message.warning(res.message)
_this.$refs.deadlineFormRef.confirmLoading = false
}
})
}
},
// handleOk() {
// this.$refs.ruleForm.validate(valid => {
@@ -1694,7 +1748,18 @@
data = this.$t('inspectionItems') + '"' + notConditions.join('、') + '"' + this.$t('conditionsNotMet') + ',' + this.$t('onlyProcessReturned')
}
if ((ids && ids.length > 0) || (NAId && NAId.length > 0)) {
this.submitTask(value, prompt, ids, notConditions, data, NAId)
let query = {
value: value,
prompt: prompt,
ids: ids,
notConditions: notConditions,
data: data,
dutyDueDate: 'taskConfirmEndTime',
title: this.$t('initiateTask'),
NAId: NAId
}
this.$refs.deadlineFormRef.getData(JSON.parse(JSON.stringify(query)))
// this.submitTask(value, prompt, ids, notConditions, data, NAId)
} else {
this.failedMessage(data)
}
@@ -1874,9 +1939,9 @@
}
let data = ''
if (notConditions && notConditions.length > 0) {
if (value == 'rzgcssc_th'){
if (value == 'rzgcssc_th') {
data = this.$t('inspectionItems') + '"' + notConditions.join('、') + '"' + this.$t('conditionsNotMet') + ',' + this.$t('onlyDataWithApprovedCanCeSelected')
}else{
} else {
data = this.$t('inspectionItems') + '"' + notConditions.join('、') + '"' + this.$t('conditionsNotMet') + ',' + this.$t('onlyDataStatusResultReviewedCanBeSelected')
}
}
@@ -1906,6 +1971,7 @@
this.$message.warning(this.$t('selectLeastOne'))
}
},
reasonForReturnForm(value, text, ids, notConditions, data, reasonForReturn) {
let _this = this
let query = {
@@ -1955,9 +2021,9 @@
this.$confirm({
content: prompt,
onOk() {
if (NAId && NAId.length > 0) {
_this.NASubmitTask(NAId, ids, notConditions, data)
}
// if (NAId && NAId.length > 0) {
// _this.NASubmitTask(NAId, ids, notConditions, data)
// }
if (ids && ids.length > 0) {
let query = {
'nodeKey': value,
@@ -1998,11 +2064,14 @@
if (notConditions && notConditions.length > 0) {
_this.failedMessage(data)
}
_this.$refs.deadlineFormRef.visible = false
_this.$refs.deadlineFormRef.confirmLoading = false
}
} else {
if (ids && ids.length > 0) {
} else {
_this.$message.warning(_this.$t('operationFailed'))
_this.$refs.deadlineFormRef.confirmLoading = false
}
}
})