张同海 2 years ago
commit bb7845886c

@ -543,8 +543,11 @@
has-feedback has-feedback
prop="pkgs" prop="pkgs"
> >
<inputView type="pkgs" :parentVal="details.pkgs" inputType="number" @getInputChange="inputChange"/> <div class="line-box">
<!-- <a-input :allowClear="true" v-model="details.pkgs" type="number" @change="changePkgs"/> --> <inputView type="pkgs" :parentVal="details.pkgs" inputType="number" @getInputChange="inputChange"/>
<i class="iconfont icon-bianji1 edit-icon" @click="editTextEntryModel('pkgs')"></i>
<!-- <a-input :allowClear="true" v-model="details.pkgs" type="number" @change="changePkgs"/> -->
</div>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -581,6 +584,7 @@
<div class="line-box"> <div class="line-box">
<inputView type="kgs" :parentVal="details.kgs" @getInputChange="inputChange"/> <inputView type="kgs" :parentVal="details.kgs" @getInputChange="inputChange"/>
<!-- <a-input :allowClear="true" v-model="details.kgs" /> --> <!-- <a-input :allowClear="true" v-model="details.kgs" /> -->
<i class="iconfont icon-bianji1 edit-icon" @click="editTextEntryModel('kgs')"></i>
<span class="unit">KGS</span> <span class="unit">KGS</span>
</div> </div>
</a-form-model-item> </a-form-model-item>
@ -597,6 +601,7 @@
<div class="line-box"> <div class="line-box">
<inputView type="cbm" :parentVal="details.cbm" @getInputChange="inputChange"/> <inputView type="cbm" :parentVal="details.cbm" @getInputChange="inputChange"/>
<!-- <a-input :allowClear="true" v-model="details.cbm" /> --> <!-- <a-input :allowClear="true" v-model="details.cbm" /> -->
<i class="iconfont icon-bianji1 edit-icon" @click="editTextEntryModel('cbm')"></i>
<span class="unit">CBM</span> <span class="unit">CBM</span>
</div> </div>
</a-form-model-item> </a-form-model-item>
@ -677,6 +682,109 @@
</a-form> </a-form>
</template> </template>
</a-modal> </a-modal>
<!-- == 件重尺编辑模板 == -->
<a-modal width="500px" :maskClosable="false" v-model="textEntryModalVisible" :title="textEntryModalTitle">
<div class="text-entry-box">
<!-- 件数包装 -->
<a-form v-if="textEntryType === 'pkgs'">
<!-- <div class="tit">
<span>箱数或件数</span>
<span>No.of containers or pkgs</span>
</div> -->
<div class="text-input">
<a-textarea
v-model="details.pkgsTotal"
placeholder="请输入内容"
:auto-size="{ minRows: 6, maxRows: 9 }"
@change="pkgsTextChange"
/>
</div>
<!-- <div class="text-res">
<a-row :gutter="16">
<a-col :span="12">
<a-form-item
label="总件数"
:labelCol="{ xs: { span: 24 }, sm: { span: 6 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }"
has-feedback
>
<inputView type="pkgs" :parentVal="details.pkgs" inputType="number" @getInputChange="inputChange"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
label="件数包装"
:labelCol="{ xs: { span: 24 }, sm: { span: 6 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }"
has-feedback
>
<auto-complete
:allowClear="true"
v-model="details.kindpkgs"
class="customer-input"
:data-source="kindpkgsDataArr"
:dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }"
@select="kindpkgsSelect"
@change="kindpkgsChange"
@focus="kindpkgsChange"
/>
</a-form-item>
</a-col>
</a-row>
</div> -->
</a-form>
<!-- 毛重 -->
<a-form v-if="textEntryType === 'kgs'">
<!-- <div class="tit">
<span>毛重公斤</span>
<span>Gross Weight </span>
</div> -->
<div class="text-input">
<a-textarea
v-model="details.kgsTotal"
placeholder="请输入内容"
:auto-size="{ minRows: 6, maxRows: 9 }"
@change="kgsTextChange"
/>
</div>
<!-- <div class="text-res">
<div class="kgs-label">
<span class="left">总重量</span>
<inputView type="kgs" :parentVal="details.kgs" @getInputChange="inputChange"/>
<span class="unit">KGS</span>
</div>
</div> -->
</a-form>
<!-- 尺码 -->
<a-form v-if="textEntryType === 'cbm'">
<!-- <div class="tit">
<span>尺码(立方米)</span>
<span>Gross Weight </span>
</div> -->
<div class="text-input">
<a-textarea
v-model="details.cbmTotal"
placeholder="请输入内容"
:auto-size="{ minRows: 6, maxRows: 9 }"
@change="cbmTextChange"
/>
</div>
<!-- <div class="text-res">
<div class="kgs-label">
<span class="left">总重量</span>
<inputView type="cbm" :parentVal="details.cbm" @getInputChange="inputChange"/>
<span class="unit">CBM</span>
</div>
</div> -->
</a-form>
</div>
<template slot="footer">
<a-button type="primary" @click="textEntryClose"></a-button>
</template>
</a-modal>
<!-- == 件重尺编辑模板 == -->
</a-collapse-panel> </a-collapse-panel>
</a-collapse> </a-collapse>
</template> </template>
@ -767,7 +875,10 @@ export default {
customerModelconfirm: false, customerModelconfirm: false,
showShipper: '', showShipper: '',
showConsignee: '', showConsignee: '',
showNotifier: '' showNotifier: '',
textEntryModalVisible: false,
textEntryType: '',
textEntryModalTitle: ''
} }
}, },
watch: { watch: {
@ -1700,6 +1811,75 @@ export default {
this.changePkgs() this.changePkgs()
} }
this.$forceUpdate() this.$forceUpdate()
},
editTextEntryModel (type) {
this.textEntryModalVisible = true
if (type === 'pkgs') {
this.textEntryModalTitle = '件数/包装'
} else if (type === 'kgs') {
this.textEntryModalTitle = '毛重'
} else if (type === 'cbm') {
this.textEntryModalTitle = '尺码'
}
this.textEntryType = type
},
textEntryClose () {
this.textEntryModalVisible = false
this.textEntryModalTitle = ''
this.textEntryType = false
},
//
pkgsTextChange () {
const pkgsTexyVal = this.details.pkgsTotal
const arr = pkgsTexyVal.split(/\n|\r/g)
let pkgs = 0
let kindpkgs = ''
console.log('arr', arr)
arr.map((item, index) => {
const regexStr = item.match(/[a-zA-Z]+|[0-9]+(?:\.[0-9]+|)/g);
console.log('分割数组:', regexStr)
if (regexStr && Number(regexStr[0])) {
pkgs += Number(regexStr[0])
}
if (!kindpkgs && regexStr && /^[a-zA-Z]+$/.test(regexStr[1])) {
kindpkgs = regexStr[1]
}
})
console.log('包装:', kindpkgs, ' 、件数:', pkgs)
this.details.pkgs = pkgs
this.details.kindpkgs = kindpkgs
},
//
kgsTextChange () {
const kgsTexyVal = this.details.kgsTotal
const arr = kgsTexyVal.split(/\n|\r/g)
let kgs = 0
console.log('arr', arr)
arr.map((item, index) => {
const regexStr = item.match(/[a-zA-Z]+|[0-9]+(?:\.[0-9]+|)/g);
console.log('分割数组:', regexStr)
if (regexStr && Number(regexStr[0])) {
kgs += Number(regexStr[0])
}
})
console.log('总重量:', kgs)
this.details.kgs = kgs
},
//
cbmTextChange () {
const cbmTexyVal = this.details.cbmTotal
const arr = cbmTexyVal.split(/\n|\r/g)
let cbm = 0
console.log('arr', arr)
arr.map((item, index) => {
const regexStr = item.match(/[a-zA-Z]+|[0-9]+(?:\.[0-9]+|)/g);
console.log('分割数组:', regexStr)
if (regexStr && Number(regexStr[0])) {
cbm += Number(regexStr[0])
}
})
console.log('总重量:', cbm)
this.details.cbm = cbm
} }
} }
} }
@ -1918,6 +2098,7 @@ export default {
.line-box { .line-box {
display: flex; display: flex;
margin-top: 6px; margin-top: 6px;
overflow: hidden;
span.unit { span.unit {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
@ -1926,6 +2107,12 @@ export default {
line-height: 28px; line-height: 28px;
padding-left: 5px; padding-left: 5px;
} }
.edit-icon{
font-size: 14px;
line-height: 28px;
margin-left: 4px;
cursor: pointer;
}
} }
.required{ .required{
@ -2009,4 +2196,33 @@ export default {
right: 8px !important; right: 8px !important;
} }
.text-entry-box {
.tit{
height:40px;
line-height:40px;
font-size:14px;
color: #333;
margin-bottom: 6px;
}
.text-res {
margin-top: 20px;
.kgs-label{
display: flex;
.left{
line-height: 28px;
display: block;
width: 68px;
text-align: left;
}
.unit{
display: block;
width: 60px;
margin-left:10px;
text-align: left;
line-height: 28px;
}
}
}
}
</style> </style>

@ -113,7 +113,7 @@
<div class="child-log" v-for="(child, cindex) in bookingLog.detail" :key="cindex"> <div class="child-log" v-for="(child, cindex) in bookingLog.detail" :key="cindex">
<span class="log-time">{{ child.opTime }}</span> <span class="log-time">{{ child.opTime }}</span>
<i class="iconfont icon-yuanxuankuang2 icon"></i> <i class="iconfont icon-yuanxuankuang2 icon"></i>
<span class="log-name">{{ child.status }}</span> <span class="log-name">{{ child.status }} <span class="min-log" v-if="child.cntrno">:{{ child.cntrno }}</span> </span>
</div> </div>
</div> </div>
</div> </div>
@ -775,6 +775,11 @@ export default {
} }
.log-name { .log-name {
flex: 1; flex: 1;
.min-log{
font-size: 12px;
color: #999;
margin-left: 4px;
}
} }
} }
.child-log { .child-log {
@ -829,6 +834,15 @@ export default {
} }
.log-name { .log-name {
flex: 1; flex: 1;
display: flex;
.min-log{
font-size: 12px;
color: #999;
margin-left: 4px;
flex: 1;
text-overflow: ellipsis;
white-space: nowrap;
}
} }
} }
.hideline { .hideline {

@ -6,34 +6,26 @@
<div slot="content" class="table-page-search-wrapper"> <div slot="content" class="table-page-search-wrapper">
<a-form layout="inline" :form="form"> <a-form layout="inline" :form="form">
<a-row :gutter="48"> <a-row :gutter="48">
<a-col :md="6" :sm="24" :style="{ paddingRight: 0 }"> <a-col :md="5" :sm="24" :style="{ paddingRight: 0 }">
<a-form-item <a-form-item
label="接口代码" label="API接口"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
> >
<a-input <a-select
placeholder="请输入接口代码" style="width: 100%"
v-decorator="['ApiCode', { rules: [{ required: false, message: '请输入接口代码' }] }]" show-search
/> :filter-option="filterOption"
:dropdownMatchSelectWidth="false"
v-decorator="['ApiName']"
>
<a-select-option v-for="(api, aindex) in apiInterface" :key="api.name">
{{ api.name }} / {{ api.code }}
</a-select-option>
</a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24" :style="{ paddingRight: 0 }"> <a-col :md="4" :sm="24" :style="{ paddingRight: 0 }">
<a-form-item
label="接口名称"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
>
<a-input
placeholder="请输入接口名称"
v-decorator="[
'ApiName',
{ rules: [{ required: false, message: '请输入接口名称' }] },
]"
/>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24" :style="{ paddingRight: 0 }">
<a-form-item <a-form-item
label="租户名称" label="租户名称"
:labelCol="labelCol" :labelCol="labelCol"
@ -48,7 +40,7 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :md="4" :sm="24" :style="{ paddingRight: 0 }">
<a-form-item <a-form-item
label="用户姓名" label="用户姓名"
:labelCol="labelCol" :labelCol="labelCol"
@ -63,7 +55,7 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24" :style="{ paddingRight: 0 }"> <a-col :md="7" :sm="24" :style="{ paddingRight: 0 }">
<a-form-item <a-form-item
label="是否禁用" label="是否禁用"
:labelCol="labelCol" :labelCol="labelCol"
@ -82,7 +74,7 @@
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24" :labelCol="{ span: 2, offset: 12 }"> <a-col :md="4" :sm="24" :labelCol="{ span: 2, offset: 12 }">
<span class="table-page-search-submitButtons" style="text-align: right"> <span class="table-page-search-submitButtons" style="text-align: right">
<a-button type="primary" @click="tableRefresh"></a-button> <a-button type="primary" @click="tableRefresh"></a-button>
<a-button style="margin-left: 8px" @click="tableReset"></a-button> <a-button style="margin-left: 8px" @click="tableReset"></a-button>
@ -122,7 +114,7 @@
<vxe-button type="text" class="disable-btn active" @click="removeColumns(row)"></vxe-button> <vxe-button type="text" class="disable-btn active" @click="removeColumns(row)"></vxe-button>
<span v-if="row.isDisable" class="disable-btn" @click="setDisableFun(row)"></span> <span v-if="row.isDisable" class="disable-btn" @click="setDisableFun(row)"></span>
<span v-else class="disable-btn active" @click="setDisableFun(row)"></span> <span v-else class="disable-btn active" @click="setDisableFun(row)"></span>
<a-popconfirm title="确认删除" ok-text="" cancel-text="" @confirm="secretResetFun(row)" @cancel="cancel"> <a-popconfirm title="确认重置秘钥" ok-text="" cancel-text="" @confirm="secretResetFun(row)" @cancel="cancel">
<vxe-button class="disable-btn active" type="text">重置秘钥</vxe-button> <vxe-button class="disable-btn active" type="text">重置秘钥</vxe-button>
</a-popconfirm> </a-popconfirm>
</template> </template>
@ -131,7 +123,7 @@
</x-card> </x-card>
</a-col> </a-col>
</a-row> </a-row>
<add-form ref="addForm" :formData="addFormData" :type="addFormType" @ok="handleOk" /> <add-form ref="addForm" :formData="addFormData" :type="addFormType" :index="addFromIndex" @ok="handleOk" />
</div> </div>
</template> </template>
<script> <script>
@ -191,11 +183,15 @@ export default {
data: [], data: [],
}, },
addFormData: {}, addFormData: {},
addFormType: 'add' addFormType: 'add',
addFromIndex: null,
apiInterface: [],
} }
}, },
created() { created() {
this.getList() this.getList()
this.apiInterface = this.$options.filters['dictData']('api_interface')
console.log('apiInterface', this.apiInterface)
}, },
mounted() {}, mounted() {},
methods: { methods: {
@ -256,6 +252,7 @@ export default {
editColumns(data) { editColumns(data) {
this.addFormType = 'edit' this.addFormType = 'edit'
this.addFormId = data.id this.addFormId = data.id
this.addFromIndex = data.row_id
GetApiDetail({ GetApiDetail({
id: this.addFormId, id: this.addFormId,
}).then((res) => { }).then((res) => {
@ -367,6 +364,7 @@ export default {
tableHeaderEdit() {}, tableHeaderEdit() {},
setDisableFun(data) { setDisableFun(data) {
console.log('是否禁用: ', data.id, data.isDisable, data) console.log('是否禁用: ', data.id, data.isDisable, data)
debugger
DisableApi({ DisableApi({
id: data.id, id: data.id,
disable: !data.isDisable disable: !data.isDisable
@ -401,7 +399,10 @@ export default {
console.log(err) console.log(err)
}) })
}, },
cancel() {} cancel() {},
filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
} }
} }
</script> </script>

@ -15,24 +15,24 @@
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-model-item <a-form-model-item
label="接口代码" label="API接口"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
prop="apiCode"
>
<a-input placeholder="请输入接口代码" v-model="formData.apiCode" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item
label="接口名称"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
prop="apiName" prop="apiName"
> >
<a-input placeholder="请输入接口名称" v-model="formData.apiName" /> <a-select
style="width: 100%"
v-model="formData.apiName"
@change="apiHandleChange"
show-search
:filter-option="filterOption"
:dropdownMatchSelectWidth="false"
>
<a-select-option v-for="(api, aindex) in apiInterface" :key="aindex">
{{ api.name }} / {{ api.code }}
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -58,7 +58,7 @@
placeholder="请选择租户" placeholder="请选择租户"
:default-active-first-option="false" :default-active-first-option="false"
:show-arrow="false" :show-arrow="false"
:filter-option="false" :filter-option="filterOption"
:not-found-content="null" :not-found-content="null"
@select="tenantSelect" @select="tenantSelect"
> >
@ -106,7 +106,8 @@
has-feedback has-feedback
style="margin-bottom:0;" style="margin-bottom:0;"
> >
{{ formData.apiSecret }} <span>{{ formData.apiSecret }}</span>
<span class="copy-tip" @click="copyFun(formData.apiSecret)"><i class="iconfont icon-fuzhi2"></i></span>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24" v-if="formData.apiKey"> <a-col :span="24" v-if="formData.apiKey">
@ -117,7 +118,8 @@
has-feedback has-feedback
style="margin-bottom:0;" style="margin-bottom:0;"
> >
{{ formData.apiKey }} <span>{{ formData.apiKey }}</span>
<span class="copy-tip" @click="copyFun(formData.apiKey)"><i class="iconfont icon-fuzhi2"></i></span>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24" v-if="formData.apiKey"> <a-col :span="24" v-if="formData.apiKey">
@ -156,6 +158,10 @@ import {
formData: { formData: {
type: Object, type: Object,
default: null default: null
},
index: {
type: Number,
default: null
} }
}, },
data () { data () {
@ -186,7 +192,8 @@ import {
rules: { rules: {
apiCode: [{ required: true, message: '请输入接口代码!', trigger: 'change' }], apiCode: [{ required: true, message: '请输入接口代码!', trigger: 'change' }],
apiName: [{ required: true, message: '请输入接口名称!', trigger: 'change' }] apiName: [{ required: true, message: '请输入接口名称!', trigger: 'change' }]
} },
apiInterface: []
} }
}, },
computed: { computed: {
@ -205,6 +212,8 @@ import {
} }
}, },
mounted () { mounted () {
this.apiInterface = this.$options.filters['dictData']('api_interface')
console.log('apiInterface', this.apiInterface)
SysTenantPage({ pageNo: 1, pageSize: 9999, name: '' }).then(res => { SysTenantPage({ pageNo: 1, pageSize: 9999, name: '' }).then(res => {
this.TenantData = res.data.rows this.TenantData = res.data.rows
}) })
@ -226,6 +235,7 @@ import {
}, },
handleCancel () { handleCancel () {
this.$refs.addFrom.clearValidate() this.$refs.addFrom.clearValidate()
this.$parent.$data.addFromIndex = null
this.visible = false this.visible = false
}, },
tenantIdSearch(value) { tenantIdSearch(value) {
@ -267,9 +277,28 @@ import {
this.formData.tenantName = this.TenantData[value].name || '' this.formData.tenantName = this.TenantData[value].name || ''
}, },
setDisableFun () { setDisableFun () {
debugger this.$parent.setDisableFun({
this.$parent.setDisableFun(this.formData) ...this.formData,
// this.$parent.init() ...{ row_id: this.index },
...{ isDisable: !this.formData.isDisable }
})
},
copyFun(data) {
const copyInput = document.createElement('input')
document.body.appendChild(copyInput)
copyInput.setAttribute('value', data)
copyInput.select()
document.execCommand('Copy', false, null)
this.$message.success('复制成功')
copyInput.remove()
},
filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
apiHandleChange (value) {
console.log(value)
this.formData.apiCode = this.apiInterface[value].id
this.formData.apiName = this.apiInterface[value].name
} }
} }
} }
@ -293,4 +322,8 @@ import {
margin-left: 10px; margin-left: 10px;
font-size: 12px; font-size: 12px;
} }
.copy-tip{
margin-left: 10px;
color: @primary-color;
}
</style> </style>

Loading…
Cancel
Save