未符合项 查看弹框修改

This commit is contained in:
zyx.net
2023-09-05 16:40:29 +08:00
parent e0eeb6efe5
commit 6feb61c256
3 changed files with 53 additions and 416 deletions
@@ -425,7 +425,11 @@
this.$refs.addModelRef.edit(JSON.parse(JSON.stringify(record)))
},
detil(record){
this.designFlowStatusClick(record)
if(record.flag == 'NEW'){
this.$refs.detilModelRef.check(JSON.parse(JSON.stringify(record)))
}else{
this.designFlowStatusClick(record)
}
},
deleteLib(record){
let _this = this
@@ -509,18 +509,20 @@ export default {
this.getNameList()
this.getFirstLevelDutyTerritory()
this.title = this.$t('edit')
if(row.dutyTerritory != null){
this.formInline.dutyTerritory = row.dutyTerritory.split(',')
}else{
this.formInline.dutyTerritory = undefined
console.log(this.formInline.dutyTerritory)
}
if(row.projectId != null){
this.formInline.projectId = row.projectId.split(',')
}else{
this.formInline.dutyTerritory = undefined
}
this.formInline = row
if(this.formInline.dutyTerritory != null){
this.formInline.dutyTerritory = this.formInline.dutyTerritory.split(',')
}else{
this.formInline.dutyTerritory = undefined
}
if(this.formInline.problemState == null){
this.formInline.problemState = undefined
}
if(this.formInline.projectId != null){
this.formInline.projectId = this.formInline.projectId.split(',')
}else{
this.formInline.projectId = undefined
}
console.log(this.formInline)
this.visible = true
this.disabled = false
@@ -10,21 +10,14 @@
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<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">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text"
:title="$t('title')">{{$t('title')}}</span>
</div>
<a-form-model-item class="itemModel" prop="title">
<a-input class="box-input"
v-model='formInline.title'
:disabled="disabled"
:placeholder="$t('PleaseEnter')+$t('title')"/>
</a-form-model-item>
<span>{{formInline.title}}</span>
</div>
</a-col>
</a-row>
@@ -32,31 +25,26 @@
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<!-- <span class="Required">*</span>-->
<span class="title-text-text"
:title="$t('problemType')">{{$t('problemType')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="problemType">
<j-dict-select-tag class="box-input" v-model="formInline.problemType"
:placeholder="$t('PleaseSelect')+$t('problemType')"
:type="'select'"
:triggerChange="false" :dictCode="'wen4_ti2_lei4_xing2'"/>
</a-form-model-item>
<span>{{formInline.problemType}}</span>
<!-- <a-form-model-item class="itemModel-multi" prop="problemType">-->
<!-- <j-dict-select-tag class="box-input" v-model="formInline.problemType"-->
<!-- :placeholder="$t('PleaseSelect')+$t('problemType')"-->
<!-- :type="'select'"-->
<!-- :triggerChange="false" :dictCode="'wen4_ti2_lei4_xing2'"/>-->
<!-- </a-form-model-item>-->
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<!-- <span class="Required">*</span>-->
<span class="title-text-text"
:title="'PS-issue'">{{'PS-issue'}}</span>
</div>
<a-form-model-item class="itemModel" prop="issue">
<a-input class="box-input"
v-model='formInline.issue'
:disabled="disabled"
:placeholder="$t('PleaseEnter')+'PS-issue'"/>
</a-form-model-item>
<span>{{formInline.psIssue}}</span>
</div>
</a-col>
</a-row>
@@ -68,12 +56,7 @@
<span class="title-text-text"
:title="$t('creator')">{{$t('creator')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="creator">
<a-input class="box-input"
v-model='formInline.creator'
:disabled="true"
:placeholder="$t('PleaseEnter')+$t('creator')"/>
</a-form-model-item>
<span>{{formInline.creator}}</span>
</div>
</a-col>
<a-col :span="12">
@@ -83,12 +66,7 @@
<span class="title-text-text"
:title="$t('createTime')">{{$t('createTime')}}</span>
</div>
<a-form-model-item class="itemModel" prop="createTime">
<a-input class="box-input"
v-model='formInline.createTime'
:disabled="true"
:placeholder="$t('PleaseEnter')+$t('createTime')"/>
</a-form-model-item>
<span>{{formInline.createTime}}</span>
</div>
</a-col>
</a-row>
@@ -100,14 +78,7 @@
<span class="title-text-text"
:title="$t('Relevantlawsregulations')">{{$t('Relevantlawsregulations')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="creator">
<Standardselection
:query="{'db_field_txt':$t('standard')}"
:standard="formInline"
:disabled="false"
@change="StandardselectionChange"
v-model="formInline.serialNumber"/>
</a-form-model-item>
<span>{{formInline.lawsName}}</span>
</div>
</a-col>
<a-col :span="12">
@@ -117,26 +88,7 @@
<span class="title-text-text"
:title="$t('RelatedItems')">{{$t('RelatedItems')}}</span>
</div>
<a-form-model-item class="itemModel" prop="contentTemplate">
<a-select allowClear
class="box-input"
v-model="formInline.projectName"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
showSearch
mode="multiple"
optionFilterProp="label"
:autoClearSearchValue="false"
:placeholder="$t('PleaseSelect')+$t('RelatedItems')">
<a-select-option v-for="(item, key) in projectNameList"
:key="key"
:label="item.projectName"
:value="item.projectName">
<span style="display: inline-block;width: 100%" :title=" item.projectName ">
{{ item.projectName}}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
<span>{{formInline.projectId}}</span>
</div>
</a-col>
</a-row>
@@ -148,25 +100,7 @@
<span class="title-text-text"
:title="$t('statisticalNodes')">{{$t('statisticalNodes')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="creator">
<a-select :placeholder="$t('PleaseSelect')+$t('statisticalNodes')"
allowClear
show-search
mode="multiple"
class="box-input-search"
optionFilterProp="label"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.firstLevelDutyTerritory">
<a-select-option v-for="(item, key) in firstLevelDutyTerritoryList"
:key="key"
:label="item.key"
:value="item.key">
<span style="display: inline-block;width: 100%" :title=" item.key ">
{{ item.key }}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
<span>{{formInline.dutyTerritory}}</span>
</div>
</a-col>
<a-col :span="12">
@@ -176,25 +110,7 @@
<span class="title-text-text"
:title="$t('Problemstate')">{{$t('Problemstate')}}</span>
</div>
<a-form-model-item class="itemModel" prop="contentTemplate">
<a-select allowClear
class="box-input"
v-model="formInline.flowType"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
showSearch
optionFilterProp="label"
:autoClearSearchValue="false"
:placeholder="$t('PleaseSelect')+$t('Problemstate')">
<a-select-option v-for="(item, key) in ProblemstateList"
:label='item'
:key="key"
:value="item">
<span style="display: inline-block;width: 100%" :title=" item">
{{ item }}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
<span>{{formInline.problemState}}</span>
</div>
</a-col>
</a-row>
@@ -206,12 +122,7 @@
<span class="title-text-text"
:title="$t('descriptions')">{{$t('descriptions')}}</span>
</div>
<a-form-model-item class="itemModel" prop="descriptions">
<a-input class="box-input"
v-model='formInline.descriptions'
:disabled="disabled"
:placeholder="$t('PleaseEnter')+$t('descriptions')"/>
</a-form-model-item>
<span>{{formInline.descriptions}}</span>
</div>
</a-col>
</a-row>
@@ -223,27 +134,16 @@
<span class="title-text-text"
:title="$t('documents')">{{$t('documents')}}</span>
</div>
<a-form-model-item class="itemModel" prop="xgwj">
<div v-for="(item,index) in formInline.list" :key="index">
<a-input class="box-input"
style='width: 94%'
v-model='item.xgwj'
:disabled="disabled"
:placeholder="$t('PleaseEnter')+$t('Addresslink')"/>
<a-icon class="icon-text" @click="addClick(index)" style='margin-left: 10px;font-size: 18px;'
v-if="formInline.list.length - 1 == index"
type="plus"/>
<a-icon class="icon-text" v-if="formInline.list.length > 1 && formInline.list.length - 1 !== index" style='margin-left: 10px;font-size: 18px;'
@click="deleteClick(index)"
type="minus"/>
<div v-for="(item,index) in formInline.fileLinkList" :key="index">
<span>{{item.fileLink}}</span>
</div>
<span>{{formInline.fileLink}}</span>
<a-button type="primary" class="button-text"
@click="clickButtonToUpload('accessory_id')">
{{ (formInline.accessory_id === 'null' || formInline.accessory_id === '' ||
formInline.accessory_id == null) ? $t('Fileupload') : $t('viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
</a-row>
@@ -255,18 +155,9 @@
<span class="title-text-text"
:title="$t('progresstracking')">{{$t('progresstracking')}}</span>
</div>
<a-form-model-item class="itemModel" prop="progresstracking">
<div v-for="(item,index) in formInline.progresstrackinglist" :key="index">
<!-- <span>{{item}}</span>-->
<a-input class="box-input"
style='width: 94%'
v-model='item.text'
:disabled="true"
:placeholder="$t('PleaseEnter')+$t('progresstracking')"/>
<a @click="addprogresstrackingClick(index)" style='margin-left: 10px' v-if="formInline.progresstrackinglist.length - 1 == index">{{$t('newlyAdded')}}</a>
<a @click="deleteprogresstrackingClick(index)" v-if="formInline.progresstrackinglist.length > 1 && formInline.progresstrackinglist.length - 1 !== index" :disabled="disabled" style='margin-left: 10px' >{{$t('delete')}}</a>
<div v-for="(item,index) in formInline.progressTrackingList" :key="index">
<span>{{item.progressTracking}}</span>
</div>
</a-form-model-item>
</div>
</a-col>
</a-row>
@@ -278,12 +169,7 @@
<span class="title-text-text"
:title="$t('conculsion')">{{$t('conculsion')}}</span>
</div>
<a-form-model-item class="itemModel" prop="conculsion">
<a-input class="box-input"
v-model='formInline.conculsion'
:disabled="disabled"
:placeholder="$t('PleaseEnter')+$t('conculsion')"/>
</a-form-model-item>
<span>{{formInline.conclusion}}</span>
</div>
</a-col>
</a-row>
@@ -295,19 +181,8 @@
<span class="title-text-text"
:title="$t('examineapproveevidence')">{{$t('examineapproveevidence')}}</span>
</div>
<a-form-model-item class="itemModel" prop="xgwj">
<div v-for="(item,index) in formInline.examineapproveevidencelist" :key="index">
<a-input class="box-input"
style='width: 94%'
v-model='item.xgwj'
:disabled="disabled"
:placeholder="$t('PleaseEnter')+$t('Addresslink')"/>
<a-icon class="icon-text" @click="addvidenceClick(index)" style='margin-left: 10px;font-size: 18px;'
v-if="formInline.examineapproveevidencelist.length - 1 == index"
type="plus"/>
<a-icon class="icon-text" v-if="formInline.examineapproveevidencelist.length > 1 && formInline.examineapproveevidencelist.length - 1 !== index"
style='margin-left: 10px;font-size: 18px;' @click="deletevidenceClick(index)"
type="minus" :disabled="disabled"/>
<div v-for="(item,index) in formInline.approvalEvidenceLinkList" :key="index">
<span>{{item.approvalEvidenceLink}}</span>
</div>
<a-button type="primary" class="button-text"
@click="clickButtonToUpload('accessory_id')">
@@ -315,60 +190,21 @@
formInline.examineapproveevidence == null) ? $t('Fileupload') : $t('viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-spin>
<div class="drawer-bootom-button">
<a-button style="margin-right: 8px" @click="handleCancel">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" v-if="!disabled" type="primary" :loading="confirmLoading">{{$t('submit')}}
</a-button>
<!-- <a-button @click="handleSubmit" v-if="!disabled" type="primary" :loading="confirmLoading">{{$t('submit')}}-->
<!-- </a-button>-->
</div>
</a-drawer>
<!-- <addModel ref="addModelRef" @addModelForm="addModelForm"/>-->
<a-modal
:title="$t('progresstracking')"
:width="600"
:visible="visibletrack"
:confirm-loading="confirmLoading"
:maskClosable="false"
@ok="handleOk"
@cancel="Cancel"
>
<a-form-model :model="formInlinetracking" class="formAdd" :rules="rulestracking" ref="ruleFormtracking">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('progresstracking')">
{{$t('progresstracking')}}</span>
</div>
<a-form-model-item class="itemModel" prop="text">
<a-textarea :placeholder="$t('pleaseEnter')+$t('progresstracking')"
v-model="formInlinetracking.text"
style="width: 90%"
:maxLength="500"
:rows="4"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-modal>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/>
</div>
</template>
<script>
// import defaultTemplate from './defaultTemplate'
// import solicitOpinions from './solicitOpinions'
// import releaseStandard from './releaseStandard'
// import industryTemplate from './industryTemplate'
// import addModel from './a/ddModel'
import Standardselection from '@/components/Standardselection/index'
import uploadFile from '@/components/uploadFile/file'
import { getAction, postAction, downloadFile } from '@/api/manage'
import moment from 'moment'
@@ -377,43 +213,12 @@ import { mapGetters } from 'vuex'
export default {
name: 'fillAdd',
components: {
// defaultTemplate,
// solicitOpinions,
// releaseStandard,
// industryTemplate,
// addModel
Standardselection,
uploadFile,
},
data() {
return {
rules: {
title: [
{
required: true,
message: this.$t('title') + this.$t('cannotEmpty'),
trigger: 'blur'
}
],
problemType: [
{
required: true,
message: this.$t('problemType') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
},
visible: false,
visibletrack: false,
rulestracking:{
text: [
{
required: true,
message: this.$t('text') + this.$t('cannotEmpty'),
trigger: 'blur'
}
]
},
formInline: {
list:[{}],
examineapproveevidencelist:[{}],
@@ -427,67 +232,13 @@ export default {
chapterContentsList: [],
firstLevelDutyTerritoryList:[],
projectNameList: [],
ProblemstateList:[this.$t('red'),this.$t('yellow'),this.$t('green'),],
templateDisabled: false,
contentTemplateList: [
{
id: '1',
text: this.$t('defaultTemplate')
},
{
id: '2',
text: this.$t('newRequestCommentListTemplate')
},
{
id: '3',
text: this.$t('NewReleasedStandardTemplate')
},
{
id: '4',
text: this.$t('industryInformationDynamicTemplate')
}
],
index:'',
url: {
add: '/report/lawsMonthlyReportWriteEO/add',
edit: '/report/lawsMonthlyReportWriteEO/edit',
queryById: '/report/lawsMonthlyReportWriteEO/queryById'
}
}
},
mounted() {
},
methods: {
// bringInStandardInformationClick() {
// this.$refs.addModelRef.addModel()
// },
getNameList() {
getAction('project/projectNameInfoEO/list', {}).then((res) => {
if (res.success) {
this.projectNameList = res.result || []
} else {
this.projectNameList = []
}
})
},
addModelForm(value) {
this.$refs.defaultTemplateRef.getStandData(value)
},
getFirstLevelDutyTerritory() {
getAction('/sys/dictItem/getFirstLevelDutyTerritory', {}).then((res) => {
if (res.success) {
this.firstLevelDutyTerritoryList = res.result
} else {
this.firstLevelDutyTerritoryList = []
}
})
},
StandardselectionChange(value, id) {
console.log(id)
this.formInline.documentId = id
this.formInline = { ...this.formInline }
},
clickButtonToUpload(item) {
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
@@ -513,140 +264,20 @@ export default {
this.formInline = { ...this.formInline }
},
...mapGetters(['userInfo']),
add() {
console.log(this.userInfo())
this.templateDisabled = false
this.getNameList()
this.getFirstLevelDutyTerritory()
this.title = this.$t('newlyAdded')
this.visible = true
this.disabled = false
this.formInline = {
list:[{}],
examineapproveevidencelist:[{}],
progresstrackinglist:[{}]
}
this.$nextTick(() => {
this.formInline = { ...this.formInline }
this.$refs.ruleForm.clearValidate()
})
},
edit(row) {
this.getNameList()
this.getFirstLevelDutyTerritory()
check(row) {
this.title = this.$t('edit')
this.visible = true
this.disabled = false
this.templateDisabled = true
this.$nextTick(() => {
this.formInline = row
this.$refs.ruleForm.clearValidate()
getAction('/project/problemManagementEO/queryById', {id:row.id}).then((res) => {
if (res.success) {
console.log(res.result)
this.formInline = res.result
this.visible = true
this.disabled = false
}
})
},
addClick(index){
this.formInline.list.splice(index + 1, 0, {})
this.formInline = { ...this.formInline }
},
deleteClick(index) {
this.formInline.list.splice(index, 1)
this.formInline = { ...this.formInline }
},
addvidenceClick(index){
this.formInline.examineapproveevidencelist.splice(index + 1, 0, {})
this.formInline = { ...this.formInline }
},
deletevidenceClick(index) {
this.formInline.examineapproveevidencelist.splice(index, 1)
this.formInline = { ...this.formInline }
},
addprogresstrackingClick(index){
this.index = index
this.formInlinetracking = {}
this.visibletrack = true
this.$nextTick(() => {
this.formInlinetracking = { ...this.formInlinetracking }
this.isTrue = true
this.$refs.ruleForm.clearValidate()
})
},
deleteprogresstrackingClick(index) {
this.formInline.progresstrackinglist.splice(index, 1)
this.formInline = { ...this.formInline }
},
handleCancel() {
this.visible = false
},
Cancel(){
this.visibletrack = false
this.formInlinetracking = {}
this.$refs.ruleFormtracking.clearValidate()
},
handleOk(){
console.log(this.formInlinetracking)
let time = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
this.$refs.ruleFormtracking.validate(valid => {
if (valid) {
let text = this.userInfo().username + ' ' + time + ' ' + this.formInlinetracking.text
this.formInline.progresstrackinglist.forEach((item,index) => {
console.log(item.text)
if(!item.text){
this.formInline.progresstrackinglist.splice(0,1)
}
})
this.formInline.progresstrackinglist.splice(this.index+1, 1, {text:text})
this.visibletrack = false
}
})
},
handleSubmit() {
console.log(this.formInline)
this.$refs.ruleForm.validate(valid => {
if (valid) {
let text = ''
if (this.$refs.defaultTemplateRef) {
text = 'defaultTemplateRef'
} else if (this.$refs.solicitOpinionsRef) {
text = 'solicitOpinionsRef'
} else if (this.$refs.releaseStandardRef) {
text = 'releaseStandardRef'
} else if (this.$refs.industryTemplateRef) {
text = 'industryTemplateRef'
}
this.$refs[text].getData((val) => {
this.confirmLoading = true
let url = ''
if (this.formInline.id) {
url = this.url.edit
} else {
url = this.url.add
}
let formInline = JSON.parse(JSON.stringify(this.formInline))
Object.keys(formInline).forEach(res => {
if (formInline[res] && formInline[res] instanceof Array) {
formInline[res] = formInline[res].join(',')
}
})
let query = Object.assign(val, {
month: formInline.month,
memoriesChapter: formInline.memoriesChapter,
contentTemplate: formInline.contentTemplate,
memoriesChapterOne:formInline.memoriesChapterOne
})
postAction(url, query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
this.$emit('fillAddForm')
} else {
this.confirmLoading = false
this.$message.warning(this.$t('operationFailed'))
}
})
})
}
})
}
}
}
</script>