diff --git a/src/components/autocomplete/index.vue b/src/components/autocomplete/index.vue
index 8d80889..8c7cacb 100644
--- a/src/components/autocomplete/index.vue
+++ b/src/components/autocomplete/index.vue
@@ -11,30 +11,17 @@
@clear="list = []"
@change="change"
>
-
+
+
+
@@ -43,7 +30,7 @@
export default {
props: {
params: Object,
- config: Object,
+ config: Object
// config: {
// serveTarget: {}, // 远程搜索接口
// autocompleteKey: "", //远程搜索接口参数名
@@ -54,81 +41,94 @@ export default {
},
data() {
return {
- text: "",
- labelIsMore: false,
+ text: '',
+ // labelIsMore: false,
list: [],
- isDisabled: false,
- };
- },
- watch: {
- "config.echoId": {
- handler(nval, oval) {
- this.list = [];
- let type = this.$utils.typeJudgment(this.config.echoName);
- if (nval && ["String"].includes(type)) {
- let resultName = this.config.echoName.replace(/\s*/g, "");
- if (!resultName) return;
- this.remoteMethod(resultName);
- }
- },
- deep: true,
- immediate: true,
- },
- "config.isDisabled": {
- handler(nval, oval) {
- let type = this.$utils.typeJudgment(nval);
- if (["Boolean", "String"].includes(type)) {
- this.isDisabled = !!this.config.isDisabled;
- }
- },
- deep: true,
- immediate: true,
- },
- },
- created() {
- let { labelKey } = this.config;
- let type = this.$utils.typeJudgment(labelKey);
- if (type === "Array") {
- this.labelIsMore = true;
+ isDisabled: false
}
},
+ watch: {
+ 'config.echoId': {
+ handler(nval, oval) {
+ this.list = []
+ let type = this.$utils.typeJudgment(this.config.echoName)
+ if (nval && ['String'].includes(type)) {
+ let resultName = this.config.echoName.replace(/\s*/g, '')
+ if (!resultName) return
+ this.remoteMethod(resultName)
+ }
+ },
+ deep: true,
+ immediate: true
+ },
+ 'config.isDisabled': {
+ handler(nval, oval) {
+ let type = this.$utils.typeJudgment(nval)
+ if (['Boolean', 'String'].includes(type)) {
+ this.isDisabled = !!this.config.isDisabled
+ }
+ },
+ deep: true,
+ immediate: true
+ }
+ },
+ created() {
+ let { labelKey } = this.config
+ let type = this.$utils.typeJudgment(labelKey)
+ // if (type === 'Array') {
+ // this.labelIsMore = true
+ // }
+ this.labelHandler = this.labelHandler(type)
+ // console.log(this.labelHandler())
+ },
methods: {
+ labelHandler(type) {
+ if (type === 'Array') {
+ return item => {
+ return this.config.labelKey.reduce((prev, cur) => {
+ prev += /^[^0-9a-zA-Z]/.test(cur) ? cur : item[cur]
+ return prev
+ }, '')
+ }
+ }
+ return item => {
+ return item[this.config.labelKey]
+ }
+ },
// 远程搜索
remoteMethod(query) {
- if (query !== "") {
- this.loading = true;
- let type = this.$utils.typeJudgment(this.config.autocompleteKey);
+ if (query !== '') {
+ this.loading = true
+ let type = this.$utils.typeJudgment(this.config.autocompleteKey)
// if (!type.includes("Object") && !type.includes("String")) {
// this.loading = false;
// this.$message.warning("config.autocompleteKey格式有误");
// return;
// }
- let params = {};
- if (["Object"].includes(type)) {
- params[this.config.autocompleteKey.key] = query;
- params["enableMark"] = this.config.autocompleteKey.enableMark;
+ let params = {}
+ if (['Object'].includes(type)) {
+ params[this.config.autocompleteKey.key] = query
+ params['enableMark'] = this.config.autocompleteKey.enableMark
}
- if (["String", "Undefined", "Null"].includes(type)) {
+ if (['String', 'Undefined', 'Null'].includes(type)) {
// 接口为get类型时需将autocompleteKey值设为空
- this.config.autocompleteKey
- ? (params[this.config.autocompleteKey] = query)
- : (params = query);
+ this.config.autocompleteKey ? (params[this.config.autocompleteKey] = query) : (params = query)
}
- this.config.serveTarget(params).then((res) => {
- this.loading = false;
+ this.config.serveTarget(params).then(res => {
+ this.loading = false
if (res.data.length) {
- this.list = res.data;
- } else this.list = [];
- });
+ this.list = res.data
+ } else this.list = []
+ })
} else {
- this.list = [];
+ this.list = []
}
},
change(val) {
- this.$emit("change", val, this.list);
- },
- },
-};
+ this.$emit('change', val, this.list)
+ }
+ }
+}
diff --git a/src/views/customerManagement/companyManagement/index.vue b/src/views/customerManagement/companyManagement/index.vue
index e4e302e..e148d7b 100644
--- a/src/views/customerManagement/companyManagement/index.vue
+++ b/src/views/customerManagement/companyManagement/index.vue
@@ -3,57 +3,24 @@
-
+
-
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
+
@@ -123,76 +82,45 @@
-
- {{ row.oilsPriceStrategy === "1" ? "费率" : "增减" }}:{{
- row.oilsPriceScale
- }}
-
+ {{ row.oilsPriceStrategy === '1' ? '费率' : '增减' }}:{{ row.oilsPriceScale }}
-
- {{
- row.consumRebateStrategy == "TYFL" ? "统一费率" : "油站等级"
- }}
- {{ row.consumRebateScale || "0" }}
+
+ {{ row.consumRebateStrategy == 'TYFL' ? '统一费率' : '油站等级' }}
+ {{ row.consumRebateScale || '0' }}
- {{ row.consumRebateStrategy == "TYSSFL" ? "统一升数" : "未知" }}
- {{
- row.consumRebateScale ? row.consumRebateScale + "元/L" : "0"
- }}
-
-
- 暂无
+ {{ row.consumRebateStrategy == 'TYSSFL' ? '统一升数' : '未知' }}
+ {{ row.consumRebateScale ? row.consumRebateScale + '元/L' : '0' }}
+ 暂无
- {{
- companyNatureTypeEnum.find(
- (item) => item.value == row.companyNature
- ).label
- }}
+ {{ companyNatureTypeEnum.find(item => item.value == row.companyNature).label }}
{{
- row.companyType === "0"
- ? "柴油账户"
- : row.companyType === "1"
- ? "汽油账户"
- : row.companyType === "2"
- ? "LNG账户"
- : row.companyType === "3"
- ? "尿素账户"
- : "油批账户"
+ row.companyType === '0'
+ ? '柴油账户'
+ : row.companyType === '1'
+ ? '汽油账户'
+ : row.companyType === '2'
+ ? 'LNG账户'
+ : row.companyType === '3'
+ ? '尿素账户'
+ : '油批账户'
}}
- {{
- row.companyDockType === 0
- ? "对接客户"
- : row.companyDockType === 1
- ? "平台客户"
- : "暂无"
- }}
+ {{ row.companyDockType === 0 ? '对接客户' : row.companyDockType === 1 ? '平台客户' : '暂无' }}
@@ -202,8 +130,8 @@
:active-value="1"
:inactive-value="0"
@change="
- (val) => {
- enableMark(val, row);
+ val => {
+ enableMark(val, row)
}
"
>
@@ -224,27 +152,21 @@
-->
- {{
- auditMarkEnum.find((item) => item.value == row.auditMark).label
- }}
+ {{
+ auditMarkEnum.find(item => item.value == row.auditMark).label
+ }}
- {{ row.userName || "企业负责人" }}
- {{ row.phone || "暂无电话" }}
+ {{ row.userName || '企业负责人' }}
+ {{ row.phone || '暂无电话' }}
- {{ row.createUserName || "创建人" }}
- {{ row.createTime || "创建时间" }}
+ {{ row.createUserName || '创建人' }}
+ {{ row.createTime || '创建时间' }}
@@ -252,40 +174,17 @@
详情
{
- commandMore(val, row);
+ val => {
+ commandMore(val, row)
}
"
>
-
- 更多
-
+ 更多
-
- 基础资料
-
-
- 认证信息
-
-
- 银行信息
-
-
- 财务信息
-
+ 基础资料
+ 认证信息
+ 银行信息
+ 财务信息
@@ -297,11 +196,7 @@
-
+
@@ -310,13 +205,7 @@
-
+
- {{ oilCompanyMatch[0].parentMark === 0 ? "主体公司" : "分公司" }}
+ {{ oilCompanyMatch[0].parentMark === 0 ? '主体公司' : '分公司' }}
- {{
- companyNatureTypeEnum.find(
- (item) => item.value == oilCompanyMatch[0].companyNature
- ).label
- }}
+ {{ companyNatureTypeEnum.find(item => item.value == oilCompanyMatch[0].companyNature).label }}
- {{
- oilCompanyMatch[0].companyDockType == 0 ? "对接客户" : "平台客户"
- }}
+ {{ oilCompanyMatch[0].companyDockType == 0 ? '对接客户' : '平台客户' }}
- {{ oilCompanyMatch[0].enableMark == 0 ? "禁用" : "启用" }}
+ {{ oilCompanyMatch[0].enableMark == 0 ? '禁用' : '启用' }}
- {{
- auditMarkEnum.find(
- (item) => item.value == oilCompanyMatch[0].auditMark
- ).label
- }}
+ {{ auditMarkEnum.find(item => item.value == oilCompanyMatch[0].auditMark).label }}
@@ -368,10 +247,7 @@
-
+
@@ -380,21 +256,17 @@
- {{ oilCompanyMatch[2].defaultShare == 1 ? "共享" : "不共享" }}
+ {{ oilCompanyMatch[2].defaultShare == 1 ? '共享' : '不共享' }}
- {{
- companyTypeEnum.find(
- (item) => item.value == oilCompanyMatch[3].accountState
- ).label
- }}
+ {{ companyTypeEnum.find(item => item.value == oilCompanyMatch[3].accountState).label }}
- {{ oilCompanyMatch[3].accountType == 0 ? "基础账户" : "" }}
+ {{ oilCompanyMatch[3].accountType == 0 ? '基础账户' : '' }}
@@ -442,19 +314,19 @@