对接握手流程
This commit is contained in:
@@ -46,11 +46,11 @@
|
||||
</div>
|
||||
<div class="table-operator">
|
||||
<div style="float: left;margin-bottom: 19px;margin-left: 20px" v-if="isDisplay">
|
||||
<div class="operator-text" @click="initiateListConfirmationcClick">
|
||||
<div class="operator-text" @click="initiateListConfirmationcClick('清单')">
|
||||
<a-icon type="solution"/>
|
||||
{{ $t('initiateListConfirmation') }}
|
||||
</div>
|
||||
<div class="operator-text">
|
||||
<div class="operator-text" @click="initiateTaskConfirmationClick('任务')">
|
||||
<a-icon type="file-protect"/>
|
||||
{{ $t('initiateTaskConfirmation') }}
|
||||
</div>
|
||||
@@ -202,7 +202,7 @@
|
||||
<span class="title-text-text"
|
||||
:title="$t('TaskCutOffTime')">{{ $t('TaskCutOffTime') }}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="inventoryAffirmDueDate">
|
||||
<a-form-model-item v-if="this.timeName == '清单'" class="itemModel" prop="inventoryAffirmDueDate">
|
||||
<a-date-picker class="box-input"
|
||||
:placeholder="$t('PleaseSelect')+$t('TaskCutOffTime')"
|
||||
@change="dateChange({db_field_name:'inventoryAffirmDueDate'})"
|
||||
@@ -210,6 +210,14 @@
|
||||
v-model="formInline.inventoryAffirmDueDate"
|
||||
style="width: 100%"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item v-else-if="this.timeName == '任务'" class="itemModel" prop="taskAffirmDueDate">
|
||||
<a-date-picker class="box-input"
|
||||
:placeholder="$t('PleaseSelect')+$t('TaskCutOffTime')"
|
||||
@change="dateChange({db_field_name:'taskAffirmDueDate'})"
|
||||
format="YYYY-MM-DD"
|
||||
v-model="formInline.taskAffirmDueDate"
|
||||
style="width: 100%"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -485,6 +493,7 @@
|
||||
}
|
||||
],
|
||||
visibleFile: false,
|
||||
timeName: '',
|
||||
dataSourceFile: [],
|
||||
confirmLoading: false,
|
||||
queryParamQuery: {},
|
||||
@@ -499,6 +508,13 @@
|
||||
message: this.$t('TaskCutOffTime') + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
taskAffirmDueDate: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('TaskCutOffTime') + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
},
|
||||
queryParam: {},
|
||||
@@ -711,22 +727,57 @@
|
||||
getPersonnelList() {
|
||||
this.getList()
|
||||
},
|
||||
initiateListConfirmationcClick() {
|
||||
initiateListConfirmationcClick(name) {
|
||||
this.timeName = name
|
||||
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||||
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
|
||||
this.dataSource.forEach(res => {
|
||||
selectedRowKeys.forEach(val => {
|
||||
if (res.id == val) {
|
||||
if ((res.inventoryAffirmStatus == 'Not started' || res.inventoryAffirmStatus == 'rejected') &&
|
||||
res.homologationEngineerId && res.regulationOwnerId) {
|
||||
this.visible = true
|
||||
this.formInline = {}
|
||||
let isTrue = true
|
||||
for (let i = 0; i < this.dataSource.length; i++) {
|
||||
for (let j = 0; j < selectedRowKeys.length; j++) {
|
||||
if (this.dataSource[i].id == selectedRowKeys[j]) {
|
||||
if ((this.dataSource.inventoryAffirmStatus == 'Not started' || this.dataSource.inventoryAffirmStatus == 'rejected') &&
|
||||
this.dataSource.homologationEngineerId && this.dataSource.regulationOwnerId) {
|
||||
isTrue = true
|
||||
} else {
|
||||
this.$message.warning(this.$t('dataConfirmation'))
|
||||
isTrue = false
|
||||
return
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
if (isTrue) {
|
||||
this.visible = true
|
||||
this.formInline = {}
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
}
|
||||
},
|
||||
initiateTaskConfirmationClick(name) {
|
||||
this.timeName = name
|
||||
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||||
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
|
||||
let isTrue = true
|
||||
for (let i = 0; i < this.dataSource.length; i++) {
|
||||
for (let j = 0; j < selectedRowKeys.length; j++) {
|
||||
if (this.dataSource[i].id == selectedRowKeys[j]) {
|
||||
if ((this.dataSource[i].taskAffirmStatus == 'Not started' || this.dataSource[i].taskAffirmStatus == 'rejected') &&
|
||||
this.dataSource[i].homologationEngineerId && this.dataSource[i].regulationOwnerId
|
||||
&& this.dataSource[i].inventoryAffirmStatus == 'accepted') {
|
||||
isTrue = true
|
||||
} else {
|
||||
isTrue = false
|
||||
this.$message.warning(this.$t('taskDataConfirmation'))
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isTrue) {
|
||||
this.visible = true
|
||||
this.formInline = {}
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
}
|
||||
@@ -735,25 +786,68 @@
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
|
||||
let query = {
|
||||
operatorType: 0,
|
||||
ids: selectedRowKeys.join(','),
|
||||
projectLibraryId: this.$route.query.id,
|
||||
...this.formInline
|
||||
}
|
||||
this.confirmLoading = true
|
||||
getAction(this.url.updateStatusBatch, query).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.visible = false
|
||||
this.selectedRowKeys = []
|
||||
this.confirmLoading = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
this.confirmLoading = false
|
||||
if (this.timeName == '清单') {
|
||||
let query = {
|
||||
operatorType: 0,
|
||||
ids: selectedRowKeys.join(','),
|
||||
projectLibraryId: this.$route.query.id,
|
||||
...this.formInline
|
||||
}
|
||||
})
|
||||
this.confirmLoading = true
|
||||
getAction(this.url.updateStatusBatch, query).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.visible = false
|
||||
this.selectedRowKeys = []
|
||||
this.confirmLoading = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
this.confirmLoading = false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
for (let i = 0; i < this.dataSource.length; i++) {
|
||||
for (let j = 0; j < selectedRowKeys.length; j++) {
|
||||
if (this.dataSource[i].id == selectedRowKeys[j]) {
|
||||
this.dataSource[i].taskAffirmDueDate = this.formInline.taskAffirmDueDate
|
||||
Object.keys(this.dataSource[i]).forEach(res => {
|
||||
if (this.dataSource[i][res] && this.dataSource[i][res] instanceof String) {
|
||||
this.dataSource[i][res] = this.dataSource[i][res].replace(/\"/g, '“')
|
||||
this.dataSource[i][res] = this.dataSource[i][res].replace(/\'/g, '‘')
|
||||
}
|
||||
})
|
||||
let data = JSON.stringify(this.dataSource[i]).replace(/\"/g, '\'')
|
||||
setTimeout(() => {
|
||||
this.startProcess(data)
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
startProcess(value) {
|
||||
let query = {
|
||||
type: 1,
|
||||
msg: JSON.stringify(value)
|
||||
}
|
||||
postAction('/workFlow/startProcess', query).then((res) => {
|
||||
if (res.success) {
|
||||
this.completeTask(value, res.result)
|
||||
}
|
||||
})
|
||||
},
|
||||
completeTask(value, taskId) {
|
||||
let query = {
|
||||
userid: this.userInfo().id,
|
||||
taskId: taskId,
|
||||
json: value
|
||||
}
|
||||
postAction('/workFlow/completeTask', query).then((res) => {
|
||||
if (res.success) {
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -766,20 +860,20 @@
|
||||
if (this.dataSource[i].roleCode == 1 && this.dataSource[i].regulationOwnerSubmitStatus) {
|
||||
isTrue = false
|
||||
this.$message.warning(this.$t('The') + (i + 1) + this.$t('submitted'))
|
||||
break
|
||||
return
|
||||
} else if (this.dataSource[i].roleCode == 2 && this.dataSource[i].homologationEngineerSubmitStatus) {
|
||||
isTrue = false
|
||||
this.$message.warning(this.$t('The') + (i + 1) + this.$t('submitted'))
|
||||
break
|
||||
return
|
||||
} else if (this.dataSource[i].roleCode == 4 && (this.dataSource[i].homologationEngineerSubmitStatus && this.dataSource[i].regulationOwnerSubmitStatus)) {
|
||||
isTrue = false
|
||||
this.$message.warning(this.$t('The') + (i + 1) + this.$t('submitted'))
|
||||
break
|
||||
return
|
||||
}
|
||||
} else {
|
||||
isTrue = false
|
||||
this.$message.warning(this.$t('The') + (i + 1) + this.$t('incorrectsubmitted'))
|
||||
break
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user