Files
laws_weilai/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/batchModel.vue
T
2023-09-12 17:03:16 +08:00

182 lines
4.8 KiB
Java

<!--批量维护进度-->
<template>
<a-modal
:title="title"
:width="700"
:visible="visible"
:confirm-loading="confirmLoading"
:maskClosable="false"
@ok="handleOk"
@cancel="visible = false"
>
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('CertificationProgress')">{{$t('CertificationProgress')}}</span>
</div>
<a-form-model-item class="itemModel" :prop="!disabled?'certificationProgress':''">
<j-dict-select-tag class="box-input" v-model="formInline.certificationProgress"
:disabled="disabled"
@input="handleInput('certificationProgress')"
:placeholder="$t('PleaseSelect')+$t('CertificationProgress')"
:type="'select'"
:triggerChange="false" :dictCode="'certification_progress'"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('remarks')">{{$t('remarks')}}</span>
</div>
<a-form-model-item class="itemModel remarkbox" :prop="!disabled?'certificationProgressRemark':''">
<a-textarea
:placeholder="$t('PleaseEnter')+$t('remarks')"
:disabled="disabled"
v-model="formInline.certificationProgressRemark" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-modal>
</template>
<script>
import { postAction, putAction, getAction } from '@/api/manage'
export default {
name: 'TaskListModel',
data() {
return {
formInline: {},
selectionRowsArray:[],
rules: {},
title:'',
visible: false,
confirmLoading: false,
studioList: [],
ids:'',
disabled: false,
url: {
edit: '/project/projectTaskInventoryEO/edit',
addOrUpdate: '/project/projectTaskInventoryConditionAssessmentEO/addOrUpdate',
list: '/project/projectTaskInventoryConditionAssessmentEO/list'
}
}
},
mounted() {
},
methods: {
getData(val) {
this.visible = true
this.title = this.$t('BatchMaintenanceProgress')
this.selectionRowsArray = val
this.$nextTick(() => {
this.formInline = {}
this.$refs.ruleForm.clearValidate()
})
},
getList(val) {
getAction(this.url.list, { projectLawsInventoryId: val.projectLawsInventoryId }).then((res) => {
if (res.success) {
this.studioList = res.result || []
} else {
this.studioList = []
}
})
},
handleInput(value) {
this.$nextTick(() => {
this.formInline = { ...this.formInline }
this.$refs.ruleForm.validateField([value])
})
},
handleOk() {
if (this.disabled) {
this.visible = false
return
}
this.$refs.ruleForm.validate(valid => {
if (valid) {
let query = {}
this.ids = this.selectionRowsArray.join(',')
query = {
ids: this.ids,
certificationProgress: this.formInline.certificationProgress,
certificationProgressRemark: this.formInline.certificationProgressRemark
}
this.confirmLoading = true
postAction('/project/projectTaskInventoryEO/editBatch', query).then((res) => {
if (res.success) {
this.visible = false
this.confirmLoading = false
this.$message.success(this.$t('OperationSuccessful'))
this.$emit('batchModel')
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
}
})
}
})
}
}
}
</script>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text {
width: 134px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 42px;
}
.box-input {
display: inline-block;
height: 38px;
width: 128%;
}
.itemModel {
width: calc(80% - 130px);
display: inline-block;
margin-top: 2px;
}
.title-text-text {
margin-top: 9px;
}
/deep/ .remarkbox .ant-form-item-control{
width: 128%;
}
.headerText {
margin-left: 30px;
color: #040B29;
font-weight: 400;
}
</style>