From 20633c4c46b1b0498fb5ca36d3a731eaa5b99c54 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期三, 07 六月 2023 16:42:13 +0800
Subject: [PATCH] 集团申请单接口增加
---
Source/UBCS-WEB/src/components/advanced-query/advancedQuery.vue | 86 ++++++++++++++++++++++++++-----------------
1 files changed, 52 insertions(+), 34 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/advanced-query/advancedQuery.vue b/Source/UBCS-WEB/src/components/advanced-query/advancedQuery.vue
index d9e17d9..8e6bea6 100644
--- a/Source/UBCS-WEB/src/components/advanced-query/advancedQuery.vue
+++ b/Source/UBCS-WEB/src/components/advanced-query/advancedQuery.vue
@@ -14,7 +14,7 @@
destroy-on-close>
<div class="search-total">
<!-- 澶撮儴鎸夐挳鍖哄煙 -->
- <div class="dialog-search-button">
+ <div slot="title" class="dialog-search-button">
<el-button
type="primary"
size="small"
@@ -55,7 +55,6 @@
<el-option
v-for="condition in item.fieldType=='text' ? searchConditions:switchSearchConditions"
:key="condition.value"
-
:label="condition.label"
:value="condition.value">
</el-option>
@@ -64,8 +63,8 @@
</el-col>
<el-col :span="12">
<div class="grid-content">
- <el-input v-show="item.fieldType==='text' || item.fieldType===''" v-model="searchFormArrays[index].fieldValue" type="text" placeholder="璇疯緭鍏�"></el-input>
- <el-select v-show="item.fieldType==='combox'" v-model="searchFormArrays[index].fieldValue" placeholder="璇烽�夋嫨">
+ <el-input v-if="item.fieldType==='text' || item.fieldType===''" v-model="searchFormArrays[index].fieldValue" type="text" placeholder="璇疯緭鍏�"></el-input>
+ <el-select v-else-if="item.fieldType==='combox'" v-model="searchFormArrays[index].fieldValue" placeholder="璇烽�夋嫨">
<el-option
v-for="option in item.data"
:key="option.value"
@@ -73,7 +72,7 @@
:value="option.value">
</el-option>
</el-select>
- <el-switch v-show="item.fieldType==='truefalse'" v-model="searchFormArrays[index].fieldValue"></el-switch>
+ <el-switch v-else-if="item.fieldType==='truefalse'" v-model="searchFormArrays[index].fieldValue"></el-switch>
</div>
</el-col>
<el-col :span="2">
@@ -88,6 +87,7 @@
</template>
<script>
+import { getDictionary } from "@/api/omd/enum";
export default {
name: "advancedQuery",
props: {
@@ -101,10 +101,6 @@
type: "Object",
default: {},
},
- conditionMapParams: {
- type: "Object",
- default: {},
- },
},
data() {
return {
@@ -114,33 +110,37 @@
// 瀛楁鏄緭鍏ユ绫诲瀷鐨勬潯浠舵暟缁�
searchConditions: [
{
- value: "=",
+ value: "_equal",
label: "绛変簬",
},{
- value: "like",
- label: "鍖呭惈",
- },{
- value: "!=",
+ value: "_notequal",
label: "涓嶇瓑浜�",
},{
- value: ">",
- label: "澶т簬",
+ value: "_like",
+ label: "鍖呭惈",
},{
- value: "<",
+ value: "_notlike",
+ label: "涓嶅寘鍚�",
+ },{
+ value: "_ge", //澶т簬锛岄粯璁や负澶т簬绛変簬
+ label: "澶т簬",
+ },{
+ value: "_le", //灏忎簬锛岄粯璁や负灏忎簬绛変簬
label: "灏忎簬",
},
],
// 瀛楁鏄崟閫夋垨涓嬫媺妗嗙被鍨嬬殑鏉′欢鏁扮粍
switchSearchConditions: [
{
- value: "=",
+ value: "_equal",
label: "绛変簬",
},{
- value: "!=",
+ value: "_notequal",
label: "涓嶇瓑浜�",
- },
+ }
],
searchFormArrays: [],
+ fieldValue: '',
}
},
watch: {
@@ -153,12 +153,19 @@
// 灏唎ptions閰嶇疆璧嬪�煎埌data涓殑option涓紝閬垮厤娣辨祬鎷疯礉鐨勯棶棰樻墍浠ラ渶瑕佽浆json涔嬪悗鍐嶈祴鍊�
const data = JSON.stringify(this.options);
this.initOptions = JSON.parse(data);
- // console.log(this.initOptions);
+ //console.log(this.initOptions);
this.initOptions.forEach((item,index) => {
+ if(item.fieldType==='combox') {
+
+ this.getEnum(item.comboxKey).then(res=>{
+ console.log(res.data);
+ })
+ //item.data =
+ }
let add = {
queryField: String(item.queryField),
- condition: item.fieldType=='text' ? String("like"):String("="),
- fieldValue: item.fieldType=='truefalse' ? Boolean(false):String(''),
+ condition: item.fieldType==='text' ? String("_like"):String("_equal"),
+ fieldValue: item.fieldType==='truefalse' ? Boolean(false):String(""),
}
this.searchFormArrays.push(add)
});
@@ -169,6 +176,17 @@
},
methods: {
+
+ async getEnum(enumText){
+ let enumParam = '';
+ await getDictionary({code: enumText}).then(res=>{
+ enumParam = res.data.data;
+ // console.log(res.data);
+ })
+ //console.log(enumParam);
+ return enumParam;
+ },
+
// 绉婚櫎鎼滅储妗�
removeInput(index){
//console.log(this.initOptions);
@@ -183,7 +201,7 @@
this.initOptions.forEach((item,index) => {
let add = {
queryField: String(item.queryField),
- condition:item.fieldType=='text' ? String("like"):String("="),
+ condition:item.fieldType=='text' ? String("_like"):String("_equal"),
fieldValue: item.fieldType=='truefalse' ? Boolean(false):String(''),
}
array.push(add)
@@ -203,22 +221,21 @@
const searchConditions = this.searchFormArrays;
for(let index = 0; index < searchConditions.length; index++) {
//console.log(condtionParam['conditionMap['+searchConditions[index].queryField+']']+'' == 'undefined');
- if(searchConditions[index].fieldValue != '' || searchConditions[index].fieldValue+''==='false') {
+ if(searchConditions[index].fieldValue.trim() != '' || searchConditions[index].fieldValue+''==='false') {
// 瀛樺湪鐩稿悓鐨勬煡璇㈡潯浠�
if(condtionParam['conditionMap['+searchConditions[index].queryField+']']+''.trim() != 'undefined' ) {
this.$message.warning("瀛樺湪閲嶅鏌ヨ鏉′欢锛岃浠旂粏鏍稿!");
return false;
}
- condtionParam['conditionMap['+searchConditions[index].queryField+']'] = searchConditions[index].fieldValue;
+ //鎷兼帴鎴恗ap瀵硅薄锛屽皢鏌ヨ瀵硅薄鍜宑ondition鎷兼帴鍦ㄤ竴璧凤紝缁勬垚楂樼骇鏌ヨmap鐨刱ey
+ condtionParam['conditionMap['+searchConditions[index].queryField+searchConditions[index].condition+']'] = searchConditions[index].fieldValue;
}
}
- //鏌ヨ鏉′欢娌℃湁鍑虹幇閲嶅灞炴�э紝骞朵笖杩囨护鎺変簡绌哄�硷紝浼犻�掔粰鐖剁粍浠�
- //console.log(condtionParam);
- // if(){
-
- // }
- this.$emit('echoContion',condtionParam)
- },
+ // 鏌ヨ鏉′欢娌℃湁鍑虹幇閲嶅灞炴�э紝骞朵笖杩囨护鎺変簡绌哄�硷紝浼犻�掔粰鐖剁粍浠�
+ // console.log(condtionParam);
+ this.$emit('echoContion',condtionParam)
+ this.isShowDialog = false;
+ },
}
}
</script>
@@ -240,7 +257,8 @@
position: fixed;
display: block;
background-color: #fff;
- top: 90px;
+ // top: 10%;
+ margin-top: -30px;
width: 50%;
z-index: 1000;
}
--
Gitblit v1.9.3