Merge branch 'master' into zyj

# Conflicts:
#	src/views/oilFinalStatement/oilFinalStatementListInfo.vue
pull/24/head
zhangyouji 1 year ago
commit 49b6ed8a06
  1. 37
      src/components/autocomplete/index.vue
  2. 29
      src/utils/index.js
  3. 4
      src/views/oilFinalStatement/oilFinalStatementAddList.vue
  4. 6
      src/views/oilFinalStatement/oilFinalStatementListInfo.vue

@ -11,15 +11,6 @@
@clear="list = []" @clear="list = []"
@change="change" @change="change"
> >
<!-- <template v-if="labelIsMore">
<el-option
v-for="(item, index) in list"
:key="item.id + index"
:label="item[config.labelKey[0]] + '(' + item[config.labelKey[1]] + '-' + item[config.labelKey[2]] + ')'"
:value="item[config.valueKey]"
>
</el-option>
</template> -->
<template> <template>
<el-option v-for="(item, index) in list" :key="index" :label="labelHandler(item)" :value="item[config.valueKey]"> </el-option> <el-option v-for="(item, index) in list" :key="index" :label="labelHandler(item)" :value="item[config.valueKey]"> </el-option>
</template> </template>
@ -33,17 +24,17 @@ export default {
config: Object config: Object
// config: { // config: {
// serveTarget: {}, // // serveTarget: {}, //
// autocompleteKey: "", // // autocompleteKey: "" || {}, //
// labelKey: [] || '', //label // labelKey: "" || [], // label
// valueKey: "", //id // valueKey: "", // id
// querykey: "", // // querykey: "", //
// echoId:'', // // echoId: "", // id
// echoName: "", // name
// }, // },
}, },
data() { data() {
return { return {
text: '', text: '',
// labelIsMore: false,
list: [], list: [],
isDisabled: false isDisabled: false
} }
@ -51,7 +42,6 @@ export default {
watch: { watch: {
'config.echoId': { 'config.echoId': {
handler(nval, oval) { handler(nval, oval) {
console.log('nvalnvalnvalnvalnval', nval)
this.list = [] this.list = []
let type = this.$utils.typeJudgment(this.config.echoName) let type = this.$utils.typeJudgment(this.config.echoName)
if (nval && ['String'].includes(type)) { if (nval && ['String'].includes(type)) {
@ -77,18 +67,22 @@ export default {
created() { created() {
let { labelKey } = this.config let { labelKey } = this.config
let type = this.$utils.typeJudgment(labelKey) let type = this.$utils.typeJudgment(labelKey)
// if (type === 'Array') { // labelHandler
// this.labelIsMore = true
// }
this.labelHandler = this.labelHandler(type) this.labelHandler = this.labelHandler(type)
// console.log(this.labelHandler())
}, },
methods: { methods: {
labelHandler(type) { labelHandler(type) {
if (type === 'Array') { if (type === 'Array') {
return item => { return item => {
return this.config.labelKey.reduce((prev, cur) => { return this.config.labelKey.reduce((prev, cur) => {
prev += /^[^0-9a-zA-Z]/.test(cur) ? cur : item[cur] let type = this.$utils.typeJudgment(cur)
let _function =
type != 'Function'
? item => {
return /^[^0-9a-zA-Z]/.test(cur) ? cur : item[cur]
}
: cur
prev += _function(item)
return prev return prev
}, '') }, '')
} }
@ -99,7 +93,6 @@ export default {
}, },
// //
remoteMethod(query) { remoteMethod(query) {
console.log('query', query)
if (query !== '') { if (query !== '') {
this.loading = true this.loading = true
let type = this.$utils.typeJudgment(this.config.autocompleteKey) let type = this.$utils.typeJudgment(this.config.autocompleteKey)

@ -17,32 +17,35 @@ export function parseTime(time) {
} }
const formatRes = { const formatRes = {
y: date.getFullYear(), y: date.getFullYear(),
M: date.getMonth() + 1, M: (date.getMonth() + 1 + '').padStart(2, 0),
d: date.getDate(), d: (date.getDate() + '').padStart(2, 0),
h: date.getHours(), h: (date.getHours() + '').padStart(2, 0),
m: date.getMinutes(), m: (date.getMinutes() + '').padStart(2, 0),
s: date.getSeconds(), s: (date.getSeconds() + '').padStart(2, 0),
week: ['日', '一', '二', '三', '四', '五', '六'][date.getDay()] week: ['日', '一', '二', '三', '四', '五', '六'][date.getDay()]
} }
formatRes.M < 10 && (formatRes.M = '0' + formatRes.M) // formatRes.M < 10 && (formatRes.M = '0' + formatRes.M)
formatRes.d < 10 && (formatRes.d = '0' + formatRes.d) // formatRes.d < 10 && (formatRes.d = '0' + formatRes.d)
formatRes.h < 10 && (formatRes.h = '0' + formatRes.h) // formatRes.h < 10 && (formatRes.h = '0' + formatRes.h)
formatRes.m < 10 && (formatRes.m = '0' + formatRes.m) // formatRes.m < 10 && (formatRes.m = '0' + formatRes.m)
formatRes.s < 10 && (formatRes.s = '0' + formatRes.s) // formatRes.s < 10 && (formatRes.s = '0' + formatRes.s)
return formatRes return formatRes
} }
// 防抖 // 防抖
export function debounce(fn, delay) { export function debounce(fn, delay) {
let timer = null let timer = null
return function () { function _implementer(...args) {
if (timer) clearTimeout(timer) if (timer) clearTimeout(timer)
let _this = this let _this = this
let _arguments = arguments
timer = setTimeout(function () { timer = setTimeout(function () {
fn.apply(_this, _arguments) fn.call(_this, ...args)
}, delay) }, delay)
} }
_implementer.cancel = () => {
clearTimeout(timer)
}
return _implementer
} }
// 车牌校验 // 车牌校验
export function isLicensePlate(number) { export function isLicensePlate(number) {

@ -197,7 +197,7 @@
</el-row> </el-row>
<div :span="24" style="margin-top: 50px; text-align: center; width: 100%"> <div :span="24" style="margin-top: 50px; text-align: center; width: 100%">
<el-divider style="width: 100%"></el-divider> <el-divider style="width: 100%"></el-divider>
<div style="display: flex; justify-content: end; width: 90%; margin: 0 auto"> <div style="display: flex; justify-content: flex-end; width: 90%; margin: 0 auto">
<el-button @click="close" size="mini">取消</el-button> <el-button @click="close" size="mini">取消</el-button>
<el-button size="mini" type="primary" :disabled="!setWait" @click="addList">确认提交</el-button> <el-button size="mini" type="primary" :disabled="!setWait" @click="addList">确认提交</el-button>
</div> </div>
@ -625,7 +625,7 @@ export default {
/* flex: 1; */ /* flex: 1; */
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: end; justify-content: flex-end;
font-size: 16px; font-size: 16px;
} }

@ -181,11 +181,8 @@
</div> </div>
</template> </template>
<script> <script>
import { imgCompress } from '@/utils'
import internalCompanyApi from '@/api/user/internalCompany' import internalCompanyApi from '@/api/user/internalCompany'
import utils from '@/utils/encode'
import { mapGetters } from 'vuex'
const JSESSIONID = utils.uuid()
export default { export default {
filters: {}, filters: {},
props: { props: {
@ -197,7 +194,6 @@ export default {
data() { data() {
return { return {
tableHeight: document.documentElement.clientHeight - 470 - 55, tableHeight: document.documentElement.clientHeight - 470 - 55,
imgCompress,
companyList: [], companyList: [],
roleList: [], roleList: [],
roleTypeList: [], roleTypeList: [],

Loading…
Cancel
Save