Commit d08671b6 by wusiyi

Merge branch 'dev'

parents 7f1ec3fd 8da83641
......@@ -6,6 +6,7 @@ import { AddressInfo } from '@/types/api/podUsOrder.ts'
const emits = defineEmits(['success'])
defineProps<{
countryList: { countryCode: string }[]
type: 1 | 2
}>()
const visible = defineModel<boolean>('visible')
const form = defineModel<AddressInfo>('form', {
......@@ -63,13 +64,14 @@ const submitForm = async () => {
<el-dialog
v-model="visible"
:close-on-click-modal="false"
title="修改揽收信息"
:title="type === 1 ? '修改揽收信息' : '地址信息'"
width="50%"
>
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="姓名" prop="receiverName">
<el-input
v-model="form.receiverName"
:disabled="type === 2"
clearable
placeholder="请输入姓名"
/>
......@@ -77,12 +79,18 @@ const submitForm = async () => {
<el-form-item label="电话" prop="receiverPhone">
<el-input
v-model="form.receiverPhone"
:disabled="type === 2"
clearable
placeholder="请输入电话"
/>
</el-form-item>
<el-form-item label="国家" prop="receiverCountry">
<el-select v-model="form.receiverCountry" clearable filterable>
<el-select
v-model="form.receiverCountry"
clearable
filterable
:disabled="type === 2"
>
<el-option
v-for="it in countryList"
:key="it.countryCode"
......@@ -94,6 +102,7 @@ const submitForm = async () => {
<el-form-item label="省/州" prop="receiverProvince">
<el-input
v-model="form.receiverProvince"
:disabled="type === 2"
clearable
placeholder="请输入省/州"
/>
......@@ -101,6 +110,7 @@ const submitForm = async () => {
<el-form-item label="市" prop="receiverCity">
<el-input
v-model="form.receiverCity"
:disabled="type === 2"
clearable
placeholder="请输入市"
/>
......@@ -108,6 +118,7 @@ const submitForm = async () => {
<el-form-item label="区/县" prop="receiverDistrict">
<el-input
v-model="form.receiverDistrict"
:disabled="type === 2"
clearable
placeholder="请输入区/县"
/>
......@@ -115,6 +126,7 @@ const submitForm = async () => {
<el-form-item label="地址1" prop="receiverAddress1">
<el-input
v-model="form.receiverAddress1"
:disabled="type === 2"
clearable
placeholder="请输入地址1"
maxlength="50"
......@@ -124,6 +136,7 @@ const submitForm = async () => {
<el-form-item label="地址2" prop="receiverAddress2">
<el-input
v-model="form.receiverAddress2"
:disabled="type === 2"
clearable
placeholder="请输入地址2"
maxlength="50"
......@@ -133,6 +146,7 @@ const submitForm = async () => {
<el-form-item label="邮政编码" prop="receiverPostCode">
<el-input
v-model="form.receiverPostCode"
:disabled="type === 2"
clearable
placeholder="请输入邮政编码"
/>
......@@ -140,8 +154,10 @@ const submitForm = async () => {
</el-form>
<template #footer>
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="submitForm">提交</el-button>
<span v-if="type === 1">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="submitForm">提交</el-button>
</span>
</template>
</el-dialog>
</template>
......
......@@ -1387,7 +1387,7 @@
{{ row.logisticsWayName }}
</span>
</div>
<div class="order-detail-item">
<!-- <div class="order-detail-item">
<span class="order-detail-item-label">收货人:</span>
<span class="order-detail-item-value" :title="row.receiverName">
{{ row.receiverName }}
......@@ -1410,7 +1410,7 @@
>
{{ row.receiverPostCode }}
</span>
</div>
</div> -->
<!-- <div class="order-detail-item">
<span class="order-detail-item-label">收货地址:</span>
<span
......@@ -1614,6 +1614,15 @@
<span v-if="status !== 'BATCH_DOWNLOAD'" class="operate-item">
<ElButton
link
type="warning"
@click="handleUpdateAddress(row, 2)"
>
地址信息
</ElButton>
</span>
<span v-if="status !== 'BATCH_DOWNLOAD'" class="operate-item">
<ElButton
link
type="primary"
@click="operationLog(row.id, null, row)"
>
......@@ -1652,7 +1661,11 @@
"
class="operate-item"
>
<ElButton link type="primary" @click="handleUpdateAddress(row)">
<ElButton
link
type="primary"
@click="handleUpdateAddress(row, 1)"
>
修改地址
</ElButton>
</span>
......@@ -2124,16 +2137,30 @@
</el-button>
</div>
</div>
<div
v-if="currentItem?.lanshouAddress"
style="margin-top: 10px; color: #606266"
>
<span>地址:</span>
<span>{{ currentItem?.lanshouAddress }}</span>
</div>
</template>
<LogList :log-list="logList" />
</el-dialog>
<el-dialog
v-model="addressInfoVisible"
class="address-info-dialog"
title="地址信息"
width="800px"
>
<el-descriptions :column="1" border>
<el-descriptions-item label="收货人">
{{ currentItem?.receiverName }}
</el-descriptions-item>
<el-descriptions-item label="收货人电话">
{{ currentItem?.receiverPhone }}
</el-descriptions-item>
<el-descriptions-item label="收货人邮编">
{{ currentItem?.receiverPostCode }}
</el-descriptions-item>
<el-descriptions-item label="收货地址">
{{ currentItem?.lanshouAddress }}
</el-descriptions-item>
</el-descriptions>
</el-dialog>
<FastProduction
v-model:detail-visible="detailVisible"
:current-status="status"
......@@ -2271,6 +2298,7 @@
v-model:visible="updateAddVisible"
:country-list="countryList"
@success="search"
:type="updateAddressType"
></UpdateAddress>
<ElDialog
v-model="exceptionDialogVisible"
......@@ -2869,11 +2897,13 @@ const handleRefreshAddress = async (row: PodUsOrderListData) => {
},
)
}
const handleUpdateAddress = async (row: PodUsOrderListData) => {
const updateAddressType = ref(1)
const handleUpdateAddress = async (row: PodUsOrderListData, type: 1 | 2) => {
const { data } = await getAllCountryApi()
countryList.value = data
currentRow.value = JSON.parse(JSON.stringify(row))
updateAddVisible.value = true
updateAddressType.value = type
}
// 批量下载 下载
const handleDownload = async (row: PodUsOrderListData, type: string) => {
......@@ -4448,6 +4478,12 @@ const operationLog = async (
console.error(e)
}
}
const addressInfoVisible = ref(false)
const showAddressInfo = (row: PodUsOrderListData) => {
currentItem.value = row
addressInfoVisible.value = true
}
const handleSuccess = () => {
loadTabData()
search()
......
......@@ -8,54 +8,46 @@
:close-on-click-modal="false"
class="order-detail-dialog"
>
<el-card style="margin-bottom: 10px" v-if="detailData" class="!border-none mt-2" shadow="never">
<el-card
style="margin-bottom: 10px"
v-if="detailData"
class="!border-none mt-2"
shadow="never"
>
<el-descriptions class="margin-top" :column="3" :border="true">
<el-descriptions-item :title="detailData.namespace" label="订单来源">{{
detailData.namespace
}}
<el-descriptions-item :title="detailData.namespace" label="订单来源"
>{{ detailData.namespace }}
</el-descriptions-item>
<el-descriptions-item
:title="detailData.factory_order_number"
label="订单号"
>{{ detailData.factory_order_number }}
</el-descriptions-item
>
<el-descriptions-item
:title="detailData.shop_number"
label="店铺单号"
>{{ detailData.shop_number }}
>{{ detailData.factory_order_number }}
</el-descriptions-item>
<el-descriptions-item :title="detailData.shop_number" label="店铺单号"
>{{ detailData.shop_number }}
</el-descriptions-item>
<el-descriptions-item
:title="detailData.third_order_number"
label="第三方订单号"
>{{ detailData.third_order_number }}
</el-descriptions-item
>
>{{ detailData.third_order_number }}
</el-descriptions-item>
<el-descriptions-item :title="detailData.statusStr" label="订单状态">{{
detailData.statusStr
}}
<el-descriptions-item :title="detailData.statusStr" label="订单状态"
>{{ detailData.statusStr }}
</el-descriptions-item>
<el-descriptions-item :title="detailData.product_num" label="产品数量"
>{{ detailData.product_num }}
</el-descriptions-item>
<el-descriptions-item
:title="detailData.product_num"
label="产品数量"
>{{ detailData.product_num }}
</el-descriptions-item
>
<el-descriptions-item
:title="detailData.start_stocking_time"
label="确认时间"
>{{ detailData.start_stocking_time }}
</el-descriptions-item
>
<el-descriptions-item
:title="detailData.finish_time"
label="完成时间"
>{{ detailData.finish_time }}
</el-descriptions-item
>
>{{ detailData.start_stocking_time }}
</el-descriptions-item>
<el-descriptions-item :title="detailData.finish_time" label="完成时间"
>{{ detailData.finish_time }}
</el-descriptions-item>
<el-descriptions-item
:title="detailData.delivery_type"
......@@ -73,27 +65,18 @@
<el-descriptions-item
:title="detailData.lanshou_name || detailData.receiver_name"
label="收货人"
>{{
detailData.lanshou_name || detailData.receiver_name
}}
</el-descriptions-item
>
>{{ detailData.lanshou_name || detailData.receiver_name }}
</el-descriptions-item>
<el-descriptions-item
:title="detailData.lanshou_phone || detailData.receiver_phone"
label="收货电话"
>{{
detailData.lanshou_phone || detailData.receiver_phone
}}
</el-descriptions-item
>
>{{ detailData.lanshou_phone || detailData.receiver_phone }}
</el-descriptions-item>
<el-descriptions-item
:title="detailData.lanshou_region || detailData.receiver_province"
label="收货区域"
>{{
detailData.lanshou_region || detailData.receiver_province
}}
</el-descriptions-item
>
>{{ detailData.lanshou_region || detailData.receiver_province }}
</el-descriptions-item>
<el-descriptions-item
:title="
detailData.lanshou_address ||
......@@ -105,7 +88,7 @@
].join(' ')
"
label="收货地址"
>{{
>{{
detailData.lanshou_address ||
[
detailData.receiver_province,
......@@ -114,19 +97,14 @@
detailData.receiver_address1,
].join(' ')
}}
</el-descriptions-item
>
</el-descriptions-item>
<el-descriptions-item
:title="detailData.lanshou_post || detailData.receiver_post_code"
label="收货邮政编码"
>{{
detailData.lanshou_post || detailData.receiver_post_code
}}
</el-descriptions-item
>
<el-descriptions-item :title="detailData.user_mark" label="客户">{{
detailData.user_mark
}}
>{{ detailData.lanshou_post || detailData.receiver_post_code }}
</el-descriptions-item>
<el-descriptions-item :title="detailData.user_mark" label="客户"
>{{ detailData.user_mark }}
</el-descriptions-item>
</el-descriptions>
</el-card>
......@@ -215,27 +193,21 @@
width="120"
prop="shipment_num"
></el-table-column>
</el-table>
</div>
</el-card>
</el-dialog>
</template>
<script lang="ts" setup>
import type { ElTable } from 'element-plus'
import {
getPodUsDetailData,
} from '@/api/order'
import { PodUsDetailData } from '@/types/api/deliveryNote.ts'
import { getPodUsDetailData } from '@/api/order'
import { PodUsDetailData } from '@/types/api/deliveryNote.ts'
// 定义props
interface Props {
orderId?: number | string | null;
dialogVisible: boolean;
loading?: boolean;
orderId?: number | string | null
dialogVisible: boolean
loading?: boolean
}
const visible = ref(false)
......@@ -248,11 +220,10 @@ const props = withDefaults(defineProps<Props>(), {
// 定义事件
const emit = defineEmits(['close', 'update'])
const detailData = ref<PodUsDetailData | null>(null)
const getData = async () => {
if (!props.orderId) return
const res= await getPodUsDetailData(props.orderId || '')
const res = await getPodUsDetailData(props.orderId || '')
res.data.productList.forEach((it) => {
it.price = Number(it.product_price)
it.customized_quantityStr = it.customized_quantity > 1 ? '多面' : '单面'
......@@ -287,13 +258,19 @@ onActivated(() => {
}
})
watch(() => props.dialogVisible, () => {
visible.value = props.dialogVisible
})
watch(
() => props.dialogVisible,
() => {
visible.value = props.dialogVisible
},
)
watch(() => visible.value, () => {
emit('update', visible.value)
})
watch(
() => visible.value,
() => {
emit('update', visible.value)
},
)
</script>
<style lang="scss" scoped>
.img-list {
......
......@@ -79,8 +79,7 @@
<ElFormItem>
<el-button type="success" @click="exportExcel">
导出
</el-button
>
</el-button>
</ElFormItem>
<ElFormItem v-if="nodeId === 30">
<el-button type="danger" @click="auditOrder('archive')">
......@@ -307,15 +306,15 @@
</el-form-item>
<el-form-item>
<el-button type="primary" @click="searchDetail"
>查询
>查询
</el-button>
</el-form-item>
<el-form-item>
<el-button
v-if="[0, 1].some((id) => id === Number(nodeId))"
type="success"
@click="batchUpdate(detailSelections,1)"
>批量编辑
@click="batchUpdate(detailSelections, 1)"
>批量编辑
</el-button>
</el-form-item>
</el-form>
......@@ -428,8 +427,8 @@
>
<template #default="{ row }">
<span>{{
row.template_price + row.craft_price || 0
}}</span>
row.template_price + row.craft_price || 0
}}</span>
</template>
</el-table-column>
<el-table-column
......@@ -486,7 +485,7 @@
width="24"
title="编辑"
style="cursor: pointer"
@click="batchUpdate( [row],1)"
@click="batchUpdate([row], 1)"
/>
</div>
</template>
......@@ -527,15 +526,15 @@
<el-form-item>
<el-button type="primary" @click="getUsOrderList"
>查询
>查询
</el-button>
</el-form-item>
<el-form-item>
<el-button
v-if="[0, 1].some((id) => id === Number(nodeId))"
type="success"
@click="batchUpdate(orderSelections,2)"
>批量编辑
@click="batchUpdate(orderSelections, 2)"
>批量编辑
</el-button>
</el-form-item>
<el-form-item>
......@@ -543,7 +542,7 @@
v-if="[0, 1].some((id) => id === Number(nodeId))"
type="primary"
@click="priceModification"
>修改物流价格
>修改物流价格
</el-button>
</el-form-item>
</el-form>
......@@ -581,8 +580,8 @@
>
<template #default="{ row }">
<span>{{
row.erp_order_number || row.factory_order_number
}}</span>
row.erp_order_number || row.factory_order_number
}}</span>
</template>
</el-table-column>
<el-table-column
......@@ -710,8 +709,8 @@
>
<template #default="{ row }">
<span v-if="row.order">{{
row.order.shipment_type == 1 ? '工厂物流' : '自我物流'
}}</span>
row.order.shipment_type == 1 ? '工厂物流' : '自我物流'
}}</span>
</template>
</el-table-column>
......@@ -781,9 +780,12 @@
width="120"
>
<template #default="{ row }">
<div style="gap:5px" class="flex items-center justify-center flex-gap-5">
<div
style="gap: 5px"
class="flex items-center justify-center flex-gap-5"
>
<img
@click="batchUpdate([row],2 )"
@click="batchUpdate([row], 2)"
src="@/assets/images/edit.png"
width="24"
title="编辑"
......@@ -839,11 +841,11 @@
{{ item.create_time }}
</span>
<span style="margin: 0 5px 0 20px">{{
item.employee_account
}}</span>
item.employee_account
}}</span>
<span style="display: inline-block">{{
item.description
}}</span>
item.description
}}</span>
</li>
</ul>
</el-tab-pane>
......@@ -904,10 +906,7 @@
</el-row>
<div></div>
<ElForm ref="auditFormRef" :model="auditForm" label-width="80px">
<ElFormItem
label="驳回原因"
prop="description"
>
<ElFormItem label="驳回原因" prop="description">
<ElInput v-model="auditForm.description" type="textarea" />
</ElFormItem>
</ElForm>
......@@ -915,7 +914,7 @@
<span class="dialog-footer">
<!-- <el-button @click="confirmOrderVisible = false">取消</el-button> -->
<el-button type="success" @click="submitConfirmOrder(1)"
>确认</el-button
>确认</el-button
>
<el-button type="danger" @click="submitConfirmOrder(2)">驳回</el-button>
</span>
......@@ -965,7 +964,7 @@
<el-dialog v-model="batchUpdateVisible" width="1400px" title="批量编辑">
<edit-order :list="updateProductList" />
<template #footer>
<el-button @click="batchUpdateVisible=false">取消</el-button>
<el-button @click="batchUpdateVisible = false">取消</el-button>
<el-button type="primary" @click="batchSave">保存</el-button>
</template>
</el-dialog>
......@@ -983,9 +982,18 @@ import {
auditOrderApi,
confirmPodOrderApi,
apiRejectionOfReview,
apiSetCraftData, podUsReconciliation, podUsReconciliationList, exportPodUsExcelApi,
getPodUsShipmentDetailsById, getPodUsLogListApi, getPodShipmentGetById, confirmPodUsOrderApi,
updatePodUsCarriageAmount, getReconciliationById, batchUpdatePrice, delPodUsOrderData,
apiSetCraftData,
podUsReconciliation,
podUsReconciliationList,
exportPodUsExcelApi,
getPodUsShipmentDetailsById,
getPodUsLogListApi,
getPodShipmentGetById,
confirmPodUsOrderApi,
updatePodUsCarriageAmount,
getReconciliationById,
batchUpdatePrice,
delPodUsOrderData,
} from '@/api/order'
import { nextTick, onMounted, ref, watch } from 'vue'
......@@ -994,7 +1002,8 @@ import {
AccountStatementNote,
AccountStatementNoteSearchForm,
CountStatus,
OrderDetails, ProductDetails,
OrderDetails,
ProductDetails,
} from '@/types/api/billOrder'
import { DetailForm, LogListData, IUpdatePrice } from '@/types/api/deliveryNote'
import ImageView from '@/components/ImageView.vue'
......@@ -1033,8 +1042,10 @@ const currentRow = ref<AccountStatementNote | null>(null)
const batchSave = async () => {
for (const item of updateProductList.value) {
if (!item.craft_price && item.craft_price !== 0) return ElMessage.warning('请输入工艺价格')
if (!item.template_price && item.craft_price !== 0) return ElMessage.warning('请输入模板价格')
if (!item.craft_price && item.craft_price !== 0)
return ElMessage.warning('请输入工艺价格')
if (!item.template_price && item.craft_price !== 0)
return ElMessage.warning('请输入模板价格')
}
await batchUpdatePrice({
info_id: currentRow.value?.id,
......@@ -1058,13 +1069,16 @@ const getDetails = async (row: OrderDetails) => {
detailDialogVisible.value = true
}
const batchUpdate = async (arr: ProductDetails[] | OrderDetails[], type: 1 | 2) => {
const batchUpdate = async (
arr: ProductDetails[] | OrderDetails[],
type: 1 | 2,
) => {
if (!arr.length) return ElMessage.warning('请选择数据')
if (type === 1) {
updateProductList.value = JSON.parse(JSON.stringify(arr))
} else if (type === 2) {
const { data } = await getReconciliationById({
ids: arr.map(el => el.id).join(','),
ids: arr.map((el) => el.id).join(','),
})
updateProductList.value = data
}
......@@ -1199,7 +1213,7 @@ const handleDelete = async (id: string) => {
cancelButtonText: '取消',
type: 'warning',
})
const res = await delPodUsOrderData([id])
await delPodUsOrderData([id])
ElMessage.success('删除成功')
await getTreeNum()
search()
......
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