Commit 67bae872 by qinjianhui

Merge branch 'dev' into 'master'

Dev

See merge request !18
parents 932a091f e6fcf29f
...@@ -32,7 +32,6 @@ declare module 'vue' { ...@@ -32,7 +32,6 @@ declare module 'vue' {
ElImage: typeof import('element-plus/es')['ElImage'] ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput'] ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElLink: typeof import('element-plus/es')['ElLink']
ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption'] ElOption: typeof import('element-plus/es')['ElOption']
...@@ -51,7 +50,6 @@ declare module 'vue' { ...@@ -51,7 +50,6 @@ declare module 'vue' {
ElTag: typeof import('element-plus/es')['ElTag'] ElTag: typeof import('element-plus/es')['ElTag']
ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree'] ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload']
Icon: typeof import('./src/components/Icon.vue')['default'] Icon: typeof import('./src/components/Icon.vue')['default']
ImageView: typeof import('./src/components/ImageView.vue')['default'] ImageView: typeof import('./src/components/ImageView.vue')['default']
LogList: typeof import('./src/components/LogList.vue')['default'] LogList: typeof import('./src/components/LogList.vue')['default']
......
...@@ -16,6 +16,7 @@ export interface LogisticsData { ...@@ -16,6 +16,7 @@ export interface LogisticsData {
status: boolean status: boolean
logisticsWayCode: string // 物流编码 logisticsWayCode: string // 物流编码
partition: string // 所在分区 partition: string // 所在分区
logisticsWayId?: number | null
} }
export function getOrderTabData() { export function getOrderTabData() {
return axios.get<never, BaseRespData<Tab[]>>( return axios.get<never, BaseRespData<Tab[]>>(
...@@ -270,3 +271,16 @@ export function cancelLogisticsOrderApi(orderIds: (string | number)[]) { ...@@ -270,3 +271,16 @@ export function cancelLogisticsOrderApi(orderIds: (string | number)[]) {
orderIds, orderIds,
) )
} }
// 更改物流
export function changeLogisticsApi(params: {
UpdateByIdParam: {
id: string | number
dataVersion: string
}
logisticsTrialCalculation: LogisticsData
}) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/changeLogistics',
params,
)
}
...@@ -57,6 +57,7 @@ export interface PodUsOrderListData { ...@@ -57,6 +57,7 @@ export interface PodUsOrderListData {
version?: number version?: number
productList?: ProductList[] productList?: ProductList[]
orderNumber?: string orderNumber?: string
logisticsWayId?: number | null
} }
export interface ProductList { export interface ProductList {
id: number id: number
......
...@@ -292,9 +292,9 @@ getLogisticsList() ...@@ -292,9 +292,9 @@ getLogisticsList()
<span>{{ item.description }}</span> <span>{{ item.description }}</span>
</div> </div>
</LogDialog> </LogDialog>
<el-dialog v-model="createData.show" :close-on-click-modal="false" width="700px" :title="createData.title"> <el-dialog v-model="createData.show" :close-on-click-modal="false" width="900px" :title="createData.title">
<el-form v-if="createData.show" ref="formRef" label-width="110px" :rules="rules" :model="form"> <el-form v-if="createData.show" ref="formRef" style="padding: 30px" label-width="110px" :rules="rules" :model="form" class="el-row">
<el-form-item label="物流公司编码" prop="code"> <el-form-item class="el-col-12" label="物流公司编码" prop="code">
<el-select v-model="form.code" clearable filterable @change="codeChange"> <el-select v-model="form.code" clearable filterable @change="codeChange">
<el-option <el-option
v-for="it in logisticsList" :key="it.code" :label="it.basicsName" v-for="it in logisticsList" :key="it.code" :label="it.basicsName"
...@@ -306,22 +306,22 @@ getLogisticsList() ...@@ -306,22 +306,22 @@ getLogisticsList()
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item class="el-col-12" label="名称" prop="name">
<el-input v-model="form.name" clearable placeholder="请输入名称"></el-input> <el-input v-model="form.name" clearable placeholder="请输入名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="联系人" prop="contact"> <el-form-item class="el-col-12" label="联系人" prop="contact">
<el-input v-model="form.contact" clearable placeholder="请输入联系人"></el-input> <el-input v-model="form.contact" clearable placeholder="请输入联系人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="电话/手机" prop="phone"> <el-form-item class="el-col-12" label="电话/手机" prop="phone">
<el-input v-model="form.phone" clearable placeholder="请输入电话/手机"></el-input> <el-input v-model="form.phone" clearable placeholder="请输入电话/手机"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="网址" prop="siteUrl"> <el-form-item class="el-col-12" label="网址" prop="siteUrl">
<el-input v-model="form.siteUrl" clearable placeholder="请输入网址"></el-input> <el-input v-model="form.siteUrl" clearable placeholder="请输入网址"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="地址" prop="address"> <el-form-item class="el-col-12" label="地址" prop="address">
<el-input v-model="form.address" clearable placeholder="请输入地址"></el-input> <el-input v-model="form.address" clearable placeholder="请输入地址"></el-input>
</el-form-item> </el-form-item>
<el-form-item v-for="o in otherFields" :key="o" required :label="o" :prop="`apiData.${o}`"> <el-form-item v-for="o in otherFields" :key="o" class="el-col-12" required :label="o" :prop="`apiData.${o}`">
<el-input v-model="form.apiData[o]" clearable :placeholder="`请输入${o}`"></el-input> <el-input v-model="form.apiData[o]" clearable :placeholder="`请输入${o}`"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
......
...@@ -187,6 +187,9 @@ ...@@ -187,6 +187,9 @@
<ElDropdownItem @click="getOrderByIdApi('cancelLogisticsOrder')" <ElDropdownItem @click="getOrderByIdApi('cancelLogisticsOrder')"
>取消物流订单</ElDropdownItem >取消物流订单</ElDropdownItem
> >
<ElDropdownItem @click="getOrderByIdApi('batchChangeLogistics')"
>更换物流</ElDropdownItem
>
</ElDropdownMenu> </ElDropdownMenu>
</template> </template>
</ElDropdown> </ElDropdown>
...@@ -894,6 +897,60 @@ ...@@ -894,6 +897,60 @@
:list="resultInfo" :list="resultInfo"
@confirm="resultConfim" @confirm="resultConfim"
></ResultInfo> ></ResultInfo>
<el-dialog
v-model="isChangeWay"
:close-on-click-modal="false"
title="更换物流"
>
<el-table
height="400px"
class="production-client-table"
:data="logisticsWayData"
border
highlight-current-row
@current-change="currentChangeWay"
>
<el-table-column
label="序号"
width="60"
align="center"
type="index"
></el-table-column>
<el-table-column
label="物流名称"
align="center"
prop="logisticsWayName"
></el-table-column>
<el-table-column
label="发货仓库"
align="center"
prop="warehouseName"
></el-table-column>
<el-table-column
label="物流编码"
align="center"
prop="logisticsWayCode"
></el-table-column>
<el-table-column
label="所在分区"
align="center"
prop="partition"
></el-table-column>
<el-table-column label="状态" align="center">
<template #default="{ row }">
<b v-if="row.status" style="color: green">成功</b>
<b v-else-if="!row.status" style="color: red">失败</b>
</template>
</el-table-column>
<el-table-column label="预计运费($)" align="center" prop="payFreight">
</el-table-column>
</el-table>
<template #footer>
<el-button @click="isChangeWay = false">取消</el-button>
<el-button type="primary" @click="changeWaySubmit">确定</el-button>
</template>
</el-dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getUserMarkList } from '@/api/common' import { getUserMarkList } from '@/api/common'
...@@ -924,6 +981,7 @@ import { ...@@ -924,6 +981,7 @@ import {
getTrackingNumberApi, getTrackingNumberApi,
getfaceSimplexFileApi, getfaceSimplexFileApi,
cancelLogisticsOrderApi, cancelLogisticsOrderApi,
// changeLogisticsApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import TableView from '@/components/TableView.vue' import TableView from '@/components/TableView.vue'
import { import {
...@@ -968,7 +1026,9 @@ declare global { ...@@ -968,7 +1026,9 @@ declare global {
const tabsNav = ref<Tab[]>() const tabsNav = ref<Tab[]>()
const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null) const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null)
const confirmDialogShow = ref(false) const confirmDialogShow = ref(false)
const isChangeWay = ref(false)
const confirmData = ref([]) const confirmData = ref([])
const logisticsWayData = ref([])
const confirmSelectionData = ref<LogisticsData[]>([]) const confirmSelectionData = ref<LogisticsData[]>([])
const confirmRowData = ref<ProductList | null>(null) const confirmRowData = ref<ProductList | null>(null)
const status = ref('TO_BE_CONFIRMED') const status = ref('TO_BE_CONFIRMED')
...@@ -1586,7 +1646,6 @@ const printPodOrder = async () => { ...@@ -1586,7 +1646,6 @@ const printPodOrder = async () => {
/** /**
* @description: 获取跟踪号、获取打印面单、取消物流订单 * @description: 获取跟踪号、获取打印面单、取消物流订单
*/ */
const resultInfo = ref([])
const getOrderByIdApi = async (type: string) => { const getOrderByIdApi = async (type: string) => {
if (selection.value.length === 0) { if (selection.value.length === 0) {
...@@ -1604,6 +1663,16 @@ const getOrderByIdApi = async (type: string) => { ...@@ -1604,6 +1663,16 @@ const getOrderByIdApi = async (type: string) => {
} else if (type === 'cancelLogisticsOrder') { } else if (type === 'cancelLogisticsOrder') {
message = '取消物流订单' message = '取消物流订单'
Fn = cancelLogisticsOrderApi Fn = cancelLogisticsOrderApi
} else if (type === 'batchChangeLogistics') {
if (selection.value.length !== 1) {
return ElMessage.warning('请选择单条数据')
}
isChangeWay.value = true
const { data } = await getLogisticsCalculation(selection.value[0]?.id)
console.log(selection.value[0])
logisticsWayData.value = data
return
} }
try { try {
await showConfirm(`确定对该订单 ${message}?`, { await showConfirm(`确定对该订单 ${message}?`, {
...@@ -1620,7 +1689,7 @@ const getOrderByIdApi = async (type: string) => { ...@@ -1620,7 +1689,7 @@ const getOrderByIdApi = async (type: string) => {
text: '操作中...', text: '操作中...',
}) })
const res = await Fn(ids) const res = await Fn(ids)
console.log(res)
if (res.code === 200) { if (res.code === 200) {
if (isArray(res.data)) { if (isArray(res.data)) {
resultInfo.value = res.data resultInfo.value = res.data
...@@ -1633,10 +1702,40 @@ const getOrderByIdApi = async (type: string) => { ...@@ -1633,10 +1702,40 @@ const getOrderByIdApi = async (type: string) => {
} }
loading.close() loading.close()
} }
} catch { } catch (e) {
console.error(e)
return return
} }
} }
const changeWayRow = ref<LogisticsData>({} as LogisticsData)
const currentChangeWay = (row: LogisticsData) => {
changeWayRow.value = row
}
const changeWaySubmit = () => {
if (!changeWayRow.value?.logisticsWayId) {
return ElMessage.warning('请选择一条物流方式')
}
if (
changeWayRow.value.logisticsWayId === selection.value[0]?.logisticsWayId
) {
return ElMessage.warning('更改的物流方式不能相同')
}
if (!changeWayRow.value.status) {
return ElMessage.warning('请选择状态为成功的物流方式')
}
// const params = {
// UpdateByIdParam: {
// id: selection.value[0]?.id,
// dataVersion: selection.value[0]?.version,
// },
// logisticsTrialCalculation: { ...changeWayRow.value },
// }
isChangeWay.value = false
// changeLogisticsApi(params)
}
const resultInfo = ref([])
const resultConfim = () => { const resultConfim = () => {
search() search()
} }
...@@ -1751,8 +1850,7 @@ const printOrder = async ( ...@@ -1751,8 +1850,7 @@ const printOrder = async (
return return
} }
if (data.filePath) { if (data.filePath) {
// const strURL = filePath + data.filePath const strURL = filePath + data.filePath
const strURL = 'https://factory.jomalls.com/upload/factory' + data.filePath
console.log('strURL', strURL, data) console.log('strURL', strURL, data)
lodop.ADD_PRINT_PDF( lodop.ADD_PRINT_PDF(
0, 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment