修改文档库传参

This commit is contained in:
qq787203167
2022-03-01 16:01:19 +08:00
parent 877d467713
commit 6cd41c8eb6
8 changed files with 85 additions and 43 deletions
@@ -1,14 +1,10 @@
<template>
<div>
<div class="box-title-text">
<!-- <div class="title-text">-->
<!-- <span class="Required">*</span>-->
<!-- <span :class="{'title-text-text':false}">{{query.enName}}</span><br>-->
<!-- <span :class="{'title-text-text':false}">{{query.name}}</span>-->
<!-- </div>-->
<a-input class="box-input" :value="value" @input="indexclick($event)"
:placeholder="$t('PleaseEnterOrSelect')+query.db_field_txt"/>
<a-button type="primary" class="button-box" @click="standardClick">
:disabled="isDisabled"
:placeholder="!isDisabled?$t('PleaseEnterOrSelect')+query.db_field_txt:query.db_field_txt"/>
<a-button v-if="!isDisabled" type="primary" class="button-box" @click="standardClick">
{{this.$t('standardSelection')}}
</a-button>
</div>
@@ -65,6 +61,14 @@
currencySearch
},
props: ['query', 'value', 'replace_standard_id'],
computed: {
isDisabled() {
if (this.query.db_field_name === 'replaced_standard') {
return true
}
return false
}
},
data() {
return {
visible: false,
@@ -238,4 +242,9 @@
text-align: right;
margin-top: 20px;
}
</style>
<style>
/*.ant-input-disabled{*/
/* background-color: #f5f5f5!important;*/
/*}*/
</style>
@@ -69,10 +69,10 @@
methods: {
initDictData() {
//优先从缓存中读取字典配置
/* if(getDictItemsFromCache(this.dictCode)){
if(getDictItemsFromCache(this.dictCode)){
this.dictOptions = getDictItemsFromCache(this.dictCode);
return
}*/
}
//根据字典Code, 初始化字典数组
ajaxGetDictItems(this.dictCode, null).then((res) => {
@@ -88,11 +88,11 @@
this.dictOptions = [...this.options]
}else{
//优先从缓存中读取字典配置
// let cacheOption = getDictItemsFromCache(this.dictCode)
// if(cacheOption && cacheOption.length>0){
// this.dictOptions = cacheOption
// return
// }
let cacheOption = getDictItemsFromCache(this.dictCode)
if(cacheOption && cacheOption.length>0){
this.dictOptions = cacheOption
return
}
//根据字典Code, 初始化字典数组
ajaxGetDictItems(this.dictCode, null).then((res) => {
if (res.success) {
@@ -268,6 +268,7 @@
validatorRules: {},
confirmLoading: false,
uploadName: '',
type: 'add',
headerText: [
{
text: this.$t('essentialInformation'),
@@ -329,7 +330,7 @@
}
},
mounted() {
this.getForm()
},
methods: {
sumber() {
@@ -447,16 +448,18 @@
this.isFormInline = true
this.confirmLoading = false
},
getForm() {
getForm(callBack) {
this.confirmLoading = true
let params = {
flag: this.flag
flag: this.flag,
type: this.type
}
getAction(this.url.getAddForm, params).then((res) => {
if (res.success) {
this.dataList = res.result
this.ruleList = res.result
this.IntegrateData()
callBack && callBack()
this.headerText.forEach((res) => {
res.content = []
this.dataList.forEach(val => {
@@ -469,18 +472,23 @@
})
},
edit(item) {
getAction(this.url.getDocumentInfo, { id: item.id }).then((res) => {
if (res.success) {
this.formInline = res.result[0]
}
this.type = 'edit'
this.getForm(() => {
getAction(this.url.getDocumentInfo, { id: item.id }).then((res) => {
if (res.success) {
this.formInline = res.result[0]
}
})
})
},
add() {
this.formInline = {}
this.type = 'add'
this.getForm()
},
StandardselectionChange(id){
StandardselectionChange(id) {
this.formInline.replace_standard_id = id
},
}
}
}
</script>