Commit 54cd7a01 by qinjianhui

Merge branch 'dev' into 'master'

feat: 申请补胚

See merge request !33
parents 6534b1b8 2fa8cf1f
...@@ -64,7 +64,6 @@ declare module 'vue' { ...@@ -64,7 +64,6 @@ declare module 'vue' {
ShipmentOrderDetail: typeof import('./src/components/ShipmentOrderDetail.vue')['default'] ShipmentOrderDetail: typeof import('./src/components/ShipmentOrderDetail.vue')['default']
SplitDiv: typeof import('./src/components/splitDiv/splitDiv.vue')['default'] SplitDiv: typeof import('./src/components/splitDiv/splitDiv.vue')['default']
'Switch ': typeof import('./src/components/Form/Switch .vue')['default'] 'Switch ': typeof import('./src/components/Form/Switch .vue')['default']
TableRightClickMenu: typeof import('./src/components/TableRightClickMenu.vue')['default']
TableView: typeof import('./src/components/TableView.vue')['default'] TableView: typeof import('./src/components/TableView.vue')['default']
UploadExcel: typeof import('./src/components/UploadExcel.vue')['default'] UploadExcel: typeof import('./src/components/UploadExcel.vue')['default']
UploadImage: typeof import('./src/components/UploadImage.vue')['default'] UploadImage: typeof import('./src/components/UploadImage.vue')['default']
......
...@@ -12,18 +12,6 @@ import { ...@@ -12,18 +12,6 @@ import {
import axios from './axios' import axios from './axios'
import { PodMakeOrderData } from '@/types/api/podMakeOrder' import { PodMakeOrderData } from '@/types/api/podMakeOrder'
export interface AddressInfo {
id?: string
receiverName: string
receiverPhone: string
receiverCountry: string
receiverProvince: string
receiverCity: string
receiverDistrict: string
receiverAddress1: string
receiverAddress2: string
receiverPostCode: string
}
// 同步收货地址 // 同步收货地址
export function syncReceiverAddress(data: number[]) { export function syncReceiverAddress(data: number[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
...@@ -112,7 +100,6 @@ export function updateExceptionOrderApi(data: number[]) { ...@@ -112,7 +100,6 @@ export function updateExceptionOrderApi(data: number[]) {
}, },
) )
} }
export function changeExceptionOrderApi( export function changeExceptionOrderApi(
url: string, url: string,
ids: number[], ids: number[],
...@@ -166,13 +153,13 @@ export function productionQueryApi(id: number, podJomallOrderUsId: number) { ...@@ -166,13 +153,13 @@ export function productionQueryApi(id: number, podJomallOrderUsId: number) {
} }
export function printProductionOrderApi(orderIds: number[]) { export function printProductionOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>( return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderUs/printProducePdf', 'factory/podJomallOrderProductUs/printProducePdf',
orderIds, orderIds,
) )
} }
export function printPrintOrderApi(orderIds: number[]) { export function printPrintOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>( return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderUs/printPickPdf', 'factory/podJomallOrderProductUs/printPickPdf',
{ {
ids: orderIds.join(','), ids: orderIds.join(','),
}, },
...@@ -180,7 +167,7 @@ export function printPrintOrderApi(orderIds: number[]) { ...@@ -180,7 +167,7 @@ export function printPrintOrderApi(orderIds: number[]) {
} }
export function printPickingOrderApi(orderIds: number[]) { export function printPickingOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>( return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderUs/pickingComplete', 'factory/podJomallOrderProductUs/pickingComplete',
{ {
ids: orderIds.join(','), ids: orderIds.join(','),
}, },
...@@ -280,10 +267,13 @@ export function loadWarehouseListApi() { ...@@ -280,10 +267,13 @@ export function loadWarehouseListApi() {
'factoryWarehouseInfo/getAll', 'factoryWarehouseInfo/getAll',
) )
} }
export function refreshMaterialApi(orderIds: string) { export function refreshMaterialApi(data: {
orderIds?: string
productIds?: string
}) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderProductUs/refreshDesignImages ', 'factory/podJomallOrderProductUs/refreshDesignImages ',
{ orderIds }, data,
) )
} }
// 获取跟踪号 // 获取跟踪号
...@@ -357,6 +347,28 @@ export function createLogisticsOrdersApi(orderIds: (string | number)[]) { ...@@ -357,6 +347,28 @@ export function createLogisticsOrdersApi(orderIds: (string | number)[]) {
orderIds, orderIds,
) )
} }
export function applyForReplenishmentApi(
data: {
id: number
productId: number
factorySubOrderNumber: string
replenishmentNum: string
podJomallOrderUsStatus: string
}[],
) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderProductUs/applyForReplenishment`,
data,
)
}
export function replenishmentSuccessApi(data: number[]) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderProductUs/replenishmentComplete`,
data,
)
}
//确认生产 //确认生产
export function confirmProductApi(orderIds: (string | number)[]) { export function confirmProductApi(orderIds: (string | number)[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
...@@ -371,3 +383,9 @@ export function confirmProductToRiinApi(orderIds: (string | number)[]) { ...@@ -371,3 +383,9 @@ export function confirmProductToRiinApi(orderIds: (string | number)[]) {
orderIds, orderIds,
) )
} }
export function toOutOfStockApi(ids: number[]) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderUs/pickingToStockOut`,
ids,
)
}
...@@ -19,7 +19,9 @@ export interface SearchForm { ...@@ -19,7 +19,9 @@ export interface SearchForm {
endTime: string | null endTime: string | null
exceptionHandling: number | undefined exceptionHandling: number | undefined
platform: string platform: string
productionClient:string productionClient: string
warehouseId: string | number
thirdSkuCode: string
} }
export interface PodUsOrderListData { export interface PodUsOrderListData {
id: number id: number
......
...@@ -30,22 +30,6 @@ ...@@ -30,22 +30,6 @@
> >
</el-date-picker> </el-date-picker>
</ElFormItem> </ElFormItem>
<ElFormItem label="客户">
<el-select
v-model="searchForm.userMark"
clearable
filterable
style="width: 100px"
placeholder="客户"
>
<el-option
v-for="item in userMarkList"
:key="item"
:value="item"
:label="item"
></el-option>
</el-select>
</ElFormItem>
<ElFormItem label="定制类型"> <ElFormItem label="定制类型">
<ElSelect <ElSelect
v-model="searchForm.customizedQuantity" v-model="searchForm.customizedQuantity"
...@@ -57,70 +41,6 @@ ...@@ -57,70 +41,6 @@
<ElOption label="多面" value="multiple" /> <ElOption label="多面" value="multiple" />
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="平台">
<ElSelect
v-model="searchForm.platform"
value-key=""
placeholder="请选择"
clearable
filterable
popper-class="customize-select-style"
style="width: 130px"
>
<ElOption
v-for="(item, index) in platformJson"
:key="index"
:label="item.type"
:value="item.type"
style="width: 160px"
>
<img
:src="`/images/icon/${item.icon.split('/').pop()}`"
style="height: 20px; margin: 5px 10px 0 0"
/>
<span :title="item.type">{{ item.type }}</span>
</ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="生产端">
<ElSelect
v-model="searchForm.productionClient"
placeholder="生产端"
clearable
style="width: 130px"
>
<ElOption
v-for="(item, index) in productionClient"
:key="index"
:value="item.code || ''"
:label="`${item.remark}(${item.code})`"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="SKU">
<ElInput
v-model.trim="searchForm.sku"
placeholder=" SKU"
clearable
style="width: 150px"
></ElInput>
</ElFormItem>
<ElFormItem label="Base SKU">
<ElInput
v-model.trim="searchForm.baseSku"
placeholder=" Base SKU"
clearable
style="width: 150px"
></ElInput>
</ElFormItem>
<ElFormItem label="物流跟踪号">
<ElInput
v-model.trim="searchForm.logisticsTracking"
placeholder="物流跟踪号"
clearable
style="width: 150px"
></ElInput>
</ElFormItem>
<ElFormItem label="生产单号"> <ElFormItem label="生产单号">
<ElInput <ElInput
v-model="searchForm.factorySubOrderNumber" v-model="searchForm.factorySubOrderNumber"
...@@ -145,24 +65,146 @@ ...@@ -145,24 +65,146 @@
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="物流类型">
<ElSelect
v-model="searchForm.shipmentType"
placeholder="物流类型"
clearable
style="width: 130px"
>
<ElOption
v-for="(item, index) in ['自有物流', '工厂物流']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem> <ElFormItem>
<ElButton type="primary" @click="search">查询</ElButton> <ElButton type="primary" @click="search">查询</ElButton>
</ElFormItem> </ElFormItem>
<ElFormItem>
<ElPopover placement="bottom" width="600" trigger="click">
<ElForm
:model="searchForm"
size="default"
inline
label-width="100px"
>
<ElFormItem label="仓库">
<ElSelect
v-model="searchForm.warehouseId"
clearable
filterable
placeholder="请输入"
style="width: 150px"
>
<el-option
v-for="item in warehouseList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</ElSelect>
</ElFormItem>
<ElFormItem label="客户">
<el-select
v-model="searchForm.userMark"
clearable
filterable
style="width: 150px"
placeholder="客户"
>
<el-option
v-for="item in userMarkList"
:key="item"
:value="item"
:label="item"
></el-option>
</el-select>
</ElFormItem>
<ElFormItem label="平台">
<ElSelect
v-model="searchForm.platform"
value-key=""
placeholder="请选择"
clearable
filterable
popper-class="customize-select-style"
style="width: 150px"
>
<ElOption
v-for="(item, index) in platformJson"
:key="index"
:label="item.type"
:value="item.type"
style="width: 160px"
>
<img
:src="`/images/icon/${item.icon.split('/').pop()}`"
style="height: 20px; margin: 5px 10px 0 0"
/>
<span :title="item.type">{{ item.type }}</span>
</ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="生产端">
<ElSelect
v-model="searchForm.productionClient"
placeholder="生产端"
clearable
style="width: 150px"
>
<ElOption
v-for="(item, index) in productionClient"
:key="index"
:value="item.code || ''"
:label="`${item.remark}(${item.code})`"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="Variant SKU">
<ElInput
v-model.trim="searchForm.sku"
placeholder="Variant SKU"
clearable
style="width: 150px"
></ElInput>
</ElFormItem>
<ElFormItem label="Base SKU">
<ElInput
v-model.trim="searchForm.baseSku"
placeholder=" Base SKU"
clearable
style="width: 150px"
></ElInput>
</ElFormItem>
<ElFormItem label="库存SKU">
<ElInput
v-model.trim="searchForm.thirdSkuCode"
placeholder="库存SKU"
clearable
style="width: 150px"
></ElInput>
</ElFormItem>
<ElFormItem label="物流跟踪号">
<ElInput
v-model.trim="searchForm.logisticsTracking"
placeholder="物流跟踪号"
clearable
style="width: 150px"
></ElInput>
</ElFormItem>
<ElFormItem label="物流类型">
<ElSelect
v-model="searchForm.shipmentType"
placeholder="物流类型"
clearable
style="width: 150px"
>
<ElOption
v-for="(item, index) in ['自有物流', '工厂物流']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
</ElForm>
<template #reference>
<el-button type="warning" @click="searchVisible = !searchVisible">
<el-icon v-if="searchVisible"><CaretTop /></el-icon>
<el-icon v-else><CaretBottom /></el-icon>
</el-button>
</template>
</ElPopover>
</ElFormItem>
</ElForm> </ElForm>
</div> </div>
<div class="header-filter-tab"> <div class="header-filter-tab">
...@@ -281,11 +323,19 @@ ...@@ -281,11 +323,19 @@
处理异常 处理异常
</ElButton> </ElButton>
</span> --> </span> -->
<span v-if="status === 'PICKING'" class="item"> <span
v-if="status === 'PICKING' || status === 'TO_BE_REPLENISHMENT'"
class="item"
>
<ElButton type="primary" @click="printProductionOrder"> <ElButton type="primary" @click="printProductionOrder">
打印生产单 打印生产单
</ElButton> </ElButton>
</span> </span>
<span v-if="status === 'TO_BE_REPLENISHMENT'" class="item">
<ElButton type="success" @click="replenishmentSuccess">
补胚完成
</ElButton>
</span>
<span v-if="status === 'PICKING'" class="item"> <span v-if="status === 'PICKING'" class="item">
<ElButton type="success" @click="printPickingOrder"> <ElButton type="success" @click="printPickingOrder">
打印拣货单 打印拣货单
...@@ -296,13 +346,16 @@ ...@@ -296,13 +346,16 @@
拣胚完成 拣胚完成
</ElButton> </ElButton>
</span> </span>
<span v-if="status === 'PICKING'" class="item">
<ElButton type="success" @click="toOutOfStock"> 转至缺货 </ElButton>
</span>
<span v-if="status === 'TO_BE_CONFIRMED'" class="item"> <span v-if="status === 'TO_BE_CONFIRMED'" class="item">
<ElButton type="warning" @click="changeExceptionOrder"> <ElButton type="warning" @click="changeExceptionOrder">
转为异常单 转为异常单
</ElButton> </ElButton>
</span> </span>
<span v-if="status === 'TO_BE_CONFIRMED'" class="item"> <span v-if="status === 'TO_BE_CONFIRMED'" class="item">
<ElButton type="warning" @click="confirmProductToRiin"> <ElButton type="success" @click="confirmProductToRiin">
转至锐印生产 转至锐印生产
</ElButton> </ElButton>
</span> </span>
...@@ -322,6 +375,11 @@ ...@@ -322,6 +375,11 @@
快捷生产 快捷生产
</ElButton> </ElButton>
</span> </span>
<span v-if="status === 'IN_PRODUCTION'" class="item">
<ElButton type="success" @click="applyForReplenishment(undefined)">
申请补胚
</ElButton>
</span>
<span v-if="status === 'WAIT_SHIPMENT'" class="item"> <span v-if="status === 'WAIT_SHIPMENT'" class="item">
<ElButton type="warning" @click="printPodOrder"> POD打单 </ElButton> <ElButton type="warning" @click="printPodOrder"> POD打单 </ElButton>
</span> </span>
...@@ -376,7 +434,8 @@ ...@@ -376,7 +434,8 @@
status === 'TO_BE_CONFIRMED' || status === 'TO_BE_CONFIRMED' ||
status === 'PICKING' || status === 'PICKING' ||
status === 'STOCK_OUT' || status === 'STOCK_OUT' ||
status === 'EXCEPTION_ORDER' status === 'EXCEPTION_ORDER' ||
status === 'TO_BE_REPLENISHMENT'
" "
class="item" class="item"
> >
...@@ -386,7 +445,11 @@ ...@@ -386,7 +445,11 @@
</span> </span>
</div> </div>
<div <div
v-if="status !== 'IN_PRODUCTION'" v-if="
status !== 'IN_PRODUCTION' &&
status !== 'PICKING' &&
status !== 'TO_BE_REPLENISHMENT'
"
v-loading="loading" v-loading="loading"
element-loading-text="加载中..." element-loading-text="加载中..."
class="table-wrapper flex-1 flex-column overflow-hidden" class="table-wrapper flex-1 flex-column overflow-hidden"
...@@ -523,30 +586,39 @@ ...@@ -523,30 +586,39 @@
{{ item.supplierProductNo }} {{ item.supplierProductNo }}
</span> </span>
</div> </div>
<div
v-if="item.isReplenishment"
class="goods-item-info-item"
>
<!-- <span class="goods-item-info-item-label">补胚状态:</span> -->
<el-tag size="small" effect="dark" type="danger"
>补胚中</el-tag
>
</div>
</div> </div>
<div class="goods-item-info"> <div class="goods-item-info">
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">价格:</span> <span class="goods-item-info-item-label">价格:</span>
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.productPrice }}() {{ item.productPrice }}($)
</span> </span>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">模板金额:</span> <span class="goods-item-info-item-label">模板金额:</span>
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.templatePrice }}() {{ item.templatePrice }}($)
</span> </span>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">工艺金额:</span> <span class="goods-item-info-item-label">工艺金额:</span>
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.craftPrice }}() {{ item.craftPrice }}($)
</span> </span>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">付款金额:</span> <span class="goods-item-info-item-label">付款金额:</span>
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.payAmount }}() {{ item.payAmount }}($)
</span> </span>
</div> </div>
...@@ -570,6 +642,23 @@ ...@@ -570,6 +642,23 @@
}} }}
</span> </span>
</div> </div>
<div
v-if="status === 'WAIT_SHIPMENT' || status === 'COMPLETE'"
class="goods-item-info-item"
>
<span class="goods-item-info-item-label">补胚数量:</span>
<span class="goods-item-info-item-value">
{{ item.replenishmentNum || 0 }}
</span>
<el-icon
class="icon"
style="color: #f56c6c; font-size: 24px"
title="申请补胚"
@click="applyForReplenishment(item)"
>
<Edit />
</el-icon>
</div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">克重:</span> <span class="goods-item-info-item-label">克重:</span>
<span <span
...@@ -733,7 +822,7 @@ ...@@ -733,7 +822,7 @@
<div class="order-price-item"> <div class="order-price-item">
<span class="order-price-item-label">商品总价:</span> <span class="order-price-item-label">商品总价:</span>
<span class="order-price-item-value"> <span class="order-price-item-value">
{{ row.totalAmount }}() {{ row.totalAmount }}($)
</span> </span>
</div> </div>
<div <div
...@@ -927,10 +1016,23 @@ ...@@ -927,10 +1016,23 @@
>{{ cardItem?.productName }} >{{ cardItem?.productName }}
</span> </span>
</div> </div>
<div class="grid-item" title="未生产数量"> <div
:style="{
visibility:
status === 'IN_PRODUCTION' || status === 'PICKING'
? 'visible'
: 'hidden',
}"
class="grid-item"
:title="status === 'PICKING' ? '数量' : '未生产数量'"
>
<span class="grid-item-label">数量:</span> <span class="grid-item-label">数量:</span>
<span class="grid-item-value"> <span class="grid-item-value">
{{ cardItem?.notPassNum }} {{
status === 'PICKING'
? cardItem.num || 0
: cardItem?.notPassNum || 0
}}
</span> </span>
</div> </div>
<div class="grid-item"> <div class="grid-item">
...@@ -938,6 +1040,18 @@ ...@@ -938,6 +1040,18 @@
{{ cardItem?.baseSku }} {{ cardItem?.baseSku }}
</span> </span>
</div> </div>
<div class="grid-item">
<span class="grid-item-label">补胚数量:</span>
<span class="grid-item-value">
{{ cardItem?.replenishmentNum || 0 }}
</span>
</div>
<div class="grid-item">
<span title="Variant SKU" class="grid-item-value">
{{ cardItem?.variantSku }}
</span>
</div>
<div class="grid-item" title="工艺"> <div class="grid-item" title="工艺">
<span class="grid-item-label">工艺:</span> <span class="grid-item-label">工艺:</span>
<span class="grid-item-value"> <span class="grid-item-value">
...@@ -978,6 +1092,11 @@ ...@@ -978,6 +1092,11 @@
{{ cardItem?.thirdSubOrderNumber }} {{ cardItem?.thirdSubOrderNumber }}
</span> </span>
</div> </div>
<div v-if="cardItem.isReplenishment" class="grid-item">
<el-tag size="small" type="danger" effect="dark"
>补胚中</el-tag
>
</div>
</div> </div>
</template> </template>
</CommonCard> </CommonCard>
...@@ -1289,7 +1408,13 @@ ...@@ -1289,7 +1408,13 @@
<script setup lang="ts"> <script setup lang="ts">
import { getUserMarkList } from '@/api/common' import { getUserMarkList } from '@/api/common'
import { ArrowDown, WarningFilled } from '@element-plus/icons-vue' import {
ArrowDown,
CaretBottom,
CaretTop,
Edit,
WarningFilled,
} from '@element-plus/icons-vue'
import { import {
getCardOrderList, getCardOrderList,
getOrderList, getOrderList,
...@@ -1324,6 +1449,9 @@ import { ...@@ -1324,6 +1449,9 @@ import {
confirmProductApi, confirmProductApi,
confirmProductToRiinApi, confirmProductToRiinApi,
// handleExceptionOrderApi, // handleExceptionOrderApi,
applyForReplenishmentApi,
replenishmentSuccessApi,
toOutOfStockApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
...@@ -1396,6 +1524,7 @@ const downloadLoading = ref(false) ...@@ -1396,6 +1524,7 @@ const downloadLoading = ref(false)
const isChangeWay = ref(false) const isChangeWay = ref(false)
const confirmData = ref([]) const confirmData = ref([])
const logisticsWayData = ref([]) const logisticsWayData = ref([])
const searchVisible = ref(false)
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')
...@@ -1417,6 +1546,8 @@ const [searchForm] = useValue<SearchForm>({ ...@@ -1417,6 +1546,8 @@ const [searchForm] = useValue<SearchForm>({
exceptionHandling: undefined, exceptionHandling: undefined,
platform: '', platform: '',
productionClient: '', productionClient: '',
warehouseId: '',
thirdSkuCode: '',
}) })
const exceptionStatus = ref(1) const exceptionStatus = ref(1)
const userMarkList = ref<string[]>([]) const userMarkList = ref<string[]>([])
...@@ -1672,7 +1803,11 @@ const { ...@@ -1672,7 +1803,11 @@ const {
onPageSizeChange: handleSizeChange, onPageSizeChange: handleSizeChange,
} = usePageList({ } = usePageList({
query: (page, pageSize) => { query: (page, pageSize) => {
if (status.value !== 'IN_PRODUCTION') { if (
status.value !== 'IN_PRODUCTION' &&
status.value !== 'PICKING' &&
status.value !== 'TO_BE_REPLENISHMENT'
) {
return getOrderList( return getOrderList(
{ {
...searchForm.value, ...searchForm.value,
...@@ -1851,12 +1986,14 @@ const productionClientVisible = ref(false) ...@@ -1851,12 +1986,14 @@ const productionClientVisible = ref(false)
// } // }
const downloadTif = async () => { const downloadTif = async () => {
if (!selection.value.length) { if (!cardSelection.value.length) {
return ElMessage.warning('请选择数据') return ElMessage.warning('请选择数据')
} }
downloadLoading.value = true downloadLoading.value = true
try { try {
const res = await composingDesignImages(selection.value.map((el) => el.id)) const res = await composingDesignImages(
cardSelection.value.map((el) => el.id),
)
window.open(filePath + res.message, '_blank') window.open(filePath + res.message, '_blank')
downloadLoading.value = false downloadLoading.value = false
} catch (e) { } catch (e) {
...@@ -1967,10 +2104,10 @@ const assignOrder = async () => { ...@@ -1967,10 +2104,10 @@ const assignOrder = async () => {
// } // }
// } // }
const printProductionOrder = async () => { const printProductionOrder = async () => {
if (selection.value.length === 0) { if (cardSelection.value.length === 0) {
return ElMessage.warning('请选择数据') return ElMessage.warning('请选择数据')
} }
const orderIds = selection.value.map((item) => item.id) const orderIds = cardSelection.value.map((item) => item.id)
const loading = ElLoading.service({ const loading = ElLoading.service({
fullscreen: true, fullscreen: true,
text: '操作中...', text: '操作中...',
...@@ -1988,10 +2125,10 @@ const printProductionOrder = async () => { ...@@ -1988,10 +2125,10 @@ const printProductionOrder = async () => {
} }
} }
const printPickingOrder = async () => { const printPickingOrder = async () => {
if (selection.value.length === 0) { if (cardSelection.value.length === 0) {
return ElMessage.warning('请选择数据') return ElMessage.warning('请选择数据')
} }
const orderIds = selection.value.map((item) => item.id) const orderIds = cardSelection.value.map((item) => item.id)
const loading = ElLoading.service({ const loading = ElLoading.service({
fullscreen: true, fullscreen: true,
text: '操作中...', text: '操作中...',
...@@ -2009,7 +2146,7 @@ const printPickingOrder = async () => { ...@@ -2009,7 +2146,7 @@ const printPickingOrder = async () => {
} }
} }
const pickingComplete = async () => { const pickingComplete = async () => {
if (selection.value.length === 0) { if (cardSelection.value.length === 0) {
return ElMessage.warning('请选择数据') return ElMessage.warning('请选择数据')
} }
try { try {
...@@ -2021,7 +2158,7 @@ const pickingComplete = async () => { ...@@ -2021,7 +2158,7 @@ const pickingComplete = async () => {
} catch { } catch {
return return
} }
const orderIds = selection.value.map((item) => item.id) const orderIds = cardSelection.value.map((item) => item.id)
const loading = ElLoading.service({ const loading = ElLoading.service({
fullscreen: true, fullscreen: true,
text: '操作中...', text: '操作中...',
...@@ -2039,6 +2176,36 @@ const pickingComplete = async () => { ...@@ -2039,6 +2176,36 @@ const pickingComplete = async () => {
loading.close() loading.close()
} }
} }
const toOutOfStock = async () => {
if (cardSelection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
const orderIds = cardSelection.value.map((item) => item.podJomallOrderUsId)
try {
await ElMessageBox.confirm('确定转至缺货吗?', '提示', {
cancelButtonText: '取消',
confirmButtonText: '确认',
type: 'warning',
})
} catch {
return
}
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await toOutOfStockApi(orderIds)
if (res.code !== 200) return
search()
loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const exceptionTypes = [ const exceptionTypes = [
{ value: '1', label: '客户' }, { value: '1', label: '客户' },
{ value: '2', label: '工厂' }, { value: '2', label: '工厂' },
...@@ -2143,7 +2310,10 @@ const isSelectStatused = (data: ProductList) => { ...@@ -2143,7 +2310,10 @@ const isSelectStatused = (data: ProductList) => {
return index !== -1 return index !== -1
} }
const rightChange = async (code: string) => { const rightChange = async (code: string) => {
const flat = status.value !== 'IN_PRODUCTION' const flat =
status.value !== 'IN_PRODUCTION' &&
status.value !== 'PICKING' &&
status.value !== 'TO_BE_REPLENISHMENT'
if (code === 'select-all') { if (code === 'select-all') {
if (flat) { if (flat) {
tableRef.value?.toggleAllSelection() tableRef.value?.toggleAllSelection()
...@@ -2186,7 +2356,11 @@ const onFastProduction = () => { ...@@ -2186,7 +2356,11 @@ const onFastProduction = () => {
// 下载稿件 // 下载稿件
const downloadMaterial = async () => { const downloadMaterial = async () => {
let selectedIds = [] let selectedIds = []
if (status.value === 'IN_PRODUCTION') { if (
status.value === 'IN_PRODUCTION' ||
status.value === 'PICKING' ||
status.value === 'TO_BE_REPLENISHMENT'
) {
selectedIds = cardSelection.value selectedIds = cardSelection.value
.map((item: ProductList) => item.id) .map((item: ProductList) => item.id)
.filter((id): id is number => id !== undefined) .filter((id): id is number => id !== undefined)
...@@ -2759,8 +2933,14 @@ const loadWarehouseList = async () => { ...@@ -2759,8 +2933,14 @@ const loadWarehouseList = async () => {
} }
} }
const refreshMaterial = async () => { const refreshMaterial = async () => {
if (selection.value.length === 0) { if (status.value === 'PICKING') {
return ElMessage.warning('请选择数据') if (cardSelection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
} else {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
} }
const loading = ElLoading.service({ const loading = ElLoading.service({
fullscreen: true, fullscreen: true,
...@@ -2768,9 +2948,16 @@ const refreshMaterial = async () => { ...@@ -2768,9 +2948,16 @@ const refreshMaterial = async () => {
background: 'rgba(0, 0, 0, 0.3)', background: 'rgba(0, 0, 0, 0.3)',
}) })
try { try {
const res = await refreshMaterialApi( const res = await refreshMaterialApi({
selection.value.map((item) => item.id).join(','), orderIds:
) status.value !== 'PICKING'
? selection.value.map((item) => item.id).join(',')
: undefined,
productIds:
status.value === 'PICKING'
? cardSelection.value.map((item) => item.id).join(',')
: undefined,
})
if (res.code !== 200) return if (res.code !== 200) return
ElMessage.success('刷新成功') ElMessage.success('刷新成功')
search() search()
...@@ -2791,6 +2978,95 @@ const handleExceptionCommand = (command: number) => { ...@@ -2791,6 +2978,95 @@ const handleExceptionCommand = (command: number) => {
exceptionStatus.value = command exceptionStatus.value = command
search() search()
} }
const applyForReplenishment = async (row: ProductList | undefined) => {
if (!row) {
if (cardSelection.value.length === 0) {
return ElMessage.warning('请至少选择一条数据')
}
}
ElMessageBox.prompt('请输入补胚数量', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /.+/,
inputValue: row ? String(row.replenishmentNum || '') : '',
inputErrorMessage: '请输入补胚数量',
inputPlaceholder: '补胚数量',
}).then(async (res) => {
if (res.value) {
let data = []
if (!row) {
data = cardSelection.value.map((item) => {
return {
id: item.podJomallOrderUsId,
productId: item.id,
factorySubOrderNumber: item.factorySubOrderNumber || '',
replenishmentNum: res.value,
podJomallOrderUsStatus: status.value,
}
})
} else {
data = [
{
id: row.podJomallOrderUsId,
productId: row.id,
factorySubOrderNumber: row.factorySubOrderNumber || '',
replenishmentNum: res.value,
podJomallOrderUsStatus: status.value,
},
]
}
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const result = await applyForReplenishmentApi(data)
if (result.code !== 200) return
ElMessage.success('操作成功')
search()
loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
})
}
const replenishmentSuccess = async () => {
if (cardSelection.value.length === 0) {
return ElMessage.warning('请至少选择一条数据')
}
try {
await ElMessageBox.confirm('是否确认补胚完成', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await replenishmentSuccessApi(
cardSelection.value.map((item) => item.id),
)
if (res.code !== 200) return
ElMessage.success('操作成功')
search()
loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header-filter-form { .header-filter-form {
...@@ -2888,12 +3164,7 @@ const handleExceptionCommand = (command: number) => { ...@@ -2888,12 +3164,7 @@ const handleExceptionCommand = (command: number) => {
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
} }
.operate-item {
.el-button {
margin-left: 0 !important;
margin-top: 20px !important;
}
}
.tabs-node_count { .tabs-node_count {
display: inline-block; display: inline-block;
min-width: 20px; min-width: 20px;
......
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