快递模块 更改

master
张同海 1 year ago
parent 8f6c700753
commit 563f1f4956

@ -37,7 +37,7 @@ export default {
const item = this.pages.find(item => item.path === key)
item.meta.customTitle = name
this.$forceUpdate()
} catch (e) { }
} catch (e) {}
})
this.pages.push(this.$route)
this.fullPathList.push(this.$route.fullPath)
@ -48,7 +48,11 @@ export default {
onEdit(targetKey, action) {
const _that = this
if (targetKey.includes('BookingDetail')) {
console.log(Object.keys(this.needSavePages).includes(targetKey), this.needSavePages[targetKey].details, this.needSavePages[targetKey].hbList)
console.log(
Object.keys(this.needSavePages).includes(targetKey),
this.needSavePages[targetKey].details,
this.needSavePages[targetKey].hbList
)
if (
Object.keys(this.needSavePages).includes(targetKey) &&
(this.needSavePages[targetKey].details || this.needSavePages[targetKey].hbList)
@ -70,9 +74,9 @@ export default {
} else {
if (!this.inBookingDetailsSave) {
this[action](targetKey)
const $data = this.needSavePages
delete $data[targetKey]
this.setNeedSavePages($data)
const $data = this.needSavePages
delete $data[targetKey]
this.setNeedSavePages($data)
}
}
} else {
@ -187,7 +191,7 @@ export default {
}
},
watch: {
$route: function (newVal) {
$route: function(newVal) {
if (!newVal.query.noOpenTab) {
this.activeKey = newVal.fullPath
if (this.fullPathList.indexOf(newVal.fullPath) < 0) {
@ -220,7 +224,7 @@ export default {
return item.fullPath
})
},
'copyPages': {
copyPages: {
immediate: true,
deep: true,
handler(nD, oD) {
@ -243,7 +247,7 @@ export default {
}
}
},
activeKey: function (newPathKey) {
activeKey: function(newPathKey) {
this.$router.push({ path: newPathKey })
},
pages(newForm, oldForm) {

@ -70,7 +70,7 @@
</div>
<div class="btn-list single-view-4">
<button @click="FnGoSendCar"><span class="iconfont icon-yunshu1"></span>派车</button>
<button @click="FnGoExpress"><span class="iconfont icon-goods"></span>快递</button>
<!-- <button @click="FnGoExpress"><span class="iconfont icon-goods"></span>快递</button> -->
</div>
<div class="btn-list single-view-1" :class="{ inLoad: inChildLoading || !changeFlag }">
<button @click="changePage('prev')"><span class="iconfont icon-shang"></span>上一票</button>

@ -130,7 +130,7 @@
</a-menu>
</a-dropdown>
</div>
<div class="nav" @click="GoExpress"><i class="iconfont icon-goods"></i>快递</div>
<!-- <div class="nav" @click="GoExpress"><i class="iconfont icon-goods"></i>快递</div> -->
</div>
</template>
<template #tools>

@ -64,7 +64,7 @@
<!-- <a-input v-decorator="['kdCompany']" allowClear /> -->
</a-form-item>
</a-col>
<a-col :span="5">
<a-col :span="9">
<a-form-item
label="快递状态:"
:labelCol="{ xs: { span: 25 }, sm: { span: 6 } }"
@ -848,7 +848,6 @@ import {
commondbCodeCityList
} from '@/api/modular/main/ExpressModule'
import { ExpressDeliveryGetAddressList } from '@/api/modular/main/ExpressTemplate'
import { GetPortloadlist, GetCarrierlist, GetPortlist } from '@/api/modular/main/BookingLedger'
import { PageDataByBooking } from '@/api/modular/main/BookingLedger'
import { MonthlyPayAccountList } from '@/api/modular/main/ExpressMonthlyPay'
import AAutoComplete from 'ant-design-vue/es/auto-complete'
@ -1012,9 +1011,6 @@ export default {
ProvinceData: [],
sjCityData: [],
fjCityData: [],
CarrierData: [],
PortloadData: [],
PortData: [],
VesselData: [],
SearchData: {},
SearchObj: {
@ -1102,7 +1098,6 @@ export default {
values.tmsForwarderOrderLoadingPlaceEntityList = this.tmsForwarderOrderLoadingPlaceEntityList
values.WebId = from.WebId
this.setTmsAddData(values)
console.log(this.$store.state)
}
}
}
@ -1129,7 +1124,6 @@ export default {
monthlyCardDataSelect(value) {
this.MonthlyPayloadData.forEach(item => {
if (item.cardNo == value.cardNo) {
console.log(item)
let values = { ...this.form.getFieldsValue() }
let Data = {
monthlyCard: item.cardNo
@ -1153,16 +1147,21 @@ export default {
this.TemplateVisible = true
this.loading = true
ExpressDeliveryGetAddressList().then(res => {
this.loadData = res.data
this.loadData = []
res.data.forEach(item => {
if (this.TemplateType == 'sj' && item.type == 1) {
this.loadData.push(item)
} else if (this.TemplateType == 'fj' && item.type == 2) {
this.loadData.push(item)
}
})
this.loading = false
})
},
PeopleDataSelect(value) {
let type = this.TemplateType
console.log(value, type)
this.loadData.forEach(item => {
if (item.people == value.people) {
console.log(item)
let values = { ...this.form.getFieldsValue() }
let Data = {}
Data[`${type}Company`] = item.company
@ -1188,33 +1187,9 @@ export default {
}
})
},
// UseData(data, type) {
// this.TemplateCancel()
// },
TemplateCancel() {
this.TemplateVisible = false
},
PeopleDataSearch(searchText) {
this.PeopleDataB = []
let Rdata = []
this.PeopleData.forEach(item => {
if (item.people.indexOf(searchText) != -1) {
Rdata.push(item.people)
}
})
this.PeopleDataB = !searchText ? [] : Rdata
},
monthlyCardDataBSearch(searchText) {
this.monthlyCardDataB = []
let Rdata = []
this.monthlyCardData.forEach(item => {
if (item.cardNo.indexOf(searchText) != -1) {
Rdata.push(item.cardNo)
}
})
this.monthlyCardDataB = !searchText ? [] : Rdata
},
getListData() {
this.BusinessLoading = true
@ -1239,10 +1214,10 @@ export default {
})
})
}
console.log(arr)
setTimeout(() => {
this.$refs.xTable2.setCheckboxRow(arr, true)
this.BusinessLoading = false
this.insertEvent2()
}, 100)
})
.catch(err => {
@ -1278,7 +1253,6 @@ export default {
fjPostCode: item.postCode
}
}
console.log(Obj)
this.form.setFieldsValue({
...values,
...Obj
@ -1287,166 +1261,6 @@ export default {
}
})
},
TemplateFilterOption(input, option) {
return option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0
},
TemplateSelect(value, option, data) {
this.dataSourceA.forEach(item => {
if (item.templateName == value || item.name == value) {
console.log(item)
data.name = item.name
data.contact = item.contact
data.address = item.address
data.tel = item.tel
}
})
console.log(value, option)
},
CopyFromToReturn() {
// fromYardId fromContract fromTel returnYardId returnContract returnTel
let values = { ...this.form.getFieldsValue() }
console.log(values)
setTimeout(() => {
this.form.setFieldsValue({
...values,
returnYardId: values.fromYardId,
returnContract: values.fromContract,
returnTel: values.fromTel
})
}, 100)
},
FnImgs(data) {
imgList(data).then(res => {
if (res.code == 200) {
if (res.data.length) {
this.ImgsVisible = true
this.ImgsData = res.data
} else {
this.$message.warning('暂无照片')
}
} else {
this.$message.warning(res.message)
}
})
},
MapTimeChange(date, dateString) {
this.MapTimeA = dateString
},
MapTimeHandleOk() {
this.MapBLoading = true
this.MapTimeVisible = false
// forwarderRouterPath({
// bodyId: this.MapData.id,
// qryBtm: this.MapTimeA[0],
// qryEtm: this.MapTimeA[1]
// })
forwarderRouterPath({
bodyId: '1671454297131257858',
qryBtm: '2023-07-03 00:59:40',
qryEtm: '2023-07-05 00:59:40'
})
.then(res => {
if (res.code == 200) {
let waypoints = []
res.data.trackArray.forEach((item, index) => {
if (index < 25) {
waypoints.push({ lng: item.lon / 600000, lat: item.lat / 600000 })
}
})
this.start = waypoints[0]
this.end = waypoints[waypoints.length - 1]
this.waypoints = waypoints
this.MapType = false
this.MapState = false
setTimeout(() => {
this.MapState = true
}, 100)
console.log(this.waypoints)
} else {
this.$message.warning(res.message)
}
this.MapBLoading = false
})
.catch(err => {
this.MapBLoading = false
})
},
FnSgj() {
this.MapTimeVisible = true
this.MapTimeA = []
},
Mapinit({ BMap, map }) {
this.map = map
console.log(BMap, map)
this.point = new BMap.Point(this.center.lng, this.center.lat)
map.centerAndZoom(this.point, 12)
},
FnCarLocate(data) {
if (data) {
this.MapData = data
}
this.MapBLoading = true
// forwarderTransTime({ bodyId: this.MapData.id })
forwarderTransTime({ bodyId: '1671454297131257858' })
.then(res => {
this.MapType = true
console.log(res)
if (res.code == 200) {
this.center.lng = res.data.lon / 600000
this.center.lat = res.data.lat / 600000
this.center.adr = res.data.adr
let date = new Date(parseInt(res.data.utc))
let Year = date.getFullYear()
let Moth = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
let Day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
let Hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
let Minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
let Sechond = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
let utc = Year + '-' + Moth + '-' + Day + ' ' + Hour + ':' + Minute + ':' + Sechond
this.center.utc = utc
// setTimeout(() => {
this.MapVisible = true
// }, 1000)
} else {
this.$message.warning(res.message)
}
this.MapBLoading = false
})
.catch(err => {
this.MapBLoading = false
})
},
FnChangeYard(type, e) {
DjyCustomerQuerytDjyCustomerInfo({ queryItem: e }).then(res => {
console.log(res)
if (res.data[0] && res.data[0].contacts) {
console.log(res.data[0].contacts)
// this.yardcontractaData = res.data[0].contacts
if (res.data[0].contacts.length) {
let data = {}
if (type == 'return') {
data = {
returnContract: res.data[0].contacts[0].name,
returnTel: res.data[0].contacts[0].tel
}
} else {
data = {
fromContract: res.data[0].contacts[0].name,
fromTel: res.data[0].contacts[0].tel
}
}
setTimeout(() => {
this.form.setFieldsValue(data)
}, 100)
}
}
})
console.log(type, e)
},
filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
/**
* 提交表单
*/
@ -1481,19 +1295,17 @@ export default {
// values.tmsForwarderOrderLoadingPlaceEntityList = this.tmsForwarderOrderLoadingPlaceEntityList
if (this.id && this.type != 'Copy') {
console.log('更新')
BookingOrderSFSave({ ...values, id: this.id }).then(res => {
if (res.success) {
this.$message.success(res.message)
this.$message.success('保存成功')
if (FnType == 'FnSendBooking') {
BookingOrderSFSendBooking({ Id: this.id }).then(res => {
if (res.success) {
this.$message.success('发送成功')
this.$message.success('下单成功')
setTimeout(() => {
this.form.setFieldsValue({
...this.form.getFieldsValue(),
...res.extras,
ASD: 123
...res.extras
})
}, 100)
} else {
@ -1521,7 +1333,6 @@ export default {
delete item.WebKey
Arr.push(item)
})
console.log(Arr)
}
if (values.business && values.business.length) {
let Arr = []
@ -1535,15 +1346,12 @@ export default {
delete item.WebKey
Arr.push(item)
})
console.log(Arr)
}
}
console.log('新增')
BookingOrderSFSave(values)
.then(res => {
console.log(res)
if (res.success) {
this.$message.success(res.message)
this.$message.success('新增成功')
this.type = 'Details'
this.id = res.data.result.id
this.WebId = ''
@ -1560,7 +1368,6 @@ export default {
})
.catch(err => {
this.confirmLoading = false
console.log(err)
})
}
} else {
@ -1571,61 +1378,21 @@ export default {
handleCancel() {
BookingOrderSFCancelBooking({ Id: this.id }).then(res => {
if (res.success) {
console.log(res)
this.$message.success(res.data)
this.form.setFieldsValue({
...this.form.getFieldsValue(),
currentStateDesc: '快递已消单'
})
} else {
this.$message.error(res.message)
}
})
},
FnFactoryAdd() {
this.tmsForwarderOrderLoadingPlaceEntityList.push({
name: '',
contact: '',
tel: '',
address: ''
})
},
FnFactoryDelete(index) {
this.tmsForwarderOrderLoadingPlaceEntityList.splice(index, 1)
},
FnSaveTemplate(data) {
this.$refs.addForm.add(data)
},
handleOk() {
this.FnGetTemplateData()
// this.FnGetData()
},
FnCopy() {
this.$router.push({
name: 'ExpressModuleDetails',
query: {
type: 'Copy',
id: this.id
}
})
},
FnCancel() {
TmsForwarderOrderCancel({ id: this.id }).then(res => {
if (res.success) {
this.$message.success('终止成功')
this.init()
} else {
this.$message.error(`终止失败,${res.message}`)
}
})
},
FnDelete() {
TmsForwarderOrderDelete({ id: this.id }).then(res => {
if (res.success) {
this.$message.success('删除成功')
this.init()
} else {
this.$message.error(`删除失败,${res.message}`)
}
})
},
FnGetTemplateData() {
let Arr = []
tmsCobLoadingPlacelist({
@ -1645,14 +1412,15 @@ export default {
if (this.initTime) {
this.DetailData = []
this.form.resetFields()
this.getListData()
if (this.id) {
BookingOrderSFGet({ id: this.id }).then(res => {
if (res.success) {
if (res.success && res.data.id != 0) {
setTimeout(() => {
this.form.setFieldsValue({
...res.data
})
this.DetailData = res.data.business
// if (this.type == 'Copy') {
// this.form.setFieldsValue({
// orderStatus: '0'
@ -1675,9 +1443,7 @@ export default {
res.data.detail.forEach((item, index) => {
item.WebKey = index + 1
})
this.DetailData = res.data.detail
}, 100)
} else {
}
})
} else if (this.WebId || this.Ids) {
@ -1687,7 +1453,8 @@ export default {
goodsname: '文件',
fjCompany: this.userInfo.loginEmpInfo.orgName,
kdNum: 1,
currentStateDesc: '新建'
currentStateDesc: '新建',
kdCompany: 'sf'
})
})
if (this.kdAddData[this.WebId]) {
@ -1713,42 +1480,15 @@ export default {
commondbCodeProvinceList().then(res => {
this.ProvinceData = res.data
})
GetCarrierlist().then(res => {
// console.log(res.data, '')
this.CarrierData = res.data
})
GetPortloadlist().then(res => {
console.log(res.data, '起始港')
this.PortloadData = res.data
})
GetPortlist().then(res => {
console.log(res.data, '目的港')
this.PortData = res.data
})
this.getListData()
console.log('init')
setTimeout(() => {
this.initTime = true
}, 100)
}
},
FnRdispatchStatus(value) {
let RData = ''
if (value) {
this.dispatchStatusList.forEach(item => {
if (item.code == value) {
RData = item.name
}
})
}
return RData
},
removeCheckboxRow() {
console.log(this.$refs.xTable.selection)
this.$refs.xTable.selection.forEach(item => {
this.DetailData.forEach((item2, index2) => {
console.log(item._X_ROW_KEY, item2._X_ROW_KEY)
if (item._X_ROW_KEY == item2._X_ROW_KEY) {
this.DetailData.splice(index2, 1)
}
@ -1759,20 +1499,17 @@ export default {
if (!this.DetailData) {
this.DetailData = []
}
console.log(this.DetailData, this.DetailData.length ? this.DetailData[this.DetailData.length - 1].WebKey + 1 : 1)
this.DetailData.push({
WebKey: this.DetailData.length ? this.DetailData[this.DetailData.length - 1].WebKey + 1 : 1,
dispatchStatus: '0'
})
},
insertEvent2() {
console.log(this.BusinessData)
this.$refs.xTable2.selection.forEach(item => {
delete item.id
let type = true
this.DetailData.forEach(item2 => {
if (item._X_ROW_KEY == item2._X_ROW_KEY) {
console.log(item._X_ROW_KEY)
type = false
}
})
@ -1782,12 +1519,10 @@ export default {
...item
})
} else {
this.$message.warning(`单号:${item.mblno},已添加。请勿重复添加数据!`)
this.$message.warning(`单号:${item.mblno},已添加。请勿重复添加数据!`)
}
console.log(item)
})
this.$refs.xTable2.clearCheckboxRow()
console.log(this.DetailData)
// if (!this.BusinessDataBackup) {
// this.BusinessDataBackup = []
// }
@ -1802,20 +1537,6 @@ export default {
// dispatchStatus: '0'
// })
// this.BusinessData = this.BusinessDataBackup
},
AddShandleSubmit() {
console.log(this.AddsData)
if (!this.ContactsData) {
this.ContactsData = []
}
for (let index = 0; index < this.AddsData.num; index++) {
this.ContactsData.push({
WebKey: this.ContactsData.length ? this.ContactsData[this.ContactsData.length - 1].WebKey + 1 : 1,
dispatchStatus: '0',
cntCode: this.AddsData.driverId
})
}
this.AddSVisible = false
}
}
}

@ -113,11 +113,11 @@
:show-overflow="true"
>
<template #default="{ row }">
<span v-if="item.dataIndex == 'orderStatus'">{{ FnOrderStatus(row[item.dataIndex]) }}</span>
<span v-else-if="item.dataIndex == 'billNo'" @click="FnGoDetails(row)" class="GoDetails">{{
<span v-if="item.dataIndex == 'kdCompany'">{{ FnkdCompany(row[item.dataIndex]) }}</span>
<!-- <span v-else-if="item.dataIndex == 'billNo'" @click="FnGoDetails(row)" class="GoDetails">{{
row[item.dataIndex]
}}</span>
<span v-else-if="item.dataIndex == 'carGroupId'">{{ FnCarGroupId(row[item.dataIndex]) }}</span>
<span v-else-if="item.dataIndex == 'carGroupId'">{{ FnCarGroupId(row[item.dataIndex]) }}</span> -->
<span v-else>{{ row[item.dataIndex] }}</span>
</template>
</vxe-column>
@ -309,7 +309,8 @@ export default {
loadData: [],
CodeData: [],
WCodeData: [],
ModulesData: []
ModulesData: [],
kdCompanyData: [{ code: 'sf', name: '顺丰' }]
}
},
created() {},
@ -318,6 +319,15 @@ export default {
},
methods: {
...mapActions(['setIssuetypeList']),
FnkdCompany(data) {
let Rdata = '-'
this.kdCompanyData.forEach(item => {
if (item.code == data) {
Rdata = item.name
}
})
return Rdata
},
FnExpressTemplate() {
this.TemplateVisible = true
},
@ -406,15 +416,7 @@ export default {
}
console.log(selectRecords)
},
FnOrderStatus(data) {
let Rdata = '-'
this.orderStatusData.forEach(item => {
if (item.code == data) {
Rdata = item.name
}
})
return Rdata
},
FnCarGroupId(data) {
let Rdata = '-'
this.carGroupIdData.forEach(item => {

@ -1,6 +1,6 @@
<template>
<a-modal
title="新增收发通模板"
title="新增月结卡号"
:width="900"
:visible="visible"
:confirmLoading="confirmLoading"

@ -1,6 +1,6 @@
<template>
<a-modal
title="编辑收发通模板"
title="编辑月结卡号"
:width="900"
:visible="visible"
:confirmLoading="confirmLoading"

@ -1,6 +1,6 @@
<template>
<a-modal
title="新增收发通模板"
title="新增收寄件人信息"
:width="900"
:visible="visible"
:confirmLoading="confirmLoading"
@ -9,41 +9,66 @@
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item label="代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入代码"
v-decorator="['title', { rules: [{ required: true, message: '请输入代码!' }] }]"
/>
</a-form-item>
<a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-form-item v-show="false"><a-input v-decorator="['id']"/></a-form-item>
<a-form-item label="类别" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
mode="multiple"
style="width: 100%"
placeholder="请选择类"
v-decorator="['type', { rules: [{ required: true, message: '请选择类' }] }]"
placeholder="请选择类别"
v-decorator="['type', { rules: [{ required: true, message: '请选择类别!' }] }]"
>
<a-select-option v-for="(item, index) in typeData" :key="index" :value="item.code">
{{ item.name }}
<a-select-option :value="1">
收件人
</a-select-option>
<a-select-option :value="2">
寄件人
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入名称" v-decorator="['name']" />
<a-form-item label="公司名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入公司名称"
v-decorator="['company', { rules: [{ required: true, message: '请输入公司名称!' }] }]"
/>
</a-form-item>
<a-form-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input placeholder="请输入地址" v-decorator="['addr']" />
<a-form-item label="联系人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入联系人姓名"
v-decorator="['people', { rules: [{ required: true, message: '请输入联系人姓名!' }] }]"
/>
</a-form-item>
<a-form-item label="国家" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入国家" v-decorator="['country']" />
<a-form-item label="省份" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
style="width: 100%"
placeholder="请选择省份"
v-decorator="['provinceId', { rules: [{ required: true, message: '请选择省份!' }] }]"
@change="
e => {
FnChangeProvince(e)
}
"
>
<a-select-option v-for="item in ProvinceData" :key="item.code" :value="item.code">
{{ item.cnName }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input placeholder="请输入电话" v-decorator="['tel']" />
<a-form-item label="城市" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
style="width: 100%"
placeholder="请选择城市"
v-decorator="['city', { rules: [{ required: true, message: '请选择城市!' }] }]"
:disabled="cityDisabled"
>
<a-select-option v-for="item in CityData" :key="item.cnName" :value="item.cnName">
{{ item.cnName }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="模板内容" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-textarea placeholder="请输入模板内容" :auto-size="{ minRows: 3, maxRows: 5 }" v-decorator="['content']" />
<a-form-item label="详细地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入详细地址" v-decorator="['address']" />
</a-form-item>
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input placeholder="请输入备注" v-decorator="['remark']" />
<a-form-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input placeholder="请输入联系电话" v-decorator="['tel']" />
</a-form-item>
</a-form>
</a-spin>
@ -51,8 +76,8 @@
</template>
<script>
import { BookingTemplateAdd } from '@/api/modular/main/BookingTemplateManage'
import { ExpressDeliverySaveOrUpdateAddress } from '@/api/modular/main/ExpressTemplate'
import { commondbCodeProvinceList, commondbCodeCityList } from '@/api/modular/main/ExpressModule'
export default {
data() {
return {
@ -64,38 +89,32 @@ export default {
xs: { span: 24 },
sm: { span: 15 }
},
typeData: [],
visible: false,
confirmLoading: false,
form: this.$form.createForm(this)
form: this.$form.createForm(this),
CityData: [],
ProvinceData: [],
cityDisabled: false
}
},
methods: {
//
add(record) {
commondbCodeProvinceList().then(res => {
this.ProvinceData = res.data
})
this.visible = true
this.typeData = [
{
code: '10',
name: '收货人'
},
{
code: '20',
name: '发货人'
},
{
code: '30',
name: '通知人'
},
{
code: '40',
name: '第二通知人'
},
{
code: '50',
name: '境外代理'
}
]
},
FnChangeProvince(data) {
this.cityDisabled = true
this.form.setFieldsValue({
...this.form.getFieldsValue(),
city: ''
})
commondbCodeCityList({ Provincecode: data }).then(res => {
this.CityData = res.data
this.cityDisabled = false
})
},
/**
* 提交表单
@ -104,33 +123,19 @@ export default {
const {
form: { validateFields }
} = this
// this.confirmLoading = true
this.confirmLoading = true
validateFields((errors, values) => {
if (!errors) {
for (const key in values) {
if (key == 'type') {
let Wtype = ''
values[key].forEach((item, index) => {
if (index == 0) {
Wtype = item
} else {
Wtype = `${Wtype},${item}`
}
})
values[key] = Wtype
}
if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key])
this.ProvinceData.forEach(item => {
if (item.code == values.provinceId) {
console.log(item.cnName)
values = {
...values,
province: item.cnName
}
}
}
let type = ''
console.log(values)
if (values.type) {
values.type.split(',').forEach(item2 => {
type == '' ? (type = `[${item2}]`) : (type = `${type}[${item2}]`)
})
}
BookingTemplateAdd({ ...values, type })
})
ExpressDeliverySaveOrUpdateAddress({ ...values })
.then(res => {
if (res.success) {
this.$message.success('新增成功')

@ -1,6 +1,6 @@
<template>
<a-modal
title="编辑收发通模板"
title="编辑收寄件人信息"
:width="900"
:visible="visible"
:confirmLoading="confirmLoading"
@ -10,6 +10,20 @@
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item v-show="false"><a-input v-decorator="['id']"/></a-form-item>
<a-form-item label="类别" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
style="width: 100%"
placeholder="请选择类别"
v-decorator="['type', { rules: [{ required: true, message: '请选择类别!' }] }]"
>
<a-select-option :value="1">
收件人
</a-select-option>
<a-select-option :value="2">
寄件人
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="公司名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入公司名称"
@ -19,7 +33,6 @@
<a-form-item label="联系人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入联系人姓名"
disabled
v-decorator="['people', { rules: [{ required: true, message: '请输入联系人姓名!' }] }]"
/>
</a-form-item>
@ -44,12 +57,8 @@
style="width: 100%"
placeholder="请选择城市"
v-decorator="['city', { rules: [{ required: true, message: '请选择城市!' }] }]"
:disabled="cityDisabled"
>
<!-- @change="
e => {
FnChangeProvince(e)
}
" -->
<a-select-option v-for="item in CityData" :key="item.cnName" :value="item.cnName">
{{ item.cnName }}
</a-select-option>
@ -59,7 +68,7 @@
<a-input placeholder="请输入详细地址" v-decorator="['address']" />
</a-form-item>
<a-form-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input placeholder="请输入联系电话" disabled v-decorator="['tel']" />
<a-input placeholder="请输入联系电话" v-decorator="['tel']" />
</a-form-item>
</a-form>
</a-spin>
@ -81,12 +90,12 @@ export default {
xs: { span: 24 },
sm: { span: 15 }
},
typeData: [],
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
ProvinceData: [],
CityData: []
CityData: [],
cityDisabled: false
}
},
methods: {
@ -95,47 +104,7 @@ export default {
commondbCodeProvinceList().then(res => {
this.ProvinceData = res.data
})
// BookingTemplate({ pageSize: 99999 }).then(res => {
// console.log(res)
// })
this.visible = true
this.typeData = [
{
code: '10',
name: '收货人'
},
{
code: '20',
name: '发货人'
},
{
code: '30',
name: '通知人'
},
{
code: '40',
name: '第二通知人'
},
{
code: '50',
name: '境外代理'
}
]
let WpropString = []
if (record.type) {
if (record.type.includes(']')) {
record.type.split(']').forEach(item => {
if (item.split('[')[1]) {
WpropString.push(item.split('[')[1])
}
})
} else {
WpropString.push(record.type)
}
}
console.log(WpropString)
// const typeOption = this.$options
// this.typeData = typeOption.filters['dictData']('edi_type')
setTimeout(() => {
this.form.setFieldsValue({
id: record.id,
@ -145,13 +114,20 @@ export default {
province: record.province,
city: record.city,
address: record.address,
tel: record.tel
tel: record.tel,
type: record.type
})
}, 100)
},
FnChangeProvince(data) {
this.cityDisabled = true
this.form.setFieldsValue({
...this.form.getFieldsValue(),
city: ''
})
commondbCodeCityList({ Provincecode: data }).then(res => {
this.CityData = res.data
this.cityDisabled = false
})
},
handleSubmit() {

@ -33,13 +33,13 @@
</div>
</a-card> -->
<a-card :bordered="false">
<!-- <vxe-toolbar>
<vxe-toolbar>
<template #buttons>
<div class="nav-box">
<div class="nav" @click="$refs.addForm.add()"><i class="iconfont icon-jiahao2fill"></i>新建</div>
</div>
</template>
</vxe-toolbar> -->
</vxe-toolbar>
<vxe-table :data="loadData" stripe resizable round :loading="loading" height="520" empty-text="">
<vxe-column type="seq" width="40" fixed="left"></vxe-column>
<vxe-column
@ -51,7 +51,8 @@
:align="item.align"
>
<template #default="{ row }">
<span>{{ row[item.dataIndex] }}</span>
<span v-if="item.dataIndex == 'type'">{{ FnRType(row[item.dataIndex]) }}</span>
<span v-else>{{ row[item.dataIndex] }}</span>
</template>
</vxe-column>
<vxe-column title="操作" fixed="right" width="160" align="center">
@ -85,27 +86,17 @@
@page-change="handlePageChange"
>
</vxe-pager> -->
<!-- <add-form ref="addForm" @ok="handleOk" /> -->
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
</a-card>
</div>
</template>
<script>
import { STable } from '@/components'
import {
ExpressDeliveryDeleteAddress,
ExpressDeliveryGetAddressList,
ShareToAll,
CancelShare
} from '@/api/modular/main/ExpressTemplate'
import { GetSysUserPage } from '@/api/modular/main/BookingLedger'
import { ExpressDeliveryDeleteAddress, ExpressDeliveryGetAddressList } from '@/api/modular/main/ExpressTemplate'
import addForm from './addForm.vue'
import editForm from './editForm.vue'
import { mapGetters } from 'vuex'
let timer
export default {
components: {
STable,
addForm,
editForm
},
@ -120,6 +111,11 @@ export default {
confirmLoading: false,
selectUserName: [],
columns: [
{
title: '类别',
align: 'center',
dataIndex: 'type'
},
{
title: '公司名称',
align: 'center',
@ -155,45 +151,21 @@ export default {
visible: false,
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
loadData: [],
typeData: [],
searchQuery: { name: '' },
selectedRowKeys: [],
selectedRows: []
typeData: []
}
},
created() {
this.init()
},
computed: {
...mapGetters(['bookingInitData'])
},
methods: {
FnRType(e) {
const fn = e => {
let Rdata = ''
this.typeData.forEach(item => {
if (item.code == e) {
Rdata = item.name
}
})
return Rdata
}
let RData = ''
if (e.split(']').length == 1) {
RData = fn(e.split(']')[0])
} else {
e.split(']').forEach(item => {
if (item) {
if (RData == '') {
RData = fn(item.split('[')[1])
} else {
RData = `${RData},${fn(item.split('[')[1])}`
}
}
})
}
return RData
let Rdata = ''
this.typeData.forEach(item => {
if (item.code == e) {
Rdata = item.name
}
})
return Rdata
},
init() {
Object.assign(this.$data, this.$options.data())
@ -206,24 +178,12 @@ export default {
this.typeData = [
{
code: 10,
name: '收货人'
},
{
code: 20,
name: '发货人'
},
{
code: 30,
name: '通知人'
},
{
code: 40,
name: '第二通知人'
code: 1,
name: '收件人'
},
{
code: 50,
name: '境外代理'
code: 2,
name: '寄件人'
}
]
this.FnGetData()

Loading…
Cancel
Save