张同海 2 years ago
commit 5491cb1342

@ -262,7 +262,23 @@
</a-form-model-item>
</a-col>
</template>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6">
<template v-if="details.carrierid === 'ESL'">
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6" >
<a-form-model-item
class="from-label"
label="航次"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
prop="voyno"
>
<inputView type="voyno" :parentVal="details.voyno" @getInputChange="inputChange"/>
<!-- <a-input :allowClear="true" v-model="details.voyno" /> -->
</a-form-model-item>
</a-col>
</template>
<template v-else>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6" >
<a-form-model-item
class="from-label"
label="海关航次"
@ -275,6 +291,7 @@
<!-- <a-input :allowClear="true" v-model="details.voyno" /> -->
</a-form-model-item>
</a-col>
</template>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6">
<a-form-model-item
class="from-label"
@ -1394,6 +1411,9 @@ export default {
inputChange ({ type, value }) {
this.details[type] = value
console.log(this.details[type])
if (type === 'voyno' && this.details.carrierid === 'ESL') {
this.details.voynoinner = this.details[type]
}
this.$forceUpdate()
}
}

@ -694,7 +694,7 @@
</div> -->
<div class="text-input">
<a-textarea
v-model="details.pkgsTotal"
v-model="details.pkgstotal"
placeholder="请输入内容"
:auto-size="{ minRows: 6, maxRows: 9 }"
@change="pkgsTextChange"
@ -743,7 +743,7 @@
</div> -->
<div class="text-input">
<a-textarea
v-model="details.kgsTotal"
v-model="details.kgstotal"
placeholder="请输入内容"
:auto-size="{ minRows: 6, maxRows: 9 }"
@change="kgsTextChange"
@ -765,7 +765,7 @@
</div> -->
<div class="text-input">
<a-textarea
v-model="details.cbmTotal"
v-model="details.cbmtotal"
placeholder="请输入内容"
:auto-size="{ minRows: 6, maxRows: 9 }"
@change="cbmTextChange"
@ -1830,7 +1830,7 @@ export default {
},
//
pkgsTextChange () {
const pkgsTexyVal = this.details.pkgsTotal
const pkgsTexyVal = this.details.pkgstotal
const arr = pkgsTexyVal.split(/\n|\r/g)
let pkgs = 0
let kindpkgs = ''
@ -1839,19 +1839,21 @@ export default {
const regexStr = item.match(/[a-zA-Z]+|[0-9]+(?:\.[0-9]+|)/g);
console.log('分割数组:', regexStr)
if (regexStr && Number(regexStr[0])) {
pkgs += Number(regexStr[0])
// pkgs += Number(regexStr[0])
const num1 = Number(regexStr[0])
pkgs = (pkgs * 100 + num1 * 100) / 100
}
if (!kindpkgs && regexStr && /^[a-zA-Z]+$/.test(regexStr[1])) {
kindpkgs = regexStr[1]
}
})
console.log('包装:', kindpkgs, ' 、件数:', pkgs)
this.details.pkgs = pkgs
console.log('包装:', kindpkgs, ' 、件数:', parseInt(pkgs))
this.details.pkgs = parseInt(pkgs)
this.details.kindpkgs = kindpkgs
},
//
kgsTextChange () {
const kgsTexyVal = this.details.kgsTotal
const kgsTexyVal = this.details.kgstotal
const arr = kgsTexyVal.split(/\n|\r/g)
let kgs = 0
console.log('arr', arr)
@ -1859,7 +1861,9 @@ export default {
const regexStr = item.match(/[a-zA-Z]+|[0-9]+(?:\.[0-9]+|)/g);
console.log('分割数组:', regexStr)
if (regexStr && Number(regexStr[0])) {
kgs += Number(regexStr[0])
// kgs += Number(regexStr[0])
const num1 = Number(regexStr[0])
kgs = (kgs * 100 + num1 * 100) / 100
}
})
console.log('总重量:', kgs)
@ -1867,7 +1871,7 @@ export default {
},
//
cbmTextChange () {
const cbmTexyVal = this.details.cbmTotal
const cbmTexyVal = this.details.cbmtotal
const arr = cbmTexyVal.split(/\n|\r/g)
let cbm = 0
console.log('arr', arr)
@ -1875,10 +1879,25 @@ export default {
const regexStr = item.match(/[a-zA-Z]+|[0-9]+(?:\.[0-9]+|)/g);
console.log('分割数组:', regexStr)
if (regexStr && Number(regexStr[0])) {
cbm += Number(regexStr[0])
// cbm += Number(regexStr[0])
const num1 = Number(regexStr[0])
cbm = (cbm * 100 + num1 * 100) / 100
}
})
console.log('总重量:', cbm)
// cbm += ''
// let res = null
// const pNum = cbm.split('.')
// if (!/\./.test(cbm)) {
// res = cbm + '.00'
// } else if (pNum[1].length < 2) {
// res = cbm + '0'
// } else if (pNum.length > 1) {
// res = pNum[0] + '.' + pNum[1].substr(0, 1)
// console.log(pNum[0], pNum[1].substr(0, 1))
// } else {
// res = cbm
// }
console.log('尺码: ', cbm)
this.details.cbm = cbm
}
}

