Commit 7f6e45cd by 前端

Merge branch 'SAAS+V5.6.2' into 'develop'

上线合并

See merge request !566
2 parents 2966a0b4 b4400b78
Showing 34 changed files with 2024 additions and 74 deletions
...@@ -4782,6 +4782,27 @@ ...@@ -4782,6 +4782,27 @@
"lodash": "^4.17.4" "lodash": "^4.17.4"
} }
}, },
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.11.1",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.11.1.tgz",
"integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"@vue/vue2-jest": { "@vue/vue2-jest": {
"version": "27.0.0", "version": "27.0.0",
"resolved": "https://registry.npmmirror.com/@vue/vue2-jest/-/vue2-jest-27.0.0.tgz", "resolved": "https://registry.npmmirror.com/@vue/vue2-jest/-/vue2-jest-27.0.0.tgz",
......
...@@ -86,3 +86,12 @@ export function onlinestatementAccountPage(data) { ...@@ -86,3 +86,12 @@ export function onlinestatementAccountPage(data) {
data.method = "dj.api.smartcarlife.onlineStatementAccount.page" data.method = "dj.api.smartcarlife.onlineStatementAccount.page"
return request(data, "post") return request(data, "post")
} }
/**
* 查询银盛线上对账单管理统计信息
*/
export function onlineStatementAccountCountTotal(data) {
data.method = "dj.api.smartcarlife.onlineStatementAccount.countTotal"
return request(data, "post")
}
\ No newline at end of file \ No newline at end of file
...@@ -11,6 +11,12 @@ export function getyqMerchantList(data) { ...@@ -11,6 +11,12 @@ export function getyqMerchantList(data) {
return request(data) return request(data)
} }
// 调拨-获取调出仓库列表 (H5)
export function stockAllocateYqMerchantList(data) {
data.method = "dj.smartcarlife.api.stock.allocate.h5.yqMerchant.list"
return request(data, RequestMethods.POST)
}
// 根据仓库获取门店列表 // 根据仓库获取门店列表
export function getServicemerchantrefList(data) { export function getServicemerchantrefList(data) {
data.method = `${path2}servicemerchantref.list` data.method = `${path2}servicemerchantref.list`
...@@ -65,6 +71,48 @@ export function stockAllocatePage(data) { ...@@ -65,6 +71,48 @@ export function stockAllocatePage(data) {
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 运营/商务审核分页查询
export function stockAllocateOperatorReviewPage(data) {
data.method = "dj.smartcarlife.api.stockAllocate.operatorreview.page"
return request(data, RequestMethods.POST)
}
// 运营审核
export function stockAllocateOperatorAudit(data) {
data.method = "dj.smartcarlife.api.stockAllocate.operatorAudit"
return request(data, RequestMethods.POST)
}
// 商务审核
export function stockAllocateBusinessAudit(data) {
data.method = "dj.smartcarlife.api.stockAllocate.businessAudit"
return request(data, RequestMethods.POST)
}
// 运营驳回
export function stockAllocateOperatorReject(data) {
data.method = "dj.smartcarlife.api.stockAllocate.operatorReject"
return request(data, RequestMethods.POST)
}
// 商务驳回
export function stockAllocateBusinessReject(data) {
data.method = "dj.smartcarlife.api.stockAllocate.businessReject"
return request(data, RequestMethods.POST)
}
// 调拨单详情(主信息)
export function stockAllocateGetDetail(data) {
data.method = "dj.smartcarlife.api.stock.allocate.getDetail"
return request(data, RequestMethods.POST)
}
// 查询调拨信息详情(包含商品列表)
export function stockAllocateInfo(data) {
data.method = "dj.smartcarlife.api.stock.allocate.info"
return request(data, RequestMethods.POST)
}
// 分页查询调拨详细信息 // 分页查询调拨详细信息
export function stockAllocateDetailPage(data) { export function stockAllocateDetailPage(data) {
data.method = `${path3}stock.allocate.detail.page` data.method = `${path3}stock.allocate.detail.page`
...@@ -107,6 +155,12 @@ export function merchantShopGoodsStockPage(data) { ...@@ -107,6 +155,12 @@ export function merchantShopGoodsStockPage(data) {
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 获取门店库存列表 (H5)
export function merchantShopGoodsStockPageH5(data) {
data.method = "dj.smartcarlife.api.stock.allocate.h5.merchantShopGoodsStock.page"
return request(data, RequestMethods.POST)
}
// 分页查询库存管理-权益卡 // 分页查询库存管理-权益卡
export function vdCardPage(data) { export function vdCardPage(data) {
data.method = `dj.smartcarlife.stock.vdCard.page` data.method = `dj.smartcarlife.stock.vdCard.page`
...@@ -166,3 +220,57 @@ export function stockRefundUpdateStatus(data) { ...@@ -166,3 +220,57 @@ export function stockRefundUpdateStatus(data) {
data.method = "dj.smartcarlife.api.stock.refund.updateStatus" data.method = "dj.smartcarlife.api.stock.refund.updateStatus"
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 调拨发货列表数据
export function getTransferShipmentList(data) {
data.method = "dj.smartcarlife.api.stock.allocate.delivery.page"
return request(data, RequestMethods.POST)
}
// 调拨发货 批量发货
export function batchDelicery(data) {
data.method = "dj.api.smartcarlife.allocate.delivery.batch"
return request(data, RequestMethods.POST)
}
// 调拨发货驳回
export function deliveryReject(data) {
data.method = "dj.smartcarlife.api.stock.allocate.delivery.reject"
return request(data, RequestMethods.POST)
}
// 获取查看调拨详情商品信息
export function getTransferGoodsInfo(data) {
data.method = "dj.smartcarlife.api.stock.allocate.detail.page"
return request(data, RequestMethods.POST)
}
// 获取查看调拨详情审批记录信息
export function getTransferAuitInfo(data) {
data.method = "dj.smartcarlife.api.stock.allocate.info"
return request(data, RequestMethods.POST)
}
// 发货单列表数据
export function getDeliveryPage(data) {
data.method = "dj.api.smarcarlife.purchaseOrder.delivery.page"
return request(data, RequestMethods.POST)
}
// 发货签收单
export function deliveryPdf(data) {
data.method = "dj.api.smarcarlife.warehousedeliver.detail.pdf"
return request(data, RequestMethods.POST)
}
// 发货单详情
export function getDeliveryDetail(data) {
data.method = "dj.api.smarcarlife.purchaseOrder.delivery.detail"
return request(data, RequestMethods.POST)
}
// 获取出入库列表数据
export function getInventoryTransactionRecordsPage(data) {
data.method = "dj.api.smartcarlife.StockFlow.page"
return request(data, RequestMethods.POST)
}
<template> <template>
<div class="d2-layout-header-aside-group" :style="styleLayoutMainGroup" :class="{ grayMode: grayActive }"> <div
class="d2-layout-header-aside-group"
:style="styleLayoutMainGroup"
:class="{ grayMode: grayActive }"
>
<!-- 半透明遮罩 --> <!-- 半透明遮罩 -->
<div class="d2-layout-header-aside-mask" /> <div class="d2-layout-header-aside-mask" />
<!-- 主体内容 --> <!-- 主体内容 -->
<div class="d2-layout-header-aside-content" flex="dir:top"> <div class="d2-layout-header-aside-content" flex="dir:top">
<!-- 顶栏 --> <!-- 顶栏 -->
<div class="d2-theme-header" :style="{ <div
class="d2-theme-header"
:style="{
opacity: this.searchActive ? 0.5 : 1 opacity: this.searchActive ? 0.5 : 1
}" flex-box="0" flex> }"
<div class="logo-group d2-theme-header-logo" :class="asideCollapse ? 'logo-only' : 'logo-all'" flex-box="0"> flex-box="0"
flex
>
<div
class="logo-group d2-theme-header-logo"
:class="asideCollapse ? 'logo-only' : 'logo-all'"
flex-box="0"
>
<img v-if="asideCollapse" src="../../assets/icon-only.png" /> <img v-if="asideCollapse" src="../../assets/icon-only.png" />
<img v-else src="../../assets/all.png" /> <img v-else src="../../assets/all.png" />
<!-- <img style="width: 32px; height: 32px;" src="../../assets/icon-only.png"> --> <!-- <img style="width: 32px; height: 32px;" src="../../assets/icon-only.png"> -->
...@@ -35,24 +48,47 @@ ...@@ -35,24 +48,47 @@
<d2-header-user /> <d2-header-user />
</div> </div>
</div> </div>
<div class="d2-theme-header" style="height: 40px; font-size: 14px; border-top: 1px solid #f0f2f5" flex-box="0" <div
flex> class="d2-theme-header"
<div class="logo-group d2-theme-header-logo" style="height: 1px; margin-top: -1px" style="height: 40px; font-size: 14px; border-top: 1px solid #f0f2f5"
:class="asideCollapse ? 'logo-only' : 'logo-all'" flex-box="0" /> flex-box="0"
<hamburger :on-click="handleToggleAside" :is-active="asideCollapse" flex-box="0" class="toggle-aside-btn" /> flex
>
<div
class="logo-group d2-theme-header-logo"
style="height: 1px; margin-top: -1px"
:class="asideCollapse ? 'logo-only' : 'logo-all'"
flex-box="0"
/>
<hamburger
:on-click="handleToggleAside"
:is-active="asideCollapse"
flex-box="0"
class="toggle-aside-btn"
/>
<span class="header-title">{{ headerTitle }}</span> <span class="header-title">{{ headerTitle }}</span>
</div> </div>
<!-- 下面 主体 --> <!-- 下面 主体 -->
<div class="d2-theme-container" flex-box="1" flex> <div class="d2-theme-container" flex-box="1" flex>
<!-- 主体 侧边栏 --> <!-- 主体 侧边栏 -->
<div flex-box="0" ref="aside" class="d2-theme-container-aside" :style="{ <div
flex-box="0"
ref="aside"
class="d2-theme-container-aside"
:style="{
width: asideCollapse ? asideWidthCollapse : asideWidth, width: asideCollapse ? asideWidthCollapse : asideWidth,
opacity: this.searchActive ? 0.5 : 1 opacity: this.searchActive ? 0.5 : 1
}"> }"
>
<d2-menu-side /> <d2-menu-side />
</div> </div>
<!-- 主体 --> <!-- 主体 -->
<div class="d2-theme-container-main" :class="this.searchActive ? 'is-search' : ''" flex-box="1" flex> <div
class="d2-theme-container-main"
:class="this.searchActive ? 'is-search' : ''"
flex-box="1"
flex
>
<!-- 搜索 --> <!-- 搜索 -->
<transition name="fade-scale"> <transition name="fade-scale">
<div v-if="searchActive" class="d2-theme-container-main-layer" flex> <div v-if="searchActive" class="d2-theme-container-main-layer" flex>
...@@ -61,14 +97,21 @@ ...@@ -61,14 +97,21 @@
</transition> </transition>
<!-- 内容 --> <!-- 内容 -->
<transition name="fade-scale"> <transition name="fade-scale">
<div v-if="!searchActive" class="d2-theme-container-main-layer" flex="dir:top"> <div
v-if="!searchActive"
class="d2-theme-container-main-layer"
flex="dir:top"
>
<!-- tab --> <!-- tab -->
<div class="d2-theme-container-main-header" flex-box="0"> <div class="d2-theme-container-main-header" flex-box="0">
<!-- <d2-tabs/> --> <!-- <d2-tabs/> -->
</div> </div>
<!-- 页面 --> <!-- 页面 -->
<div class="d2-theme-container-main-body" flex-box="1"> <div class="d2-theme-container-main-body" flex-box="1">
<transition :name="transitionActive ? 'el-fade-in' : ''" mode="out-in"> <transition
:name="transitionActive ? 'el-fade-in' : ''"
mode="out-in"
>
<keep-alive :include="keepAlive"> <keep-alive :include="keepAlive">
<router-view /> <router-view />
</keep-alive> </keep-alive>
...@@ -173,8 +216,12 @@ export default { ...@@ -173,8 +216,12 @@ export default {
...mapActions("d2admin/menu", ["asideCollapseToggle"]), ...mapActions("d2admin/menu", ["asideCollapseToggle"]),
...mapActions("d2admin/user", ["load"]), ...mapActions("d2admin/user", ["load"]),
findTitle(val) { findTitle(val) {
this.headerTitle = val?.title let title = val?.title
? val.title + (this.headerTitle ? " / " : "") + this.headerTitle if (val?.dynamicTitle && typeof val.dynamicTitle === "function") {
title = val.dynamicTitle(this.$route) || title
}
this.headerTitle = title
? title + (this.headerTitle ? " / " : "") + this.headerTitle
: "" : ""
if (val?.parentId && +val?.parentId !== 1) { if (val?.parentId && +val?.parentId !== 1) {
return this.findTitle( return this.findTitle(
......
...@@ -312,5 +312,276 @@ export const routerName = { ...@@ -312,5 +312,276 @@ export const routerName = {
activePath: "/returnManage" activePath: "/returnManage"
}, },
component: _import("stockManage/returnManage/reviewPage") component: _import("stockManage/returnManage/reviewPage")
},
90809: {
path: "/transferOperationsReview",
name: "transferOperationsReview",
meta: {
title: "运营审核",
authId: "90809",
parentId: "908",
cache: false
},
auth: [
{
authId: "9080901",
parentId: "90809",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9080902",
parentId: "90809",
label: "查看",
handle: "look"
},
{
authId: "9080903",
parentId: "90809",
label: "审批",
handle: "handleReview",
addRoutePath: [
{
authId: "908090301",
name: "审批",
parentId: "90809"
}
]
},
{
authId: "9080904",
parentId: "90809",
label: "驳回",
handle: "handleReject",
addRoutePath: [
{
authId: "908090401",
name: "驳回",
parentId: "90809"
}
]
}
],
component: _import("stockManage/transferOperationsReview/index")
},
90810: {
path: "/transferCommercialReview",
name: "transferCommercialReview",
meta: {
title: "商务审核",
authId: "90810",
parentId: "908",
cache: false
},
auth: [
{
authId: "9081001",
parentId: "90810",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9081002",
parentId: "90810",
label: "查看",
handle: "look"
},
{
authId: "9081003",
parentId: "90810",
label: "审批",
handle: "handleReview",
addRoutePath: [
{
authId: "908100301",
name: "审批",
parentId: "90810"
}
]
},
{
authId: "9081004",
parentId: "90810",
label: "驳回",
handle: "handleReject",
addRoutePath: [
{
authId: "908100401",
name: "驳回",
parentId: "90810"
}
]
}
],
component: _import("stockManage/transferCommercialReview/index")
},
90811: {
path: "/transferShipment",
name: "transferShipment",
meta: {
title: "调拨发货",
authId: "90811",
parentId: "908",
cache: false
},
auth: [
{
authId: "9081101",
parentId: "90811",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9081102",
parentId: "90811",
label: "批量发货",
category: "Button",
type: "primary",
handle: "batchShipment"
},
{
authId: "9081103",
parentId: "90811",
label: "查看",
handle: "handleDetail"
},
{
authId: "9081104",
parentId: "90811",
label: "发货",
handle: "handleShipment"
},
{
authId: "9081105",
parentId: "90811",
label: "驳回",
handle: "handleReject"
}
],
component: _import("stockManage/transferShipment/index")
},
90812: {
path: "/shippingDocument",
name: "shippingDocument",
meta: {
title: "发货单",
authId: "90812",
parentId: "908",
cache: false
},
auth: [
{
authId: "9081201",
parentId: "90812",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9081202",
parentId: "90812",
label: "查看",
handle: "handleDetail"
},
{
authId: "9081203",
parentId: "90812",
label: "发货签收单",
handle: "handleSign"
}
],
component: _import("stockManage/shippingDocument/index")
},
90813: {
path: "/inventoryTransactionRecords",
name: "inventoryTransactionRecords",
meta: {
title: "出入库记录",
authId: "90813",
parentId: "908",
cache: false
},
auth: [
{
authId: "9081301",
parentId: "90813",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
}
],
component: _import("stockManage/inventoryTransactionRecords/index")
},
908090301: {
path: "/transferOperationsReview/handleReview",
name: "handleReview",
meta: {
title: "审批",
authId: "908090301",
parentId: "90809",
cache: false,
dynamicTitle: (route) => {
if (route.query.reviewType === "operator") return "运营审核"
if (route.query.reviewType === "business") return "商务审核"
return "审批"
}
},
component: _import("stockManage/transferOperationsReview/handleReview")
},
908090401: {
path: "/transferOperationsReview/handleReject",
name: "handleReject",
meta: {
title: "驳回",
authId: "908090401",
parentId: "90809",
cache: false,
dynamicTitle: (route) => {
if (route.query.reviewType === "operator") return "运营驳回"
if (route.query.reviewType === "business") return "商务驳回"
return "驳回"
}
},
component: _import("stockManage/transferOperationsReview/handleReject")
},
908100301: {
path: "/transferOperationsReview/handleReview",
name: "handleReview",
meta: {
title: "审批",
authId: "908100301",
parentId: "90810",
cache: false,
dynamicTitle: (route) => {
if (route.query.reviewType === "operator") return "运营审核"
if (route.query.reviewType === "business") return "商务审核"
return "审批"
}
},
component: _import("stockManage/transferOperationsReview/handleReview")
},
908100401: {
path: "/transferOperationsReview/handleReject",
name: "handleReject",
meta: {
title: "驳回",
authId: "908100401",
parentId: "90810",
cache: false,
dynamicTitle: (route) => {
if (route.query.reviewType === "operator") return "运营驳回"
if (route.query.reviewType === "business") return "商务驳回"
return "驳回"
}
},
component: _import("stockManage/transferOperationsReview/handleReject")
} }
} }
...@@ -11,14 +11,34 @@ ...@@ -11,14 +11,34 @@
label-width="150px" label-width="150px"
:inline="true"> :inline="true">
<el-form-item label="订单编号:" class="form-item-half"> <el-form-item label="订单编号:" class="form-item-half">
{{ detailInfo.orderCode ? detailInfo.orderCode : "--" }} <ellipsisText :content="detailInfo.orderCode"></ellipsisText>
</el-form-item> </el-form-item>
<el-form-item v-if="detailInfo.oldOrderCode" label="原错误订单编号:" class="form-item-half"> <el-form-item v-if="detailInfo.oldOrderCode" label="原错误订单编号:" class="form-item-half">
{{ detailInfo.oldOrderCode ? detailInfo.oldOrderCode : "--" }} <ellipsisText :content="detailInfo.oldOrderCode"></ellipsisText>
</el-form-item>
<el-form-item label="订单类型:" class="form-item-half">
<ellipsisText :content="djOrderTypeMap[detailInfo.djOrderType]"></ellipsisText>
</el-form-item> </el-form-item>
<el-form-item label="订单类型:" class="form-item-half">{{ djOrderTypeMap[detailInfo.djOrderType] }}</el-form-item>
<el-form-item label="总价:" class="form-item-half">{{ detailInfo.finalPrice }}</el-form-item> <el-form-item label="总价:" class="form-item-half">{{ detailInfo.finalPrice }}</el-form-item>
<el-form-item label="提单人:" class="form-item-half">{{ detailInfo.sellerName }}<span class="split">|</span>{{ detailInfo.merchantName }}</el-form-item> <el-form-item label="提单人:" class="form-item-half">
<ellipsisText :popover-content="billerFullText">
<span>{{ detailInfo.sellerName }}</span>
<span class="split" v-if="detailInfo.sellerName && detailInfo.merchantName"> | </span>
<span>{{ detailInfo.merchantName }}</span>
</ellipsisText>
</el-form-item>
<el-form-item label="备注:" class="form-item-half">
<ellipsisText :content="detailInfo.orderRemark"></ellipsisText>
</el-form-item>
<el-form-item label="交易流水号:" :class="detailInfo.oldOrderCode ? '' : 'form-item-half'">
<ellipsisText :content="detailInfo.outTradeNo"></ellipsisText>
</el-form-item>
<el-form-item label="凭证:">
<div class="image-box" v-if="detailInfo.payVoucherList && detailInfo.payVoucherList.length">
<img class="image-item" v-for="(item, index) in detailInfo.payVoucherList" :key="index" @click="handleImg(detailInfo.payVoucherList, 'payVoucher', index)" :src="item.payVoucher" alt="" />
</div>
<div v-else>-</div>
</el-form-item>
</el-form> </el-form>
</div> </div>
<template v-if="detailInfo.oldOrderCode"> <template v-if="detailInfo.oldOrderCode">
...@@ -131,13 +151,20 @@ ...@@ -131,13 +151,20 @@
</el-form> </el-form>
</div> </div>
</div> </div>
<el-image-viewer v-if="imgVisible" :on-close="closeImgViewer" :url-list="imgList" :initial-index="initialIndex" />
</baseDialog> </baseDialog>
</template> </template>
<script> <script>
import { djOrderTypeMap, discountTypeMap } from "@/common/constants" import { djOrderTypeMap, discountTypeMap } from "@/common/constants"
import { getAuditOrderDetail, auditGoodsOrderApplyRecord } from "@api/order" import { getAuditOrderDetail, auditGoodsOrderApplyRecord } from "@api/order"
import ellipsisText from './ellipsisText'
export default { export default {
name: "ApprovalDialog", name: "ApprovalDialog",
components: {
ellipsisText,
"el-image-viewer": () =>
import("element-ui/packages/image/src/image-viewer")
},
props: { props: {
approvalVisible: { approvalVisible: {
type: Boolean, type: Boolean,
...@@ -156,6 +183,13 @@ export default { ...@@ -156,6 +183,13 @@ export default {
set(newVal) { set(newVal) {
this.$emit('dialogClose', { flag: newVal }) this.$emit('dialogClose', { flag: newVal })
} }
},
billerFullText() {
const { sellerName, merchantName } = this.detailInfo
if (sellerName && merchantName) return `${sellerName} | ${merchantName}`
if (sellerName) return sellerName
if (merchantName) return merchantName
return '--'
} }
}, },
data() { data() {
...@@ -171,7 +205,8 @@ export default { ...@@ -171,7 +205,8 @@ export default {
}, },
formObj: { formObj: {
remark: '' remark: ''
} },
imgVisible: false
} }
}, },
created() { created() {
...@@ -195,6 +230,15 @@ export default { ...@@ -195,6 +230,15 @@ export default {
this.detailInfo = res this.detailInfo = res
}) })
}, },
handleImg(url, name, index) {
this.imgVisible = !this.imgVisible
this.initialIndex = index
this.imgList = url.map((item) => item[name])
this.imgUrlName = name
},
closeImgViewer() {
this.imgVisible = false
},
// 处理商品数据 // 处理商品数据
flattenGoodsOrder(data) { flattenGoodsOrder(data) {
const result = [] const result = []
...@@ -255,6 +299,13 @@ export default { ...@@ -255,6 +299,13 @@ export default {
.form-item-half { .form-item-half {
width: calc(50% - 10px) !important; width: calc(50% - 10px) !important;
display: inline-block; display: inline-block;
::v-deep .el-form-item__content {
width: calc(100% - 162px);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
} }
.textarea-input { .textarea-input {
width: 585px; width: 585px;
...@@ -263,4 +314,16 @@ export default { ...@@ -263,4 +314,16 @@ export default {
.split { .split {
margin: 0 5px; margin: 0 5px;
} }
.image-box {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
.image-item {
width: 48px;
height: 48px;
border-radius: 4px;
overflow: hidden;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template>
<el-popover
placement="top"
trigger="hover"
:content="finalPopoverContent"
:disabled="!isOverflow"
width="400"
>
<span
ref="text"
slot="reference"
class="ellipsis"
@mouseenter="checkOverflow"
>
<slot>
{{ content || '--' }}
</slot>
</span>
</el-popover>
</template>
<script>
export default {
name: 'EllipsisText',
props: {
content: [String, Number],
popoverContent: {
type: String,
default: ''
}
},
data() {
return {
isOverflow: false
};
},
computed: {
finalPopoverContent() {
if (this.popoverContent) return this.popoverContent;
if (this.$slots.default) {
return this.$slots.default[0].text || this.content || '--';
}
return this.content || '--';
}
},
methods: {
checkOverflow() {
const el = this.$refs.text;
if (el) {
this.isOverflow = el.scrollWidth > el.clientWidth;
}
}
},
mounted() {
this.checkOverflow();
},
watch: {
content() {
this.$nextTick(this.checkOverflow);
},
'$slots.default': {
handler() {
this.$nextTick(this.checkOverflow);
},
deep: true
}
}
};
</script>
<style scoped>
.dark-popover {
background-color: #333 !important; /* 深色背景 */
color: #fff !important; /* 白色文字 */
border-color: #333 !important; /* 边框与背景同色 */
max-width: 300px !important; /* 设置最大宽度,可按需调整 */
word-wrap: break-word; /* 长单词换行 */
font-size: 14px; /* 调整字体大小(可选) */
line-height: 1.5; /* 调整行高(可选) */
}
.dark-popover .popper__arrow,
.dark-popover .popper__arrow::after {
border-top-color: #333 !important; /* 箭头颜色(根据 placement 调整方向) */
}
.ellipsis {
display: inline-block;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
vertical-align: middle;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<orderDeatilDialog :visible.sync="detailVisible" v-if="detailVisible" :params-obj="paramsObj"></orderDeatilDialog> <orderDeatilDialog :visible.sync="detailVisible" v-if="detailVisible" :params-obj="paramsObj"></orderDeatilDialog>
<CheckDialog :check-visible="checkVisible" v-if="checkVisible" :params-obj="paramsObj" from-page="procurementBusiness" @dialogClose="dialogClose"> <CheckDialog :check-visible="checkVisible" v-if="checkVisible" :params-obj="paramsObj" from-page="procurementBusiness" @dialogClose="dialogClose">
</CheckDialog> </CheckDialog>
<rejectDialog :reject-visible="rejectVisible" v-if="rejectVisible" :params-obj="paramsObj" :filter-reject-list="[1,2]" @dialogClose="dialogClose"> <rejectDialog :reject-visible="rejectVisible" v-if="rejectVisible" :params-obj="paramsObj" from-page="procurementBusiness" :filter-reject-list="[1,2]" @dialogClose="dialogClose">
</rejectDialog> </rejectDialog>
</d2-container> </d2-container>
</template> </template>
......
...@@ -46,6 +46,48 @@ ...@@ -46,6 +46,48 @@
:table-params="tableParams" :table-params="tableParams"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn"
> >
<template slot="remark" slot-scope="scope">
<div v-if="scope.scope.remark">
<el-popover v-if="scope.scope.remark.length > 12" placement="top" effect="dark" width="300" trigger="hover">
<div class="merchant-name-box">
{{ spanFilter(scope.scope.remark) }}
</div>
<div slot="reference">
{{ spanFilter(scope.scope.remark, 12) }}
</div>
</el-popover>
<div v-else>{{ scope.scope.remark }}</div>
</div>
<span v-else>-</span>
</template>
<template slot="receiver" slot-scope="scope">
<div v-if="scope.scope.receiver">
<el-popover v-if="scope.scope.receiver.length > 12" placement="top" effect="dark" width="300" trigger="hover">
<div class="merchant-name-box">
{{ spanFilter(scope.scope.receiver) }}
</div>
<div slot="reference">
{{ spanFilter(scope.scope.receiver, 12) }}
</div>
</el-popover>
<div v-else>{{ scope.scope.receiver }}</div>
</div>
<span v-else>-</span>
</template>
<template slot="address" slot-scope="scope">
<div v-if="scope.scope.address">
<el-popover v-if="scope.scope.address.length > 12" placement="top" effect="dark" width="300" trigger="hover">
<div class="merchant-name-box">
{{ spanFilter(scope.scope.address) }}
</div>
<div slot="reference">
{{ spanFilter(scope.scope.address, 12) }}
</div>
</el-popover>
<div v-else>{{ scope.scope.address }}</div>
</div>
<span v-else>-</span>
</template>
<auth-button <auth-button
slot="auth-button" slot="auth-button"
slot-scope="scope" slot-scope="scope"
...@@ -55,12 +97,15 @@ ...@@ -55,12 +97,15 @@
</div> </div>
</d2-container> </d2-container>
<!-- 查看 --> <!-- 查看 -->
<allocation-detail-dialog <!-- <allocation-detail-dialog
:allocation-detail-visible="allocationDetailVisible" :allocation-detail-visible="allocationDetailVisible"
:record-info="recordInfo" :record-info="recordInfo"
v-if="allocationDetailVisible" v-if="allocationDetailVisible"
@dialogClose="dialogClose" @dialogClose="dialogClose"
/> /> -->
<transferDetailDialog :visible.sync="transferDetailVisible"
v-if="transferDetailVisible"
:params-obj="transferObj"></transferDetailDialog>
</div> </div>
</template> </template>
...@@ -75,10 +120,12 @@ import { ...@@ -75,10 +120,12 @@ import {
getServicemerchantrefList getServicemerchantrefList
} from "@api/stockManage" } from "@api/stockManage"
import allocationDetailDialog from "./allocationDetailDialog" import allocationDetailDialog from "./allocationDetailDialog"
import transferDetailDialog from '../components/transferDetailDialog.vue'
export default { export default {
name: "AllocationList", name: "AllocationList",
components: { components: {
allocationDetailDialog allocationDetailDialog,
transferDetailDialog
}, },
data () { data () {
return { return {
...@@ -89,7 +136,9 @@ export default { ...@@ -89,7 +136,9 @@ export default {
callOutYqMerchantId: "", callOutYqMerchantId: "",
callInYqMerchantId: "", callInYqMerchantId: "",
callOutMerchantId: "", callOutMerchantId: "",
callInMerchantId: "" callInMerchantId: "",
billStatusList: "",
deliveryStatus: ""
}, },
searchFormSearch: {}, searchFormSearch: {},
searchSelectObj: { searchSelectObj: {
...@@ -164,6 +213,24 @@ export default { ...@@ -164,6 +213,24 @@ export default {
optionId: "merchantId", optionId: "merchantId",
optionLabel: "merchantName", optionLabel: "merchantName",
optionsName: "inMerchantList" optionsName: "inMerchantList"
},
{
label: "单据状态",
name: "billStatusList",
type: "select",
optionList: [],
optionId: 'confId',
optionLabel: "confLabel",
optionsName: "billStatusListOptions"
},
{
label: "发货状态",
name: "deliveryStatus",
type: "select",
optionList: [],
optionId: 'confId',
optionLabel: "confLabel",
optionsName: "deliveryStatusList"
} }
], ],
getListApi: stockAllocatePage, getListApi: stockAllocatePage,
...@@ -178,6 +245,44 @@ export default { ...@@ -178,6 +245,44 @@ export default {
width: "200px" width: "200px"
}, },
{ {
label: "单据时间",
prop: "",
width: "150px",
formatter: (cellValue) => {
return cellValue.submitTime
? Util.dateFormate(
cellValue.submitTime,
"YYYY-MM-DD HH:mm:ss"
)
: "-"
}
},
{
label: "单据状态",
prop: "billStatus",
width: "120px",
formatter: (cellValue) => {
const status = String(cellValue.billStatus);
const isReject = ['4', '6', '7'].includes(status);
return isReject
? '审核驳回'
: this.baseData.billStatusListOptions?.find(val => val.confId === status)?.confLabel || '-'
},
className: (cellValue) => {
const status = String(cellValue.billStatus)
return {
'0': 'yellowSpot',
'1': 'yellowSpot',
'2': 'yellowSpot',
'5': 'greenSpot',
'4': 'redSpot',
'6': 'redSpot',
'7': 'redSpot',
'-1': 'ashSpot'
}[status]
}
},
{
label: "调拨时间", label: "调拨时间",
prop: "allocateTime", prop: "allocateTime",
width: "150px", width: "150px",
...@@ -220,8 +325,41 @@ export default { ...@@ -220,8 +325,41 @@ export default {
prop: "deliveryCompany" prop: "deliveryCompany"
}, },
{ {
label: "发货状态",
prop: "deliveryStatus",
width: "120px",
formatter: (cellValue) => {
return this.baseData.deliveryStatusList?.find(val => val.confId == cellValue.deliveryStatus)?.confLabel || '-'
},
className: (cellValue) => {
const status = String(cellValue.deliveryStatus)
return {
'1': 'ashSpot',
'3': 'yellowSpot',
'2': 'greenSpot'
}[status]
}
},
{
label: "备注", label: "备注",
prop: "remark" prop: "remark",
width: 120,
addHtml: "remark"
},
{
label: "收货人",
prop: "receiver",
addHtml: 'receiver'
},
{
label: "收货人电话",
width: "120px",
prop: "phone"
},
{
label: "收货地址",
prop: "address",
addHtml: 'address'
} }
] ]
}, },
...@@ -229,10 +367,39 @@ export default { ...@@ -229,10 +367,39 @@ export default {
productTypeList: [], productTypeList: [],
yqRelatedMerchantList: [], yqRelatedMerchantList: [],
outMerchantList: [], // 调出门店 outMerchantList: [], // 调出门店
inMerchantList: [] // 调入门店 inMerchantList: [], // 调入门店
billStatusListOptions: [{
confId: '0',
confLabel: '待提交'
}, {
confId: '1',
confLabel: '运营审核'
}, {
confId: '2',
confLabel: '商务审核'
}, {
confId: '4',
confLabel: '审核驳回'
}, {
confId: '5',
confLabel: '审核通过'
}, {
confId: '-1',
confLabel: '作废'
}],
deliveryStatusList: [{
confId: '1',
confLabel: '未发货'
}, {
confId: '3',
confLabel: '部分发货'
}, {
confId: '2',
confLabel: '全部发货'
}]
}, },
allocationDetailVisible: false, transferDetailVisible: false,
recordInfo: null recordInfo: null
} }
}, },
...@@ -272,7 +439,18 @@ export default { ...@@ -272,7 +439,18 @@ export default {
// async getBaseData() { // async getBaseData() {
// this.getOptionsList() // this.getOptionsList()
// }, // },
spanFilter(ele, lenght) {
if (ele) {
const text = `${ele}`
return lenght
? text?.length > lenght
? text.substring(0, lenght) + "\u2026"
: text.substring(0, lenght)
: text
} else {
return "-"
}
},
beforeSearchFn () { beforeSearchFn () {
return new Promise((resolve) => { return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
...@@ -288,6 +466,10 @@ export default { ...@@ -288,6 +466,10 @@ export default {
) + " 23:59:59" ) + " 23:59:59"
} }
delete this.searchFormSearch.allocateTime delete this.searchFormSearch.allocateTime
if (this.searchFormSearch.billStatusList) {
// 审批驳回包含 4 6 7三个枚举值
this.searchFormSearch.billStatusList = this.searchFormSearch.billStatusList == 4 ? [4, 6, 7] : [this.searchFormSearch.billStatusList]
}
resolve() resolve()
}) })
}, },
...@@ -356,17 +538,26 @@ export default { ...@@ -356,17 +538,26 @@ export default {
callOutYqMerchantId: "", callOutYqMerchantId: "",
callInYqMerchantId: "", callInYqMerchantId: "",
callOutMerchantId: "", callOutMerchantId: "",
callInMerchantId: "" callInMerchantId: "",
billStatusList: "",
deliveryStatus: ""
} }
this.baseData.outMerchantList = [] // 调出门店 this.baseData.outMerchantList = [] // 调出门店
this.baseData.inMerchantList = [] // 调入门店 this.baseData.inMerchantList = [] // 调入门店
this.getOptionsList() this.getOptionsList()
this.$refs.recordTable.refreshTable() this.$refs.recordTable.refreshTable(true)
}, },
async handleExport () { async handleExport () {
await this.beforeSearchFn() await this.beforeSearchFn()
var params = this.searchFormSearch var params = this.searchFormSearch
if (params.billStatusList.length) {
params.billStatusList.forEach((item, index) => {
const name = `billStatusList[${index}]`
params[name] = item
})
delete params.billStatusList
}
params.method = "dj.smartcarlife.api.stock.allocate.export.async" params.method = "dj.smartcarlife.api.stock.allocate.export.async"
const list = [ const list = [
...this.dowloadList, ...this.dowloadList,
...@@ -382,17 +573,17 @@ export default { ...@@ -382,17 +573,17 @@ export default {
// 查看 // 查看
look (row) { look (row) {
this.recordInfo = row this.transferObj = row
this.allocationDetailVisible = true this.transferDetailVisible = true
}, },
gotoAdd () { gotoAdd () {
this.$router.push({ name: "addAllocation" }) this.$router.push({ name: "addAllocation" })
}, },
dialogClose (flag) { // dialogClose (flag) {
this.allocationDetailVisible = !this.allocationDetailVisible // this.allocationDetailVisible = !this.allocationDetailVisible
} // }
} }
} }
</script> </script>
......
<template>
<el-tooltip :content="content || ''" :disabled="isDisabled" :placement="placement" effect="dark">
<div class="ellipsis-tooltip-content" @mouseenter="checkOverflow">
<slot>{{ content || '-' }}</slot>
</div>
</el-tooltip>
</template>
<script>
export default {
name: 'EllipsisTooltip',
props: {
content: {
type: [String, Number],
default: ''
},
placement: {
type: String,
default: 'top'
}
},
data() {
return {
isDisabled: true
}
},
methods: {
checkOverflow(e) {
const target = e.target
if (target.scrollWidth > target.clientWidth) {
this.isDisabled = false
} else {
this.isDisabled = true
}
}
}
}
</script>
<style scoped>
.ellipsis-tooltip-content {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}
</style>
<!-- 库存明细弹窗 -->
<template>
<d2-dialog
title="库存明细"
:is-visible="dialogVisible"
class="stockMonthDailog"
width="50%"
:no-cancel="false"
btn-ok-label="确定"
btn-cancel-label="取消"
@closeDialog="handleClose"
@confirmDialog="handleClose"
:appendToBody="true"
>
<div class="d2-container-content">
<div class="search-box">
<el-input
v-model="searchForm.merchantName"
size="small"
placeholder="请输入商户名称"
prefix-icon="el-icon-search"
style="width: 200px; margin-right: 10px"
></el-input>
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
</el-button>
</div>
<d2-table
ref="recordTable"
:get-list-api="getListApi"
:search-form="searchForm"
:table-params="tableParams"
>
</d2-table>
</div>
</d2-dialog>
</template>
<script>
import { mapActions, mapState } from "vuex"
import { merchantShopGoodsStockPageH5 } from "@api/stockManage"
import { baseConfig } from "@/main"
export default {
name: "StockDetailDialog",
props: {
visible: {
type: Boolean,
default: false
},
recordInfo: {
type: Object,
default: () => {}
}
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
membraneTypeList: baseConfig.membraneTypeList,
searchForm: {
upgradeGoodsId: "",
merchantName: ""
// yqMerchantId: ""
},
getListApi: merchantShopGoodsStockPageH5,
tableData: [],
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
// tableOption: false,
tableColumns: [
{
label: "门店",
prop: "merchantName"
},
{
label: "当前库存",
prop: "stock",
// width: ''
formatter: (cellValue) => {
return cellValue.stock || cellValue.stock == 0
? parseFloat(cellValue.stock).toFixed(2) +
(this.membraneTypeList.includes(cellValue.goodsType)
? "米"
: "件")
: "-"
}
},
{
label: "膜卷号",
prop: "filmRollNo",
formatter: (cellValue) => {
return cellValue?.filmRollNo || "-"
}
}
]
}
}
},
computed: {
dialogVisible: {
get() {
return this.visible
},
set(val) {
this.$emit("update:visible", val)
}
}
},
mounted() {
if (this.recordInfo) {
// this.searchForm.yqMerchantId = this.recordInfo.yqMerchantId
this.searchForm.upgradeGoodsId = this.recordInfo.upgradeGoodsId
}
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close"
}),
// beforeSearchFn() {
// return new Promise(resolve => {
// this.searchFormSearch = deepClone(this.searchForm)
// resolve()
// })
// },
// chooseYear() {
// this.getList()
// },
// handleSearch() {
// this.$refs.recordTable.handleSearch()
// },
handleReset() {
// this.handleSearch()
this.searchForm.merchantName = ""
// this.$refs.showSearch.handleReset(true, true)
},
handleClose() {
// this.$emit('dialogClose')
this.dialogVisible = false
}
}
}
</script>
<style scoped lang="scss">
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.stockMonthDailog ::v-deep.el-dialog__body {
padding: 0px 20px;
.d2-container-content {
padding: 0px 0px !important;
}
}
.stockMonthDailog .el-dialog {
margin-top: 20vh !important;
min-width: 700px;
}
.stockMonthDailog .btn-tips img {
width: 18px;
height: 15px;
margin-right: 9px;
vertical-align: bottom;
}
.stockMonthDailog .btn-tips {
display: inline-block;
font-size: 12px;
height: 14px;
line-height: 14px;
background-color: #fff2e5;
color: #999999;
margin-right: 24px;
padding: 6.5px 10px;
}
.search-box {
display: flex;
margin-bottom: 15px;
}
</style>
<!-- 出入库记录 -->
<template>
<d2-container class="container">
<div class="header" slot="header">
<d2-search ref="showSearch" class="show-search" labelWidth="120px" :search-form="searchForm" :form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary" handle>
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<span>
<auth-button category="Button" :show-btn-ids="['9081301']" />
</span>
</d2-table-header>
<d2-table ref="purchasementReviewTable" :search-form="tableSearchForm" :table-params="tableParams" :table-data="tableData" :selectable-fn="selectableFn" :get-list-api="getListApi" :before-search-fn="beforeSearchFn">
</d2-table>
</div>
</d2-container>
</template>
<script>
import { getInventoryTransactionRecordsPage } from '@api/stockManage'
import { Util, deepClone } from '@/common/util'
import { mapState, mapActions } from 'vuex'
import { baseConfig } from '@/main'
import { upgradeFlags } from '@/common/constants.js'
export default {
name: 'TransferShipment',
data() {
return {
membraneTypeList: baseConfig.membraneTypeList,
searchForm: {
transactionTimeStr: '',
upgradeGoodsName: '',
productCode: '',
businessCode: '',
queryFlowTypes: []
},
tableSearchForm: {},
tableData: [],
showFormData: [
{
label: '出入库时间',
name: 'transactionTimeStr',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
},
{
label: '出入库类型',
name: 'queryFlowTypes',
multiple: true,
collapseTags: true,
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'queryFlowTypesOptions'
},
{
label: '出入库单号',
name: 'businessCode',
type: 'input',
isClear: true,
maxlength: 50
},
{
label: '商品名称',
name: 'upgradeGoodsName',
type: 'input',
isClear: true,
maxlength: 50
},
{
label: '商品编码',
name: 'productCode',
type: 'input',
isClear: true,
maxlength: 50
}
],
getListApi: getInventoryTransactionRecordsPage,
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
{
label: '出入库时间',
prop: 'flowTime',
width: 150
},
{
label: '商品名称',
prop: 'upgradeGoodsName'
},
{
label: '商品编码',
prop: 'productCode'
},
{
label: '规格',
prop: 'specificationData'
},
{
label: '系列',
prop: 'goodsSeries'
},
{
label: '所属分类',
prop: 'goodsTypeName'
},
{
label: '领料技师',
prop: 'technicianName'
},
{
label: '出入库数量',
prop: 'stockNum',
width: 120,
formatter: (cellValue) => {
return (cellValue.stockNum || cellValue.stockNum == 0) ? parseFloat(cellValue.stockNum).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
},
{
label: '出入库类型',
prop: 'flowType',
width: 120,
formatter: (cellValue) => {
return this.baseData.queryFlowTypesOptions?.find(val => val.confId == cellValue.flowType)?.confLabel || '-'
}
},
{
label: '出入库金额',
prop: 'stockMoney',
width: 120,
formatter: (cellValue) => {
return cellValue.stockMoney || cellValue.stockMoney === 0
? "¥" + cellValue.stockMoney
: "-"
}
},
{
label: '关联业务单号',
prop: 'businessCode',
width: 120,
},
{
label: '关联发货单号',
prop: 'deliveryNumber',
width: 120,
},
{
label: '膜卷号',
prop: 'filmRollNo'
},
{
label: '订单类型',
prop: 'upgradeFlag',
width: 130,
formatter: (cellValue) => {
return this.baseData.upgradeFlags.find(item => item.confId == cellValue.upgradeFlag)?.confValue || '-'
}
},
{
label: '出入库仓库',
prop: 'yqMerchantName',
width: 120,
},
{
label: '出入库门店',
prop: 'merchantName',
width: 120,
},
{
label: '操作人',
prop: 'operator'
}
]
},
// 基本数据
baseData: {
queryFlowTypesOptions: [{
confId: '101',
confLabel: '领料出库'
}, {
confId: '102',
confLabel: '盘点出库'
}, {
confId: '103',
confLabel: '调拨出库'
}, {
confId: '104',
confLabel: '退货出库'
}, {
confId: '201',
confLabel: '商城采购入库'
}, {
confId: '202',
confLabel: '盘点入库'
}, {
confId: '203',
confLabel: '调拨入库'
}, {
confId: '204',
confLabel: '退料入库'
}, {
confId: '205',
confLabel: '自采入库'
}],
upgradeFlags: upgradeFlags
},
paramsObj: {}
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
this.getBaseData()
},
methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
getBaseData() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName]) {
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
selectableFn(row, index) {
return row.status == 1 && row.sendOutMerchantId != null
},
beforeSearchFn() {
return new Promise(resolve => {
this.filterSearchTime()
resolve()
})
},
filterSearchTime() {
this.tableSearchForm = deepClone(this.searchForm)
if (this.tableSearchForm.transactionTimeStr) {
this.tableSearchForm.startDate = new Date(this.tableSearchForm.transactionTimeStr[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
this.tableSearchForm.endDate = new Date(this.tableSearchForm.transactionTimeStr[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete this.tableSearchForm.transactionTimeStr
},
handleReset() {
this.searchForm = {
transactionTimeStr: '',
upgradeGoodsName: '',
productCode: '',
businessCode: '',
queryFlowTypes: []
}
this.$refs.purchasementReviewTable.refreshTable(true)
},
handleExport() {
this.filterSearchTime()
var params = this.tableSearchForm
if (params.queryFlowTypes.length > 0) {
params.queryFlowTypes.forEach((item, index) => {
const name = `queryFlowTypes[${index}]`
params[name] = item
})
}
delete params.queryFlowTypes
console.log(params)
params.method = 'dj.api.smartcarlife.StockFlow.export.async'
const list = [
...this.dowloadList,
{
name: '出入库记录',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
}
}
</script>
<style lang="scss" scoped></style>
\ No newline at end of file \ No newline at end of file
<!-- 发货单详情弹窗 -->
<template>
<div>
<d2-dialog title="详细信息" :is-visible="detailVisible" class="stockMonthDailog" width="1400px" :no-cancel="true" :isShowFooter="false" @closeDialog="handleClose" @confirmDialog="handleClose">
<div class="address-info">
<div class="info-item" v-for="(item, index) in infoList" :key="index" :class="{ 'remark-item': item.isRemark }">
<span class="label-name">{{ item.label }}:</span>
<ellipsis-tooltip class="label-value" :content="detailInfo[item.prop]" />
</div>
</div>
<template v-for="(item, index) in detailInfo.deliveryDetailList">
<div class="table-wrap" :key="index">
<div class="detail-info border-b">
<div class="item wid-40">
商品名称:
<span>{{ item.upgradeGoodsName }}&nbsp;&nbsp;&nbsp;&nbsp; {{item.specificationData}}</span>
</div>
<div class="item wid-30">
发货数量:
<span>{{ item.purchaseNumber + (baseConfig.membraneTypeList.includes(item.goodsType) ? '米' : '件') }}</span>
</div>
<div class="item wid-30">
可用库存数量:
<span>{{ item.stockNum + (baseConfig.membraneTypeList.includes(item.goodsType) ? '米' : '件') }}</span>
</div>
</div>
<d2-table ref="recordTable" v-if="item.deliveryCardList === null || item.deliveryCardList.length == 0" :table-data="item.goodsWarehousingList" :table-params="tableParams" :has-page="false">
<template slot="filmRollNo" slot-scope="scope">
<div v-if="scope.scope.filmRollList && scope.scope.filmRollList.length == 1">
{{ scope.scope.filmRollList[0] }}
</div>
<div v-else-if="scope.scope.filmRollList && scope.scope.filmRollList.length > 1">
<el-popover placement="top" width="200" trigger="hover">
<div class="film-roll-box">
<div class="title">膜卷号</div>
<div class="merchant-item" v-for="(subItem, subIndex) in scope.scope.filmRollList" :key="subIndex">
{{ subItem }}
</div>
</div>
<div slot="reference">
<span style="color: #2A58AD;">(…{{ scope.scope.filmRollList.length }})</span>
</div>
</el-popover>
</div>
<div v-else>
<span style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{ '-' }}</span>
</div>
</template>
</d2-table>
<div v-else class="message">
已自动入库至商户的权益卡管理中,可前往“库存管理-权益卡管理”中查询
</div>
</div>
</template>
</d2-dialog>
</div>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { getDeliveryDetail } from '@/api/stockManage.js'
import { baseConfig } from '@/main'
import EllipsisTooltip from '../../components/EllipsisTooltip.vue'
export default {
name: 'DeliveryDetailDialog',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
detailInfo: {},
searchFormSearch: {},
// tableData: [],
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
// singleSelectUniqueKey: 'id',
tableOption: false,
tableColumns: [{
label: '入库数量',
prop: 'increaseStockNum',
// width: '200px'
formatter: (cellValue) => {
return (cellValue.increaseStockNum || cellValue.increaseStockNum == 0) ? (baseConfig.membraneTypeList.includes(cellValue.goodsType) ? parseFloat(cellValue.increaseStockNum / cellValue.alternateUnits).toFixed(2) : parseFloat(cellValue.increaseStockNum).toFixed(2)) + (baseConfig.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
}, {
label: '膜卷号',
name: '',
type: 'slot',
addHtml: 'filmRollNo'
}, {
label: '入库仓库',
prop: 'yqMerchantName'
// width: '150px'
}, {
label: '入库门店',
prop: 'merchantName'
// width: '200px'
}]
},
baseData: {},
infoList: [
{ label: '收货人', prop: 'contactName' },
{ label: '收货人电话', prop: 'contactPhone' },
{ label: '收货地址', prop: 'contactAddress' },
{ label: '发货单号', prop: 'deliveryNumber' },
{ label: '发货仓库', prop: 'shippingWarehouseName' },
{ label: '承运公司', prop: 'deliveryCompany' },
{ label: '发货时间', prop: 'deliveryDate' }
]
}
},
components: {
EllipsisTooltip
},
props: {
detailVisible: {
type: Boolean,
default: false
},
recordInfo: {
type: Object,
default: () => { }
}
},
computed: {
},
mounted() {
this.getDetail()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
getDetail() {
var params = { id: deepClone(this.recordInfo.id) }
getDeliveryDetail(params).then(res => {
this.detailInfo = res
if (this.detailInfo.deliveryDate) {
this.detailInfo.deliveryDate = Util.dateFormate(this.detailInfo.deliveryDate, 'YYYY-MM-DD HH:mm:ss')
}
const _deliveryDetailList = this.detailInfo.deliveryDetailList
if (_deliveryDetailList && _deliveryDetailList.length > 0) {
_deliveryDetailList.forEach(info => {
const _goodsWarehousingList = info.goodsWarehousingList
if (_goodsWarehousingList && _goodsWarehousingList.length > 0) {
_goodsWarehousingList.forEach(item => {
item.goodsType = info.goodsType
// 换算单位
item.alternateUnits = info?.stockNum / info?.purchaseNumber
})
}
})
}
})
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style lang="scss" scoped>
.detail-info {
display: flex;
color: #666666ff;
font-size: 14px;
margin-bottom: 16px;
flex-wrap: wrap;
.item {
width: 33%;
margin-bottom: 8px;
display: flex;
}
.wid-40 {
width: 40%;
}
.wid-30 {
width: 30%;
}
span {
color: #333333ff;
width: calc(100% - 100px);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
}
.address-info {
display: flex;
box-sizing: border-box;
flex-wrap: wrap;
width: 100%;
padding: 0 20px;
margin-top: 10px;
font-size: 14px;
color: #666666;
.info-item {
width: 33.33%;
display: flex;
align-items: center;
margin-bottom: 10px;
padding-right: 15px;
box-sizing: border-box;
.label-name {
white-space: nowrap;
min-width: fit-content;
}
.label-value {
flex: 1;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
}
&.remark-item {
flex-grow: 1;
width: 33.33%;
}
}
}
.border-b {
border-bottom: 1px solid #e5e5e5;
margin-bottom: 12px;
}
.film-roll-box {
font-size: 12px;
color: #666666;
.title {
font-weight: 500;
color: #3a3a3a;
margin-bottom: 8px;
}
}
.deliveryCardCon {
max-height: 60vh;
overflow: auto;
}
.lookNumber {
// font-size: 14px;
// color: ;
// color: #5850ff!important;
cursor: pointer;
margin-left: 8px;
}
.table-wrap {
box-sizing: border-box;
margin-top: 16px;
}
</style>
<!-- 发货单 -->
<template>
<d2-container class="container">
<div class="header" slot="header">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary" handle>
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<span>
<auth-button category="Button" :show-btn-ids="['9081201']" />
</span>
</d2-table-header>
<d2-table ref="purchasementReviewTable" :search-form="tableSearchForm" :table-params="tableParams" :table-data="tableData" :selectable-fn="selectableFn" :get-list-api="getListApi" :before-search-fn="beforeSearchFn">
<template slot="contactName" slot-scope="scope">
<div v-if="scope.scope.contactName">
<el-popover v-if="scope.scope.contactName.length > 12" placement="top" effect="dark" width="300" trigger="hover">
<div class="merchant-name-box">
{{ spanFilter(scope.scope.contactName) }}
</div>
<div slot="reference">
{{ spanFilter(scope.scope.contactName, 12) }}
</div>
</el-popover>
<div v-else>{{ scope.scope.contactName }}</div>
</div>
<span v-else>-</span>
</template>
<template slot="contactAddress" slot-scope="scope">
<div v-if="scope.scope.contactAddress">
<el-popover v-if="scope.scope.contactAddress.length > 12" placement="top" effect="dark" width="300" trigger="hover">
<div class="merchant-name-box">
{{ spanFilter(scope.scope.contactAddress) }}
</div>
<div slot="reference">
{{ spanFilter(scope.scope.contactAddress, 12) }}
</div>
</el-popover>
<div v-else>{{ scope.scope.contactAddress }}</div>
</div>
<span v-else>-</span>
</template>
<div slot="auth-button" slot-scope="scope">
<span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9081202']" />
</span>
<auth-button :data="scope.scope" :show-btn-ids="['9081203']" />
</div>
</d2-table>
</div>
<!-- 查看 -->
<delivery-detail-dialog
:detail-visible="detailVisible"
:record-info="recordInfo"
v-if="detailVisible"
@dialogClose="dialogClose"
/>
</d2-container>
</template>
<script>
import deliveryDetailDialog from "./components/deliveryDetailDialog"
import { getDeliveryPage, deliveryPdf } from '@api/stockManage'
import { Util, deepClone } from '@/common/util'
import { mapState, mapActions } from 'vuex'
export default {
name: 'TransferShipment',
components: {
deliveryDetailDialog
},
data() {
return {
searchForm: {
orderType: 1,
orderCode: '',
callInMerchantName: '',
putStatus: '',
deliveryNumber: '',
deliveryCompany: ''
},
tableSearchForm: {},
tableData: [],
showFormData: [
{
label: '调拨单号',
name: 'orderCode',
type: 'input',
isClear: true
},
{
label: '调拨商户',
name: 'callInMerchantName',
type: 'input',
isClear: true
},
{
label: '状态',
name: 'putStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'putStatusOptions'
},
{
label: '承运单号',
name: 'deliveryNumber',
type: 'input',
isClear: true
},
{
label: '承运公司',
name: 'deliveryCompany',
type: 'input',
isClear: true
},
],
getListApi: getDeliveryPage,
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '调拨单号',
prop: 'orderCode',
width: 150
},
{
label: '承运单号',
prop: 'deliveryNumber'
},
{
label: '承运公司',
prop: 'deliveryCompany'
},
{
label: '调拨人',
prop: 'allocateCreatedBy'
},
{
label: '调入门店',
prop: 'callInMerchantName'
},
{
label: '调入仓库',
prop: 'callInYqMerchantName'
},
{
label: '调出门店',
prop: 'callOutMerchantName'
},
{
label: '调出仓库',
prop: 'callOutYqMerchantName'
},
{
label: '入库状态',
prop: 'putStatus',
formatter: (cellValue) => {
return this.baseData.putStatusOptions.find(item => item.confId === `${cellValue.putStatus}`)?.confLabel || '-'
},
className: (cellValue) => {
return {
0: 'yellowSpot',
1: 'redSpot',
2: 'ashSpot',
3: 'greenSpot'
}[cellValue.putStatus]
}
},
{
label: '收货人',
prop: 'contactName',
width: 120,
addHtml: 'contactName'
},
{
label: '收货人电话',
prop: 'contactPhone'
},
{
label: '收货地址',
prop: 'contactAddress',
width: 120,
addHtml: 'contactAddress'
}
]
},
// 查看门店
detailVisible: false,
// 基本数据
baseData: {
putStatusOptions: [{
confId: '0',
confLabel: '待签收'
}, {
confId: '1',
confLabel: '未入库'
}, {
confId: '2',
confLabel: '已入库'
}, {
confId: '3',
confLabel: '部分入库'
}]
}
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
this.getBaseData()
},
methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
getBaseData() {
const allOpt = {
confId: '',
confLabel: '全部'
}
this.showFormData.forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName]) {
this.baseData[item.optionsName].unshift(allOpt)
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
spanFilter(ele, lenght) {
if (ele) {
const text = `${ele}`
return lenght
? text?.length > lenght
? text.substring(0, lenght) + "\u2026"
: text.substring(0, lenght)
: text
} else {
return "-"
}
},
selectableFn(row, index) {
return row.status == 1 && row.sendOutMerchantId != null
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
getParams() {
var params = deepClone(this.searchForm)
return params
},
handleReset() {
this.searchForm = {
orderType: 1,
orderCode: '',
callInMerchantName: '',
putStatus: '',
deliveryNumber: '',
deliveryCompany: ''
}
this.$refs.purchasementReviewTable.refreshTable(true)
},
handleExport() {
var params = this.tableSearchForm
params.method = 'dj.api.smarcarlife.purchaseOrder.delivery.export.async'
const list = [
...this.dowloadList,
{
// name: '采购审核',
name: '发货单',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
// 查看详情
handleDetail(row) {
this.recordInfo = {
id: row.id
}
this.detailVisible = true
},
dialogClose(flag) {
this.detailVisible = !this.detailVisible
},
// 签收发货单
handleSign(row) {
const params = {
id: row.id
}
deliveryPdf(params).then((res) => {
this.$open(res)
})
}
}
}
</script>
<style lang="scss" scoped></style>
\ No newline at end of file \ No newline at end of file
...@@ -513,11 +513,13 @@ export default { ...@@ -513,11 +513,13 @@ export default {
getFileTypeFromUrl(url) { getFileTypeFromUrl(url) {
if (!url) return "file" if (!url) return "file"
const pathname = url.split("?")[0]
const extension = url.split(".").pop().toLowerCase() const extension = pathname.split(".").pop()?.toLowerCase() || ""
const imageExtensions = ["jpg", "jpeg", "png", "gif", "bmp", "webp"] const imageExtensions = ["jpg", "jpeg", "png", "gif", "bmp", "webp"]
if (imageExtensions.includes(extension)) return "image"
return imageExtensions.includes(extension) ? "image" : "file" // 阿里云 OSS 图片处理:x-oss-process=image/format,jpg 表示图片
if (/x-oss-process=image\/format,\w+/.test(url)) return "image"
return "file"
}, },
getFileNameFromUrlForDisplay(url) { getFileNameFromUrlForDisplay(url) {
if (!url) return "未知文件" if (!url) return "未知文件"
...@@ -552,9 +554,10 @@ export default { ...@@ -552,9 +554,10 @@ export default {
}, },
processFileLinks(fileString) { processFileLinks(fileString) {
if (!fileString) return [] if (!fileString) return []
// 兼容数组;字符串时按"逗号+http"分割,避免 OSS query 中逗号误分割
// 分割逗号分隔的文件链接 const links = Array.isArray(fileString)
const links = fileString.split(",").filter((link) => link.trim()) ? fileString
: fileString.split(/,\s*(?=https?:\/\/)/).map((s) => s.trim()).filter(Boolean)
console.log(links, "links") console.log(links, "links")
// 根据文件类型返回相应的对象数组 // 根据文件类型返回相应的对象数组
return links.map((link) => { return links.map((link) => {
......
...@@ -622,10 +622,10 @@ export default { ...@@ -622,10 +622,10 @@ export default {
if (this.getFileType(item.value) == "image") { if (this.getFileType(item.value) == "image") {
item.otherType = "image" item.otherType = "image"
item.value = item.value.split(",") item.value = this.splitUrls(item.value)
} else if (this.getFileType(item.value) == "video") { } else if (this.getFileType(item.value) == "video") {
item.otherType = "video" item.otherType = "video"
item.value = item.value.split(",") item.value = this.splitUrls(item.value)
} }
// item.value = item.value.split(",") // item.value = item.value.split(",")
// } // }
...@@ -634,6 +634,11 @@ export default { ...@@ -634,6 +634,11 @@ export default {
console.log(this.detailInfo, "this.detailInfo") console.log(this.detailInfo, "this.detailInfo")
}) })
}, },
// 按“逗号+http”分割 URL 字符串,避免 OSS query 中逗号(如 quality,q_100) 误分割
splitUrls(str) {
if (!str || typeof str !== "string") return []
return str.split(/,\s*(?=https?:\/\/)/).map((s) => s.trim()).filter(Boolean)
},
getFileType(url) { getFileType(url) {
// 图片扩展名 // 图片扩展名
const imageExtensions = [ const imageExtensions = [
...@@ -648,13 +653,16 @@ export default { ...@@ -648,13 +653,16 @@ export default {
// 视频扩展名 // 视频扩展名
const videoExtensions = ["mp4", "avi", "mov", "wmv", "flv", "webm", "mkv"] const videoExtensions = ["mp4", "avi", "mov", "wmv", "flv", "webm", "mkv"]
// 提取文件扩展名 // 提取文件扩展名(先去掉 query,支持 OSS 带参数链接)
const extension = url.split(".").pop().toLowerCase().split("?")[0] const pathname = url.split("?")[0]
const extension = pathname.split(".").pop()?.toLowerCase() || ""
if (imageExtensions.includes(extension)) { if (imageExtensions.includes(extension)) {
return "image" return "image"
} else if (videoExtensions.includes(extension)) { } else if (videoExtensions.includes(extension)) {
return "video" return "video"
} else if (/x-oss-process=image\/format,\w+/.test(url)) {
return "image"
} else { } else {
return "unknown" return "unknown"
} }
......
...@@ -729,13 +729,16 @@ export default { ...@@ -729,13 +729,16 @@ export default {
// 视频扩展名 // 视频扩展名
const videoExtensions = ["mp4", "avi", "mov", "wmv", "flv", "webm", "mkv"] const videoExtensions = ["mp4", "avi", "mov", "wmv", "flv", "webm", "mkv"]
// 提取文件扩展名 // 提取文件扩展名(先去掉 query,支持 OSS 带参数链接)
const extension = url.split(".").pop().toLowerCase().split("?")[0] const pathname = url.split("?")[0]
const extension = pathname.split(".").pop()?.toLowerCase() || ""
if (imageExtensions.includes(extension)) { if (imageExtensions.includes(extension)) {
return "image" return "image"
} else if (videoExtensions.includes(extension)) { } else if (videoExtensions.includes(extension)) {
return "video" return "video"
} else if (/x-oss-process=image\/format,\w+/.test(url)) {
return "image"
} else { } else {
return "unknown" return "unknown"
} }
......
...@@ -216,9 +216,12 @@ export default { ...@@ -216,9 +216,12 @@ export default {
}, },
getFileTypeFromUrl (url) { getFileTypeFromUrl (url) {
if (!url) return 'file' if (!url) return 'file'
const extension = url.split('.').pop().toLowerCase() const pathname = url.split('?')[0]
const extension = pathname.split('.').pop()?.toLowerCase() || ''
const imageExtensions = ['jpg', 'jpeg', 'png', 'bmp', 'webp'] const imageExtensions = ['jpg', 'jpeg', 'png', 'bmp', 'webp']
return imageExtensions.includes(extension) ? 'image' : 'file' if (imageExtensions.includes(extension)) return 'image'
if (/x-oss-process=image\/format,\w+/.test(url)) return 'image'
return 'file'
}, },
closeImgViewer () { closeImgViewer () {
this.imgViewerVisible = false this.imgViewerVisible = false
......
...@@ -216,10 +216,12 @@ export default { ...@@ -216,10 +216,12 @@ export default {
}, },
getFileTypeFromUrl (url) { getFileTypeFromUrl (url) {
if (!url) return 'file' if (!url) return 'file'
const extension = url.split('.').pop().toLowerCase() const pathname = url.split('?')[0]
const extension = pathname.split('.').pop()?.toLowerCase() || ''
const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'] const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']
if (imageExtensions.includes(extension)) return 'image'
return imageExtensions.includes(extension) ? 'image' : 'file' if (/x-oss-process=image\/format,\w+/.test(url)) return 'image'
return 'file'
}, },
closeImgViewer () { closeImgViewer () {
this.imgViewerVisible = false this.imgViewerVisible = false
......
...@@ -792,21 +792,20 @@ export default { ...@@ -792,21 +792,20 @@ export default {
data.carImages = [] data.carImages = []
data.carImagesList = [] data.carImagesList = []
} }
// 处理 documents 字段 // 处理 documents 字段(支持 documentUrls 数组或 documents JSON)
if (data.documents) { if (data.documentUrls && Array.isArray(data.documentUrls)) {
// if (typeof data.documents === 'string') { data.documentsList = this.processFileLinks(data.documentUrls)
// data.documentsList = this.processFileLinks(data.documents) } else if (data.documents) {
// } else { data.documents = typeof data.documents === 'string' ? JSON.parse(data.documents) : data.documents
data.documents = JSON.parse(data.documents) const arr = Array.isArray(data.documents) ? data.documents : []
data.documentsList = data.documents.map(item => { data.documentsList = arr.map(item => {
const url = typeof item === 'string' ? item : item?.fileUrl
return { return {
fileUrl: item.fileUrl, fileUrl: url,
fileType: this.getFileTypeFromUrl(item.fileUrl), fileType: this.getFileTypeFromUrl(url),
fileName: item.fileName fileName: typeof item === 'object' && item?.fileName ? item.fileName : this.getFileNameFromUrlForDisplay(url)
} }
}) })
console.log('data.documentsList', data.documentsList)
// }
} else { } else {
data.documents = [] data.documents = []
data.documentsList = [] data.documentsList = []
...@@ -953,9 +952,10 @@ export default { ...@@ -953,9 +952,10 @@ export default {
processFileLinks(fileString) { processFileLinks(fileString) {
if (!fileString) return [] if (!fileString) return []
// 兼容数组;字符串时按"逗号+http"分割,避免 OSS query 中逗号(如 quality,q_100) 误分割
// 分割逗号分隔的文件链接 const links = Array.isArray(fileString)
const links = fileString.split(',').filter(link => link.trim()) ? fileString
: fileString.split(/,\s*(?=https?:\/\/)/).map(s => s.trim()).filter(Boolean)
console.log(links, 'links') console.log(links, 'links')
// 根据文件类型返回相应的对象数组 // 根据文件类型返回相应的对象数组
return links.map(link => { return links.map(link => {
...@@ -992,11 +992,12 @@ export default { ...@@ -992,11 +992,12 @@ export default {
}, },
getFileTypeFromUrl(url) { getFileTypeFromUrl(url) {
if (!url) return 'file' if (!url) return 'file'
const pathname = url.split('?')[0]
const extension = url.split('.').pop().toLowerCase() const extension = pathname.split('.').pop()?.toLowerCase() || ''
const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'] const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']
if (imageExtensions.includes(extension)) return 'image'
return imageExtensions.includes(extension) ? 'image' : 'file' if (/x-oss-process=image\/format,\w+/.test(url)) return 'image'
return 'file'
}, },
isImageType(file) { isImageType(file) {
return file && file.fileType === 'image' return file && file.fileType === 'image'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!