修改台账表单,单证备注操作备注, 详情收发通,船名,装货港,

szh_zidingyibiaoti
lilu 2 years ago
parent d95e89c661
commit 45fb91aa4b

@ -796,3 +796,4 @@ export function GetAllSelectData(parameter) {
params: parameter
})
}

@ -227,6 +227,7 @@
<div class="copy-box">
<selectView
class="copy-input"
ref="vesselView"
type="vessel"
:defaultVal="details.vessel"
searchApi="getVesselInfoService"
@ -638,7 +639,7 @@ import {
BookingOrderContactSavebatch,
BookingOrderContactPage,
DjyCustomerContacts,
getContractno
getContractno,
} from '@/api/modular/main/BookingLedger'
let timer
@ -1185,9 +1186,19 @@ export default {
} else {
this.details.item = []
}
// if (res.id) {
// DjyCustomerdetail({ id: res.id }).then(res => {
// console.log(res.id)
// this.details.sale = res.data.sale || ''
// this.details.saleid = res.data.saleid || ''
// })
// }
} else if (type === 'carrierid') {
this.details.carrier = res.enName || ''
this.details.carrierid = res.code || ''
setTimeout(() => {
this.$refs.vesselView.handleSearch('')
}, 600)
} else if (type === 'forwarder') {
this.details.forwarder = res.shortName || ''
this.details.forwarderid = res.codeName || ''
@ -1219,6 +1230,9 @@ export default {
if (type === 'etd') {
this.etdWeek = this.getWeek(value)
console.log(this.etdWeek)
setTimeout(() => {
this.$refs.vesselView.handleSearch('')
}, 600)
}
console.log('== 日期修改 ==', type, value, this.details[type])
},

@ -983,9 +983,9 @@ export default {
enmuType(val) {
switch (val) {
case 'shipper':
return 10
case 'consignee':
return 20
case 'consignee':
return 10
case 'notifyparty':
return 30
case 'notify':
@ -1434,8 +1434,13 @@ export default {
this.details.issueplace = res['enName'] || ''
this.details.issueplaceid = res['ediCode'] || ''
this.details.prepardat = this.details.prepardat ? this.details.prepardat : res['enName'] || ''
this.details.placereceiptid = this.details.placereceiptid ? this.details.placereceiptid : res['ediCode'] || ''
this.details.placereceipt = this.details.placereceipt ? this.details.placereceipt : res['enName'] || ''
} else if (type === 'portdischargeid') { //
this.details.payableat = this.details.payableat ? this.details.payableat : res['enName'] || ''
} else if (type === 'placereceiptid') {
this.details.portloadid = this.details.portloadid ? this.details.portloadid : res['ediCode'] || ''
this.details.portload = this.details.portload ? this.details.portload : res['enName'] || ''
}
// 线
console.log(`用户航线设置: ${this.userHasLine}, 卸货港航线设置: ${this.portdischargeHasline}, 目的港航线设置: ${this.destinationidHasline}`)

@ -0,0 +1,200 @@
<template>
<div class="auto-input-content">
<auto-complete
class="auto-input"
size="small"
:allowClear="true"
v-model="value"
optionLabelProp="label"
:dropdown-match-select-width="false"
:defaultActiveFirstOption="false"
:dropdown-style="dropdownStyle"
:backfill="false"
@select="handleSelect"
@change="debounce(handleChange, 0, $event)"
@focus="handleChangeFirst"
@blur="getSelectBlur"
>
<template slot="dataSource">
<a-select-option v-for="(item, index) in dataSourceList" :key="index" :value="index + '-' + item[showLabel[0]]" :label="item[showLabel[0]]">
<div class="contractno-label" v-if="type === 'contractno'">
<div class="title"> {{ item.contractNo }} / {{ item.contractName || '--' }} </div>
<div class="note"><span>{{ item.contractNote || '--' }}</span></div>
</div>
<div class="title" v-else>
<template v-for="(label, lindex) in showLabel">
{{ item[label] }}
<template v-if="lindex != showLabel.length - 1"> / </template>
</template>
</div>
</a-select-option>
</template>
</auto-complete>
</div>
</template>
<script>
import {
getContractno
} from '@/api/modular/main/BookingLedger'
import { AutoComplete } from 'ant-design-vue'
import { mapGetters } from 'vuex'
let timer
export default {
name: '',
components: {
AutoComplete
},
props: {
defaultVal: {
type: String,
default: ''
},
type: {
type: String,
default: ''
},
dropdownStyle: {
type: Object,
default: () => {
return {}
}
},
searchApi: {
type: String,
default: ''
},
searchQuery: {
type: Object,
default: () => {
return {}
}
},
//
showLabel: {
type: Array,
default: () => {
return []
}
}
},
data() {
return {
value: this.defaultVal || '',
dataSourceList: [],
inEdit: false
}
},
computed: {
...mapGetters(['bookingInitData'])
},
watch: {
defaultVal(nval, oval) {
if (this.inEdit) { return false }
this.value = nval
}
},
mounted() {
this.value = this.defaultVal
},
methods: {
debounce(func, wait, ...args) {
if (timer) clearTimeout(timer)
timer = setTimeout(() => {
func.apply(this, args)
}, wait)
},
getFromSelectData(func, ...args) {
return new Promise((resolve, reject) => {
func(...args).then((res) => {
if (res.code === 200) {
resolve(res.data);
} else {
reject(res)
}
})
});
},
emnuCompleteApi (type) {
switch (type) {
case 'getContractno':
return getContractno
}
},
handleSelect (e) {
const num = Number(e.split('-')[0])
const data = this.dataSourceList[num]
this.value = data[this.showLabel[0]]
this.$emit('select', {
type: this.type,
res: data
})
setTimeout(() => {
this.handleChange(this.value)
}, 600)
},
handleChange (e) {
this.inEdit = true
setTimeout(() => {
this.inEdit = false
}, 800)
if (e) {
Object.keys(this.searchQuery).map((item, index) => {
if (['queryItem'].includes(item)) {
this.searchQuery[item] = e
}
})
} else {
Object.keys(this.searchQuery).map((item, index) => {
if (['queryItem'].includes(item)) {
this.searchQuery[item] = ''
}
})
}
this.getFromSelectData(this.emnuCompleteApi(this.searchApi), this.searchQuery).then((data) => {
if (data.rows) {
this.dataSourceList = data.rows
} else {
this.dataSourceList = data
}
})
},
handleChangeFirst (e) {
if (this.value && this.dataSourceList.length !== 0) {
return false
}
if (this.bookingInitData[`${this.type}InitList`].length > 0) {
this.dataSourceList = this.bookingInitData[`${this.type}InitList`]
return false
}
this.handleChange(e)
},
getSelectBlur (e) {
if (this.type === 'contractno') {
this.$emit('select', {
type: this.type,
res: {
contractNo: this.value
}
})
}
}
}
}
</script>
<style lang="less">
.contractno-label{
.title{
height: 28px;
line-height: 28px;
font-size: 14px;
font-weight:600;
color: #666;
}
.note{
height: 22px;
line-height: 22px;
font-size: 12px;
color: #999;
}
}
</style>

@ -0,0 +1,86 @@
<template>
<div class="date-content">
<a-date-picker
size="small"
ref="dateInput"
style="min-width:100px"
:class="`date-picker-${type}`"
:format="format"
v-model="value"
:open="open"
:show-time="showTime"
@change="changeDate"
@openChange="handleOpenChange"
@focus="onFocus">
<a-icon slot="suffixIcon" type="time" style="display: none" />
</a-date-picker>
</div>
</template>
<script>
export default {
name: '',
props: {
parentVal: {
type: [String, Number],
default: ''
},
type: {
type: String,
default: ''
},
format: {
type: String,
default: 'YYYY-MM-DD'
},
showTime: {
type: Boolean,
default: false
}
},
data() {
return {
value: this.parentVal !== 0 && !this.parentVal ? '' : this.parentVal,
open: false,
over: false
}
},
watch: {
parentVal(nval, oval) {
this.value = nval
}
},
mounted() {
},
methods: {
changeDate (date, dateString) {
if (!dateString) {
this.value = null
} else {
this.value = dateString
}
this.$emit('dateChange', {
type: this.type,
value: this.value
})
},
handleOpenChange (open) {
this.open = open;
if (!this.open) {
this.over = true
this.$refs.dateInput.$refs.picker.$refs.input.focus()
setTimeout(() => {
this.over = false
}, 1200)
}
},
onFocus () {
if (!this.open && !this.over) {
this.open = true
}
}
}
}
</script>
<style lang="less" scoped>
</style>

@ -0,0 +1,114 @@
<template>
<div class="input-content">
<input
class="ant-input input-box"
:class="`input-${type}`"
size="small"
:type="inputType"
v-model="value"
:disabled="ishd"
:placeholder="placeholder"
@blur="inputBlur"
@change="inputChange"
/>
<a-icon type="close-circle" theme="filled" class="ant-input-suffix input-icon" @click="clearInput" v-if="value"/>
</div>
</template>
<script>
export default {
name: '',
props: {
parentVal: {
type: [String, Number],
default: ''
},
type: {
type: String,
default: ''
},
ishd: {
type: Boolean,
default: false
},
inputType: {
type: String,
default: 'text'
},
placeholder: {
type: String,
default: ''
}
},
data() {
return {
// value: this.parentVal || '',
value: this.parentVal !== 0 && !this.parentVal ? '' : this.parentVal
}
},
watch: {
parentVal(nval, oval) {
this.value = nval
},
},
mounted() {
},
methods: {
inputBlur() {
this.$emit('getInputChange', {
type: this.type,
value: this.value
})
},
inputChange(e) {
if (e.type === 'click' && !this.value) {
this.$emit('getInputChange', {
type: this.type,
value: this.value
})
}
},
clearInput () {
this.value = ''
this.$emit('getInputChange', {
type: this.type,
value: this.value
})
}
}
}
</script>
<style lang="less" scoped>
.input-content{
position: relative;
overflow: hidden;
width: 100%;
height: 100%;
.input-box {
width: 100%;
height: 24px;
line-height: 24px;
}
.input-icon{
position: absolute;
top: 50%;
z-index: 2;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
color: rgba(0, 0, 0, 0.25);
line-height: 0;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
opacity: 0;
right: 10px;
}
&:hover{
.input-icon{
opacity: 1;
}
}
}
</style>

@ -0,0 +1,598 @@
<template>
<div class="select-content">
<div class="select-input">
<a-select
size="small"
ref="selectView"
:class="`select-input-${type}`"
v-model="value"
show-search
:allowClear="true"
:filter-option="!this.openSearch ? filterOption : false"
:dropdownMatchSelectWidth="false"
:showArrow="!this.openSearch ? true : true"
:open="open"
optionLabelProp="label"
:notFoundContent="inLoading ? '加载中...' : '暂无数据'"
@focus="getSelectFirst"
@blur="getSelectBlur"
@select="selectOption"
@change="(value,option)=> debounce(this.handleChange, 200, option)"
@search="debounce(handleSearch, 300, $event)"
>
<!-- v-clickDown="{ clickFun: () => {} , dblclickFun: this.dblclickFun }" -->
<a-select-option v-for="(item, index) in selectList" :key="index" :value="item[showLabel[0]] + index" :label="item[showLabel[0]]">
<template v-if="type === 'contractno'">
<div class="contractno-label">
<div class="title"> {{ item.contractNo }} / {{ item.contractName || '--' }} </div>
<div class="note"><span>{{ item.contractNote || '--' }}</span></div>
</div>
</template>
<template v-if="type === 'vessel'">
<div class="vessel-label">
<div class="title"> {{ item.vessel }} </div>
<div class="voyno">航次 <span>{{ item.voyno || '--' }}</span></div>
<div class="etd">ETD: <span>{{ item.etd || '--' }}</span></div>
</div>
</template>
<template v-else>
<template v-for="(label, lindex) in showLabel">
{{ item[label] }}
<template v-if="lindex != showLabel.length - 1"> / </template>
</template>
</template>
</a-select-option>
</a-select>
<div v-show="!open" class="select_overlap" @mouseup="openSelect"></div>
</div>
<div class="copy-btn iconfont icon-fuzhi11" @click="dblclickFun"></div>
<!-- <div
v-show="!open"
class="select_overlap"
v-clickDown="{ clickFun: this.openSelect, dblclickFun: this.dblclickFun }"
>
</div> -->
</div>
</template>
<script>
import Vue from 'vue'
import {
GetPortloadlist,
GetPortlist,
BookingTemplate,
DjyCustomerpage,
DjyCustomerSuggest,
getContractno,
getVesselInfoService,
GetForwarderlist,
GetSysUserPage,
GetService,
getGoodsname
} from '@/api/modular/main/BookingLedger'
import { mapGetters, mapActions } from 'vuex'
let timer
Vue.directive('clickDown', {
inserted(el, binding, vnode) {
let clickTimer = null
//
el.addEventListener('click', () => {
if (clickTimer) {
window.clearTimeout(clickTimer);
clickTimer = null;
}
clickTimer = setTimeout(() => {
binding.value.clickFun()
}, 300);
})
//
el.addEventListener('dblclick', () => {
if (clickTimer) {
window.clearTimeout(clickTimer);
clickTimer = null;
}
binding.value.dblclickFun()
})
}
});
export default {
name: '',
props: {
defaultVal: {
type: String,
default: ''
},
type: {
type: String,
default: ''
},
searchApi: {
type: String,
default: ''
},
searchQuery: {
type: Object,
default: () => {
return {}
}
},
openSearch: {
type: Boolean,
default: false
},
showLabel: {
type: Array,
default: () => {
return []
}
}
},
data() {
return {
value: this.defaultVal || '',
selectList: [],
inEdit: false,
inLoading: false,
init: false,
open: false,
clickHandle: null,
inInit: false
}
},
computed: {
...mapGetters(['carrierList', 'yardList', 'packageList', 'issuetypeList', 'blfrtList', 'lineList', 'bookingInitData'])
},
watch: {
defaultVal(nval, oval) {
if (this.inEdit) { return false }
this.value = nval
},
value (nval, oval) {
if (nval !== oval) {
this.handleValueChange(nval)
}
}
},
created() {
this.inInit = true
setTimeout(() => {
this.inInit = false
}, 800)
},
mounted() {
this.clickHandle = (e) => {
if (e.target && 'className' in e.target && this.open) {
const className = e.target.className;
if (className.indexOf('select_overlap') === -1) {
this.open = false
}
} else {
this.open = false
}
}
document.body.addEventListener('click', this.clickHandle)
},
beforeDestroy() {
if (this.clickHandle) {
document.body.removeEventListener('click', this.clickHandle)
this.clickHandle = null
}
},
methods: {
...mapActions(['setLineList']),
debounce(func, wait, ...args) {
if (timer) clearTimeout(timer)
timer = setTimeout(() => {
func.apply(this, args)
}, wait)
},
getFromSelectData(func, ...args) {
return new Promise((resolve, reject) => {
func(...args).then((res) => {
if (res.code === 200) {
resolve(res.data);
} else {
reject(res)
}
})
});
},
emnuSelectApi (type) {
switch (type) {
case 'GetPortloadlist':
return GetPortloadlist
case 'GetPortlist':
return GetPortlist
case 'BookingTemplate':
return BookingTemplate
case 'DjyCustomerpage':
return DjyCustomerpage
case 'DjyCustomerSuggest':
return DjyCustomerSuggest
case 'getContractno':
return getContractno
case 'getVesselInfoService':
//
return getVesselInfoService
case 'GetForwarderlist':
return GetForwarderlist
case 'GetSysUserPage':
return GetSysUserPage
case 'GetService':
return GetService
case 'getGoodsname':
return getGoodsname
}
},
emnuData (type) {
switch (type) {
case 'cargoid':
return [
{
name: 'S 普通货',
code: 'S'
},
{
name: 'R 冻柜',
code: 'R'
},
{
name: 'D 危险品',
code: 'D'
},
{
name: 'O 超限箱',
code: 'O'
}
]
case 'nobill':
return [
{
name: 'ONE',
code: 'ONE'
},
{
name: 'TWO',
code: 'TWO'
},
{
name: 'THREE',
code: 'THREE'
},
{
name: 'FOUR',
code: 'FOUR'
},
{
name: 'FIVE',
code: 'FIVE'
},
{
name: 'SIX',
code: 'SIX'
},
{
name: 'SEVEN',
code: 'SEVEN'
},
{
name: 'EIGHT',
code: 'EIGHT'
},
{
name: 'NINE',
code: 'NINE'
},
{
name: 'TEN',
code: 'TEN'
}
]
case 'copynobill':
return [
{
name: 'ONE',
code: 'ONE'
},
{
name: 'TWO',
code: 'TWO'
},
{
name: 'THREE',
code: 'THREE'
},
{
name: 'FOUR',
code: 'FOUR'
},
{
name: 'FIVE',
code: 'FIVE'
},
{
name: 'SIX',
code: 'SIX'
},
{
name: 'SEVEN',
code: 'SEVEN'
},
{
name: 'EIGHT',
code: 'EIGHT'
},
{
name: 'NINE',
code: 'NINE'
},
{
name: 'TEN',
code: 'TEN'
}
]
case 'masterBolIndicator':
return [
{ ID: '1', NAME: 'Carrier filing HBL | 船公司发HBL' },
{ ID: '2', NAME: 'Self filing HBL | 自己发' },
{ ID: '3', NAME: 'Not Applicable/Straight bl | 无HBL' }
]
case 'salerCode':
return [
{ ID: 'CN087', NAME: 'CN087 | GRACE SUN' },
{ ID: 'CN096', NAME: 'CN096 | LEON LIANG' },
{ ID: 'CN097', NAME: 'CN097 | CHARLES GAO' },
{ ID: 'CN098', NAME: 'CN098 | TERESA LIU SHAN' },
{ ID: 'CN106', NAME: 'CN106 | HOKI YU' },
{ ID: 'CN107', NAME: 'CN107 | WILLIAM YANG JING YU' },
{ ID: 'CN099', NAME: 'CN099 | HELEN ZHANG' },
{ ID: 'CN100', NAME: 'CN100 | LEOREN' }
]
case 'yard':
return this.yardList
case 'kindpkgs':
return this.packageList
case 'carrierid':
return this.carrierList
case 'issuetype':
return this.issuetypeList
case 'blfrt':
return this.blfrtList
case 'lineName':
return this.lineList
case 'shippingMethod':
const arr = this.$options.filters['dictData']('ShippingMethod') || []
return arr
}
},
filterOption(input, option) {
if (this.openSearch) { //
return true
} else {
return option.componentOptions.children[1].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
},
handleValueChange(val) {
if (this.inInit) { return false }
this.inEdit = true
setTimeout(() => {
this.inEdit = false
}, 300)
this.selectList.map((item, index) => {
if (`${item[this.showLabel[0]]}${index}` === val) {
this.value = item[this.showLabel[0]]
this.$emit('change', {
type: this.type,
res: this.selectList[index]
})
}
})
},
handleChange (op) {
// this.selectOpen = !this.selectOpen
this.inEdit = true
setTimeout(() => {
this.inEdit = false
}, 800)
if (!op) {
this.$emit('change', {
type: this.type,
res: {}
})
} else {
const num = op.data.key
this.value = this.selectList[num][this.showLabel[0]]
this.$emit('change', {
type: this.type,
res: this.selectList[num]
})
}
},
getSelectFirst (e, canClick = true) {
// console.log('', e, this.value)
if (canClick) {
this.$refs.selectView.$refs.vcSelect.$refs.arrow.click()
} else {
this.$refs.selectView.$refs.vcSelect.focus()
}
this.open = true
if (['cargoid', 'nobill', 'copynobill', 'carrierid', 'yard', 'kindpkgs', 'issuetype', 'blfrt', 'masterBolIndicator', 'salerCode', 'shippingMethod'].includes(this.type)) {
this.selectList = this.emnuData(this.type)
this.inLoading = false
return false
}
// 线lineName,
if (['lineName'].includes(this.type)) {
this.selectList = this.emnuData(this.type)
this.inLoading = false
this.setLineList()
return false
}
if (!e) {
console.log('首次搜索内容', e, this.type, this.bookingInitData)
if (!['vessel', 'lineName'].includes(this.type) && this.bookingInitData[`${this.type}InitList`].length > 0) {
console.log(this.bookingInitData[`${this.type}InitList`])
this.selectList = this.bookingInitData[`${this.type}InitList`]
return false
}
// -
if (this.openSearch && this.value && this.selectList.length > 0) {
return false
} else if (this.openSearch && this.value && this.selectList.length === 0) {
// - -
// Object.keys(this.searchQuery).map((item, index) => {
// if (['Title', 'KeyWord', 'SearchValue', 'name', 'keyword'].includes(item)) {
// this.searchQuery[item] = this.value
// }
// })
}
this.inLoading = true
this.getFromSelectData(this.emnuSelectApi(this.searchApi), this.searchQuery).then((data) => {
if (data.rows) {
this.selectList = data.rows
} else {
this.selectList = data
}
this.inLoading = false
})
}
},
handleSearch (e) {
if (this.openSearch) {
this.inEdit = true
setTimeout(() => {
this.inEdit = false
}, 800)
if (e) {
/* *
* 字段值
* Title 收发通模板
* KeyWord 港口信息
* SearchValue 报关行仓库车队 国外代理
* name 包装
* */
Object.keys(this.searchQuery).map((item, index) => {
if (['Title', 'KeyWord', 'SearchValue', 'name', 'keyword', 'queryItem'].includes(item)) {
this.searchQuery[item] = e
}
})
} else {
Object.keys(this.searchQuery).map((item, index) => {
if (['Title', 'KeyWord', 'SearchValue', 'name', 'keyword', 'queryItem'].includes(item)) {
this.searchQuery[item] = ''
}
})
}
this.getFromSelectData(this.emnuSelectApi(this.searchApi), this.searchQuery).then((data) => {
if (data.rows) {
this.selectList = data.rows
} else {
this.selectList = data
}
})
}
},
openSelect(open) {
console.log('== 测试鼠标滑过 ==')
if (!this.open) {
this.getSelectFirst('', false)
} else {
this.open = !this.open
}
},
selectOption() {
this.open = false
},
getSelectBlur (e) {
this.open = false
},
dblclickFun () {
if (!this.value) {
this.$message.error('暂无可复制内容')
return false
}
this.copy(this.value)
},
copy(textValue) {
const textarea = document.createElement('textarea')
textarea.readOnly = 'readonly'
textarea.style.position = 'absolute'
textarea.style.left = '-9999px'
textarea.value = textValue
document.body.appendChild(textarea)
textarea.select()
const result = document.execCommand('Copy')
if (result) {
this.$message.success('复制成功')
}
document.body.removeChild(textarea)
}
}
}
</script>
<style lang="less" scoped>
.contractno-label{
.title{
height: 28px;
line-height: 28px;
font-size: 14px;
font-weight:600;
color: #666;
}
.note{
height: 22px;
line-height: 22px;
font-size: 12px;
color: #999;
}
}
.vessel-label{
.title{
height: 28px;
line-height: 28px;
font-size: 14px;
font-weight:600;
color: #666;
border-bottom:1px dashed #ddd;
margin-bottom: 4px;
}
.voyno, .etd {
height: 22px;
line-height: 22px;
font-size: 12px;
color: #999;
}
}
.select-content {
display: flex;
.select-input{
flex: 1;
position: relative;
overflow: hidden;
.select_overlap {
cursor: pointer;
height: 32px;
width: 100%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
opacity: 0;
}
}
.copy-btn{
width: 24px;
text-align: center;
color: #bbb;
font-size: 13px;
&:hover{
color: @primary-color;
}
}
}
</style>

@ -0,0 +1,111 @@
<template>
<textarea
class="ant-input"
v-model="value"
:style="`width:100%;display:inline-block;height: ${height}px`"
@input="debounce(textareaChange, 300, $event)"
@blur="textareaBlur"
></textarea>
<!-- -->
</template>
<script>
let timer;
export default {
name: '',
props: {
parentVal: {
type: String,
default: ''
},
type: {
type: String,
default: ''
},
height: {
type: Number,
default: 120
},
openToCDB: {
type: Boolean,
default: false
}
},
data() {
return {
value: this.parentVal || '',
inEdit: false
}
},
watch: {
parentVal(nval, oval) {
if (this.inEdit) { return false }
this.value = nval
}
},
mounted() {},
methods: {
debounce (func, wait, ...args) {
if (timer) clearTimeout(timer);
timer = setTimeout(() => {
func.apply(this, args);
}, wait);
},
textareaBlur() {
if (this.openToCDB) {
this.value = this.ToCDB(this.value).toUpperCase()
this.$emit('getTextareaChange', {
type: this.type,
value: this.value
})
}
},
textareaChange(e) {
this.inEdit = true
setTimeout(() => {
this.inEdit = false
}, 800)
this.$emit('getTextareaChange', {
type: this.type,
value: this.value
})
},
ToCDB(str) {
var tmp = '';
for (var i = 0; i < str.length; i++) {
if (str.charCodeAt(i) > 65248 && str.charCodeAt(i) < 65375) {
tmp += String.fromCharCode(str.charCodeAt(i) - 65248);
} else {
tmp += String.fromCharCode(str.charCodeAt(i));
}
}
tmp = tmp.replace(//ig, ',')
tmp = tmp.replace(/。/ig, '.')
tmp = tmp.replace(//ig, ';')
tmp = tmp.replace(//ig, ':')
tmp = tmp.replace(//ig, '?')
tmp = tmp.replace(//ig, '!')
tmp = tmp.replace(/《/ig, '<<')
tmp = tmp.replace(/》/ig, '>>')
tmp = tmp.replace(//ig, "'")
tmp = tmp.replace(//ig, "'")
tmp = tmp.replace(/、/ig, ',')
// tab
tmp = tmp.replace(/\t/ig, ' ')
//
if (/[\u4E00-\u9FA5]+/g.test(tmp) && ['description', 'marks'].includes(this.type)) {
tmp = tmp.replace(/[\u4E00-\u9FA5]+/g, '')
this.$message.error(`${this.getTypeName(this.type)}中,不支持中文字符`)
}
return tmp
},
getTypeName (type) {
switch (type) {
case 'marks':
return '封志号 / 标记与号码'
case 'description':
return '包装种类与货名'
}
}
}
}
</script>

@ -111,11 +111,13 @@
v-bind="gridOptions"
row-class-name="line-box"
:height="tableHeight"
:scroll-y="{enabled: true}"
@page-change="handlePageChange"
@cell-dblclick="handledbclick"
@resizable-change="resizableChange"
@sort-change="tableSortChange"
@scroll="pageClick"
@checkbox-change="checkboxChangeEvent"
>
<template #mblno="{ row }">
<div class="mblno">
@ -896,6 +898,7 @@ export default {
// break
}
})
console.log('==获取数据,表单 ==', $data.booking_list_cond)
if (Object.keys($data).includes('booking_list_cond')) {
this.setFormData($data.booking_list_cond, false, true)
} else {
@ -1760,9 +1763,12 @@ export default {
cancelRemove () {
console.log('== 取消 ==')
},
pageClick () {
pageClick (e) {
this.goodStatusShow = false
this.goodStatusData = null
},
checkboxChangeEvent () {
console.log('== 选中,取消选中 ==', this.$refs.xGrid.getCheckboxRecords())
}
}
}
@ -2163,7 +2169,7 @@ export default {
.active {
cursor: pointer;
// color: @primary-color;
color: #13c2c2;
color: #15a4a4;
}
}
}
@ -2201,7 +2207,7 @@ export default {
.active {
cursor: pointer;
// color: @primary-color;
color: #13c2c2;
color: #15a4a4;
}
&:nth-of-type(3) {
i {

@ -1,14 +1,23 @@
<template>
<div class="from-label">
<template v-if="labelData.type == 'input'">
<a-input style="height:23px;margin-top:8px;" v-model="value" @change="changeInput" @pressEnter="$emit('pressEnter')"/>
<!-- <a-input style="height:23px;margin-top:8px;" v-model="value" @change="changeInput" @pressEnter="$emit('pressEnter')"/> -->
<inputView ref="inputView" :type="labelData.label" :parentVal="value" @getInputChange="inputChange" />
</template>
<template v-else-if="labelData.type == 'date'">
<a-date-picker format="YYYY-MM-DD" @change="changeDate" v-model="value"/>
<datePickerView
ref="datePickerView"
class="date-picker"
:parentVal="value"
type="etd"
format="YYYY-MM-DD"
@dateChange="dateChangeFun"
></datePickerView>
<!-- <a-date-picker format="YYYY-MM-DD" @change="changeDate" v-model="value"/> -->
</template>
<template v-else-if="labelData.type == 'dateRange'">
<!-- <a-range-picker style="overflow: hidden;margin-top:3px;" format="YYYY-MM-DD" @change="changeRangeDate" @calendarChange="openChangeRangeDate" v-model="dateVal"/> -->
<div class="picker-box" style="display:flex;">
<div class="picker-box" style="display:flex;padding-right: 2px;">
<a-date-picker
style="min-width:30px; flex: 1;"
v-model="startValue"
@ -86,10 +95,15 @@
</template>
<script>
import { AutoComplete } from 'ant-design-vue'
import inputView from '../components/inputView'
import datePickerView from '../components/datePickerView'
let timer;
export default {
components: {
AutoComplete
AutoComplete,
inputView,
datePickerView
},
props: {
labelData: {
@ -123,6 +137,11 @@ export default {
this.dateVal = []
this.startValue = ''
this.endValue = ''
if (this.labelData.type === 'input') {
this.$refs.inputView.$data.value = ''
} else if (this.labelData.type === 'date') {
this.$refs.datePickerView.$data.value = ''
}
}
},
startValue(val) {
@ -158,16 +177,16 @@ export default {
func.apply(this, args);
}, wait);
},
changeInput(e) {
changeInput(data) {
this.$emit('change', {
form: this.labelData,
value: e.target.value
value: data.value
})
},
changeDate(e, mode) {
changeDate(data) {
this.$emit('change', {
form: this.labelData,
value: mode
value: data.value
})
},
// start
@ -290,6 +309,15 @@ export default {
form: this.labelData,
value: value || ''
})
},
inputChange (data) {
console.log('== 表单输入 ==', data)
this.changeInput(data)
},
dateChangeFun (data) {
debugger
console.log('== 表单时间 ==', data)
this.changeDate(data)
}
}
}

@ -171,6 +171,8 @@ export default {
{ title: '箱号', align: 'center', width: 160, label: 'CNTRNO', type: 'input' },
{ title: '封号', align: 'center', width: 160, label: 'SEALNO', type: 'input' },
{ title: '创建人', align: 'center', width: 160, label: 'CreatedUserName', type: 'input' },
{ title: '单证备注', align: 'center', width: 160, label: 'DZREMARK', type: 'input' },
{ title: '操作备注', align: 'center', width: 160, label: 'CZREMARK', type: 'input' },
// 以下需要加模糊搜索
{ title: '到付地点', align: 'center', width: 160, label: 'PAYABLEAT', type: 'complete', showLabel: 'enName' },

Loading…
Cancel
Save