@ -25,56 +25,84 @@
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24" :style="{ paddingRight: 0 }">
<a-col :md="5" :sm="24" :style="{ paddingRight: 0 }">
<a-form-item
label="租户名称"
label="租户"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
>
<a-input
<!-- <a-input
placeholder="请输入租户名称"
v-decorator="[
'TenantName',
{ rules: [{ required: false, message: '请输入租户名称' }] },
]"
/>
/> -->
<a-select
show-search
placeholder="请选择租户"
v-decorator="[
'TenantName',
{ rules: [{ required: false, message: '请输入租户名称' }] },
]"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="filterOption"
:not-found-content="null"
>
<a-select-option v-for="item in TenantData" :key="item.id" :value="item.name">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24" :style="{ paddingRight: 0 }">
<a-col :md="5" :sm="24" :style="{ paddingRight: 0 }">
<a-form-item
label="用户姓名"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
>
<a-input
<!-- <a-input
placeholder="请输入用户姓名"
v-decorator="[
'UserName',
{ rules: [{ required: false, message: '请输入用户姓名' }] },
]"
/> -->
<auto-complete
:allowClear="true"
class="customer-input"
v-decorator="[
'UserName'
]"
:data-source="userListArr"
:dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }"
@change="userChange"
@focus="userChange"
/>
</a-form-item>
</a-col>
<a-col :md="7" :sm="24" :style="{ paddingRight: 0 }">
<a-col :md="4" :sm="24" :style="{ paddingRight: 0 }">
<a-form-item
label="是否禁用"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
>
<a-radio-group class="disable-radio" v-decorator="['IsDisable']">
<a-radio :value="0">
启用
</a-radio>
<a-radio :value="1">
禁用
</a-radio>
<a-radio :value="2">
全部
</a-radio>
</a-radio-group>
<a-select
default-value="2"
style="width: 100%"
:dropdownMatchSelectWidth="false"
v-decorator="['IsDisable']"
>
<a-select-option :key="2">全部</a-select-option>
<a-select-option :key="0">启用</a-select-option>
<a-select-option :key="1">禁用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24" :labelCol="{ span: 2, offset: 12 }">
<a-col :md="5" :sm="24" :labelCol="{ span: 2, offset: 12 }">
<span class="table-page-search-submitButtons" style="text-align: right">
<a-button type="primary" @click="tableRefresh"></a-button>
<a-button style="margin-left: 8px" @click="tableReset"></a-button>
@ -137,8 +165,11 @@ import {
DeleteApi,
GetApiDetail,
DisableApi,
ResetApi
ResetApi,
SysTenantPage,
GetSysUserPage
} from '@/api/modular/main/DjyApiAuth'
import { AutoComplete } from 'ant-design-vue'
export default {
name: 'BookingLedger',
@ -146,6 +177,7 @@ export default {
XCard,
columnSetting,
addForm,
AutoComplete
},
data() {
return {
@ -186,12 +218,32 @@ export default {
addFormType: 'add',
addFromIndex: null,
apiInterface: [],
TenantData: [],
userList: []
}
},
computed: {
userListArr() {
if (this.userList) {
const arr = []
this.userList.map((item, index) => {
if (!arr.includes(item.name)) {
arr.push(item.name)
}
})
return arr
} else {
return []
}
}
},
created() {
this.getList()
this.apiInterface = this.$options.filters['dictData']('api_interface')
console.log('apiInterface', this.apiInterface)
SysTenantPage({ pageNo: 1, pageSize: 9999, name: '' }).then(res => {
this.TenantData = res.data.rows
})
},
mounted() {},
methods: {
@ -402,7 +454,37 @@ export default {
cancel() {},
filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
getUserList(name = '') {
const tenantName = this.form.getFieldValue('TenantName')
let tenantId = ''
this.TenantData.map((item, index) => {
if (tenantName === item.name) {
tenantId = item.id
}
})
GetSysUserPage({
name: name,
tenantId: tenantId
})
.then(res => {
if (res.success) {
this.userList = res.data
}
})
.catch(err => {
console.log(err)
})
},
// userSelect(value) {
// const index = this.userListArr.indexOf(value)
// this.formData.userId = this.userList[index].id || ''
// this.formData.userName = this.userList[index].name || ''
// this.formData.userCode = this.userList[index].account || '' // ??
// },
userChange(value) {
this.getUserList(value)
},
}
}
</script>

@ -51,6 +51,7 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
prop="tenantName"
>
<a-select
show-search
@ -82,20 +83,22 @@
:data-source="userListArr"
:dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }"
@select="saleSelect"
@change="saleChange"
@focus="saleChange"
@select="userSelect"
@change="userChange"
@focus="userChange"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-col :span="24" v-if="formData.apiKey">
<a-form-model-item
label="用户代码"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="接口KEY"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
style="margin-bottom:0;"
>
<a-input placeholder="请输入用户代码" v-model="formData.userCode" />
<span>{{ formData.apiKey }}</span>
<span class="copy-tip" @click="copyFun(formData.apiKey)"><i class="iconfont icon-fuzhi2"></i></span>
</a-form-model-item>
</a-col>
<a-col :span="24" v-if="formData.apiSecret">
@ -110,18 +113,6 @@
<span class="copy-tip" @click="copyFun(formData.apiSecret)"><i class="iconfont icon-fuzhi2"></i></span>
</a-form-model-item>
</a-col>
<a-col :span="24" v-if="formData.apiKey">
<a-form-model-item
label="接口KEY"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
style="margin-bottom:0;"
>
<span>{{ formData.apiKey }}</span>
<span class="copy-tip" @click="copyFun(formData.apiKey)"><i class="iconfont icon-fuzhi2"></i></span>
</a-form-model-item>
</a-col>
<a-col :span="24" v-if="formData.apiKey">
<a-form-model-item
label="是否禁用"
@ -190,8 +181,8 @@ import {
userList: [],
// formData: {},
rules: {
apiCode: [{ required: true, message: '请输入接口代码', trigger: 'change' }],
apiName: [{ required: true, message: '请输入接口名称', trigger: 'change' }]
apiName: [{ required: true, message: '请选择API接口', trigger: 'change' }],
tenantName: [{ required: true, message: '请选择租户', trigger: 'change' }]
},
apiInterface: []
}
@ -245,9 +236,10 @@ import {
})
}
},
getUserList(name = '', type) {
getUserList(name = '') {
GetSysUserPage({
name: name
name: name,
tenantId: this.formData.tenantId || ''
})
.then(res => {
if (res.success) {
@ -259,14 +251,14 @@ import {
})
},
//
saleSelect(value) {
userSelect(value) {
const index = this.userListArr.indexOf(value)
this.formData.userId = this.userList[index].id || ''
this.formData.userName = this.userList[index].name || ''
this.formData.userCode = this.userList[index].account || '' // ??
},
saleChange(value) {
this.getUserList(value, 'sale')
userChange(value) {
this.getUserList(value)
},
changeExpireDate (date, dateString) {
console.log(dateString)
@ -297,7 +289,7 @@ import {
},
apiHandleChange (value) {
console.log(value)
this.formData.apiCode = this.apiInterface[value].id
this.formData.apiCode = this.apiInterface[value].code
this.formData.apiName = this.apiInterface[value].name
}
}

Loading…
Cancel
Save