在转办旁回显所选人员

认证清单--认证目录-添加,字符长度限制提示
This commit is contained in:
范强强
2023-03-28 15:09:31 +08:00
parent 7b0b44d95e
commit e2e1f35c8f
3 changed files with 93 additions and 40 deletions
+11 -4
View File
@@ -67,7 +67,8 @@
departId: '', departId: '',
defaultExpandedKeys: [], defaultExpandedKeys: [],
submitLoading: false, submitLoading: false,
visibleTree: false visibleTree: false,
userName: []
} }
}, },
mounted() { mounted() {
@@ -110,7 +111,7 @@
} }
if (this.userIds && this.userIds.length > 0) { if (this.userIds && this.userIds.length > 0) {
this.submitLoading = true this.submitLoading = true
this.$emit('SelectedByForm', this.userIds.join(',')) this.$emit('SelectedByForm', this.userIds.join(','),this.userName.join(','))
} else { } else {
this.$message.warning(this.$t('selectLeastOne')) this.$message.warning(this.$t('selectLeastOne'))
} }
@@ -142,7 +143,7 @@
postAction('sys/user/queryDepartUserTreeList', { postAction('sys/user/queryDepartUserTreeList', {
departId: this.departId, departId: this.departId,
json: gData, json: gData,
flag:'1' flag: '1'
}).then((res) => { }).then((res) => {
this.confirmLoading = false this.confirmLoading = false
if (res.success) { if (res.success) {
@@ -155,8 +156,14 @@
} }
}) })
}, },
checkChange(e) { checkChange(e, name) {
this.userName = []
this.userIds = e this.userIds = e
if (name.checkedNodes && name.checkedNodes.length > 0) {
name.checkedNodes.forEach(res => {
this.userName.push(res.data.props.dataRef.title)
})
}
} }
} }
} }
@@ -10,14 +10,14 @@
:visible="visible" :visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;"> style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form-model :model="formInline" class="formAdd" ref="ruleForm"> <a-form-model :model="formInline" :rules="rules" class="formAdd" ref="ruleForm">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="title-text-text" :title="$t('directoryName')">{{$t('directoryName')}}</span> <span class="title-text-text" :title="$t('directoryName')">{{$t('directoryName')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="directoryName">
<a-input class="box-input" <a-input class="box-input"
:disabled="disabled" :disabled="disabled"
v-model.trim="formInline.directoryName" v-model.trim="formInline.directoryName"
@@ -30,7 +30,7 @@
<div class="title-text"> <div class="title-text">
<span class="title-text-text" :title="$t('batch')">{{$t('batch')}}</span> <span class="title-text-text" :title="$t('batch')">{{$t('batch')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="lot">
<a-input class="box-input" <a-input class="box-input"
:disabled="disabled" :disabled="disabled"
v-model.trim="formInline.lot" v-model.trim="formInline.lot"
@@ -77,7 +77,7 @@
<div class="title-text"> <div class="title-text">
<span class="title-text-text" :title="$t('testReportLocation')">{{$t('testReportLocation')}}</span> <span class="title-text-text" :title="$t('testReportLocation')">{{$t('testReportLocation')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="detectionReportLocation">
<a-input class="box-input" <a-input class="box-input"
:disabled="disabled" :disabled="disabled"
v-model.trim="formInline.detectionReportLocation" v-model.trim="formInline.detectionReportLocation"
@@ -93,7 +93,7 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('explain')">{{$t('explain')}}</span> :title="$t('explain')">{{$t('explain')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="explainInfo">
<a-textarea <a-textarea
style="width: 100%" style="width: 100%"
:placeholder="$t('PleaseEnter')+$t('explain')" :placeholder="$t('PleaseEnter')+$t('explain')"
@@ -127,6 +127,36 @@
return { return {
visible: false, visible: false,
formInline: {}, formInline: {},
rules:{
directoryName: [
{
max: 100,
message: this.$t('directoryName') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
}
],
lot: [
{
max: 100,
message: this.$t('batch') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
}
],
detectionReportLocation:[
{
max: 100,
message: this.$t('testReportLocation') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
}
],
explainInfo:[
{
max: 300,
message: this.$t('explain') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
],
},
confirmLoading: false, confirmLoading: false,
disabled: false, disabled: false,
url: { url: {
@@ -142,47 +172,55 @@
add() { add() {
this.visible = true this.visible = true
this.formInline = {} this.formInline = {}
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
}, },
edit(val) { edit(val) {
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.formInline = val this.formInline = val
this.$refs.ruleForm.clearValidate()
}) })
}, },
handleCancel() { handleCancel() {
this.visible = false this.visible = false
}, },
handleSubmit() { handleSubmit() {
if (!this.formInline.directoryName && !this.formInline.lot && !this.formInline.directoryFile && this.$refs.ruleForm.validate(valid => {
!this.formInline.experimentFile && !this.formInline.detectionReportLocation && !this.formInline.explainInfo) { if (valid){
this.$message.warning(this.$t('dataCannotEmpty')) if (!this.formInline.directoryName && !this.formInline.lot && !this.formInline.directoryFile &&
} else { !this.formInline.experimentFile && !this.formInline.detectionReportLocation && !this.formInline.explainInfo) {
let Action this.$message.warning(this.$t('dataCannotEmpty'))
let url = '' } else {
if (this.formInline.id) { let Action
url = this.url.edit let url = ''
Action = putAction if (this.formInline.id) {
} else { url = this.url.edit
url = this.url.add Action = putAction
Action = postAction } else {
} url = this.url.add
let query = { Action = postAction
projectLibraryId: this.$route.query.id, }
...this.formInline let query = {
} projectLibraryId: this.$route.query.id,
this.confirmLoading = true ...this.formInline
Action(url, query).then((res) => { }
if (res.success) { this.confirmLoading = true
this.$message.success(this.$t('OperationSuccessful')) Action(url, query).then((res) => {
this.visible = false if (res.success) {
this.confirmLoading = false this.$message.success(this.$t('OperationSuccessful'))
this.$emit('certificationDirectoryList') this.visible = false
} else { this.confirmLoading = false
this.confirmLoading = false this.$emit('certificationDirectoryList')
this.$message.warning(res.message) } else {
} this.confirmLoading = false
}) this.$message.warning(res.message)
} }
})
}
}
})
}, },
clickButtonToUpload(item) { clickButtonToUpload(item) {
this.$refs.uploadFile.perentHandleFunc() this.$refs.uploadFile.perentHandleFunc()
@@ -49,6 +49,9 @@
<a-radio value="Transfer" v-if="query.TaskKey == 'zrrtjjfw' || query.TaskKey == 'zrrqr'"> <a-radio value="Transfer" v-if="query.TaskKey == 'zrrtjjfw' || query.TaskKey == 'zrrqr'">
{{$t('turnToDo')}} {{$t('turnToDo')}}
</a-radio> </a-radio>
<span>
{{this.formInline.dezrrSubmitUserName}}
</span>
</a-radio-group> </a-radio-group>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@@ -184,16 +187,21 @@
} else { } else {
this.$refs.SelectedByRef.visible = false this.$refs.SelectedByRef.visible = false
this.formInline.secondChargePersonUserId = '' this.formInline.secondChargePersonUserId = ''
this.formInline.dezrrSubmitUserName = ''
this.formInline.dezrrSubmitUserId = ''
} }
}, },
//转办接口 //转办接口
SelectedByForm(userIds) { SelectedByForm(userIds, name) {
if (this.query.TaskKey == 'zrrtjjfw') { if (this.query.TaskKey == 'zrrtjjfw') {
this.formInline.dezrrSubmitUserId = userIds this.formInline.dezrrSubmitUserId = userIds
} else { } else {
this.formInline.secondChargePersonUserId = userIds this.formInline.secondChargePersonUserId = userIds
} }
this.formInline.dezrrSubmitUserName = name
this.formInline = { ...this.formInline }
this.$refs.SelectedByRef.visible = false this.$refs.SelectedByRef.visible = false
this.$refs.SelectedByRef.submitLoading = false
}, },
submitNoRule(callBack) { submitNoRule(callBack) {
callBack(this.formInline) callBack(this.formInline)