Commit 4b7fcd2a by zhuzhequan

工厂端pod添加

parent dbcad4dc
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
import axios from './axios' import axios from './axios'
import { LogisticsData } from '@/types/api/order' import { LogisticsData } from '@/types/api/order'
import { userData } from '@/types/api/user' import { userData } from '@/types/api/user'
import { VersionImageList } from '@/types/api/typesetting' import { VersionImageList } from '@/types/api/typesetting'
// 获取物流公司 // 获取物流公司
export function getLogisticsCompanyList() { export function getLogisticsCompanyList() {
return axios.get<never, BaseRespData<LogisticsData[]>>( return axios.get<never, BaseRespData<LogisticsData[]>>(
'factory/customJomallOrder/getLogisticsList', 'factory/customJomallOrder/getLogisticsList',
) )
} }
// 获取客户
// 获取用户 export function getUserMarkList() {
export function getUserListApi() { return axios.get<never, BaseRespData<string[]>>(
return axios.get<never, BaseRespData<userData[]>>('factory/factoryUser/list') 'dbDiyUser/getUserMarkList',
} )
}
// 上传图片文件
export function uploadImageApi(data: FormData) { // 获取用户
return axios.post<never, BaseRespData<never> & VersionImageList>( export function getUserListApi() {
'upload/ossUpload', return axios.get<never, BaseRespData<userData[]>>('factory/factoryUser/list')
data, }
)
} // 上传图片文件
export function uploadFileApi(data: FormData) { export function uploadImageApi(data: FormData) {
return axios.post<never, BaseRespData<VersionImageList>>( return axios.post<never, BaseRespData<never> & VersionImageList>(
'supply/supplyTypesettingInfo/uploadManuscript', 'upload/ossUpload',
data, data,
) )
} }
export function uploadFileApi(data: FormData) {
return axios.post<never, BaseRespData<VersionImageList>>(
'supply/supplyTypesettingInfo/uploadManuscript',
data,
)
}
...@@ -105,6 +105,13 @@ export function confirmProductionOrder(ids: number[]) { ...@@ -105,6 +105,13 @@ export function confirmProductionOrder(ids: number[]) {
ids, ids,
) )
} }
// 确认生产
export function confirmProduct(ids: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrder/confirmProduct',
ids,
)
}
// 取消 // 取消
export function cancelOrderApi(id: number) { export function cancelOrderApi(id: number) {
return axios.get<never, BaseRespData<never>>( return axios.get<never, BaseRespData<never>>(
......
...@@ -9,6 +9,7 @@ export interface SearchForm { ...@@ -9,6 +9,7 @@ export interface SearchForm {
factorySubOrderNumber?: string factorySubOrderNumber?: string
factoryOrderNumber?: string factoryOrderNumber?: string
customizedQuantity?: string customizedQuantity?: string
userMark?: string
shipmentNumber?: string shipmentNumber?: string
order?: string order?: string
prop?: string prop?: string
......
...@@ -31,6 +31,17 @@ ...@@ -31,6 +31,17 @@
> >
</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="SKU"> <ElFormItem label="SKU">
<ElInput <ElInput
v-model.trim="searchForm.sku" v-model.trim="searchForm.sku"
...@@ -39,6 +50,7 @@ ...@@ -39,6 +50,7 @@
style="width: 130px" style="width: 130px"
></ElInput> ></ElInput>
</ElFormItem> </ElFormItem>
<!-- <ElFormItem label="发货单号"> <!-- <ElFormItem label="发货单号">
<ElInput <ElInput
v-model="searchForm.shipmentNumber" v-model="searchForm.shipmentNumber"
...@@ -83,7 +95,7 @@ ...@@ -83,7 +95,7 @@
<el-select <el-select
v-model="searchForm.order" v-model="searchForm.order"
clearable clearable
style="width: 100px" style="width: 80px"
placeholder="排序类型" placeholder="排序类型"
> >
<el-option value="asc" label="正序"></el-option> <el-option value="asc" label="正序"></el-option>
...@@ -132,7 +144,6 @@ ...@@ -132,7 +144,6 @@
</span> </span>
<span <span
v-if=" v-if="
status === 'TO_BE_CONFIRMED' ||
status === 'IN_PRODUCTION' || status === 'IN_PRODUCTION' ||
status === 'PART_SHIPPING' status === 'PART_SHIPPING'
" "
...@@ -142,11 +153,11 @@ ...@@ -142,11 +153,11 @@
>打印生产单</ElButton >打印生产单</ElButton
> >
</span> </span>
<span v-if="status === 'TO_BE_CONFIRMED'" class="item"> <!-- <span v-if="status === 'TO_BE_CONFIRMED'" class="item">-->
<ElButton type="success" dark @click="exportManuscript" <!-- <ElButton type="success" dark @click="exportManuscript"-->
>导出生产单</ElButton <!-- >导出生产单</ElButton-->
> <!-- >-->
</span> <!-- </span>-->
<span class="item"> <span class="item">
<ElButton type="warning" @click="addInternalTag" <ElButton type="warning" @click="addInternalTag"
>添加内部标签</ElButton >添加内部标签</ElButton
...@@ -185,7 +196,7 @@ ...@@ -185,7 +196,7 @@
> >
<ElButton type="success" @click="confirmDelivery">发货</ElButton> <ElButton type="success" @click="confirmDelivery">发货</ElButton>
</span> </span>
<span v-if="status === 'IN_PRODUCTION'" class="item"> <span v-if="['TO_BE_CONFIRMED','IN_PRODUCTION'].includes(status)" class="item">
<ElButton type="danger" @click="voidedBtn">作废</ElButton> <ElButton type="danger" @click="voidedBtn">作废</ElButton>
</span> </span>
<span v-if="status === 'IN_PRODUCTION'" class="item"> <span v-if="status === 'IN_PRODUCTION'" class="item">
...@@ -198,6 +209,7 @@ ...@@ -198,6 +209,7 @@
v-if=" v-if="
[ [
'IN_PRODUCTION', 'IN_PRODUCTION',
'TO_BE_CONFIRMED',
'WAIT_SHIPMENT', 'WAIT_SHIPMENT',
'TO_BE_REPLENISHMENT', 'TO_BE_REPLENISHMENT',
'INVALID', 'INVALID',
...@@ -346,7 +358,7 @@ ...@@ -346,7 +358,7 @@
:offset="0" :offset="0"
style="text-align: right" style="text-align: right"
> >
<span v-if="status === 'INVALID'"> <span v-if="['INVALID','TO_BE_CONFIRMED'].includes(status)">
数量:{{ cardItem?.num }} 数量:{{ cardItem?.num }}
</span> </span>
<template v-else> <template v-else>
...@@ -920,12 +932,11 @@ import RightMenu from './rightMenu.vue' ...@@ -920,12 +932,11 @@ import RightMenu from './rightMenu.vue'
import { import {
getOrderTabData, getOrderTabData,
getOrderList, getOrderList,
confirmProductionOrder, confirmProduct,
cancelOrderApi, cancelOrderApi,
downloadMaterialApi, downloadMaterialApi,
addInternalTagApi, addInternalTagApi,
printOrder, printOrder,
exportOrder,
getLogList, getLogList,
updateRemarkApi, updateRemarkApi,
getCardOrderList, getCardOrderList,
...@@ -964,7 +975,7 @@ import { ...@@ -964,7 +975,7 @@ import {
CardOrderData, CardOrderData,
} from '@/types/api/podOrder' } from '@/types/api/podOrder'
import { ArrowUp, ArrowDown, EditPen } from '@element-plus/icons-vue' import { ArrowUp, ArrowDown, EditPen } from '@element-plus/icons-vue'
import { getLogisticsCompanyList } from '@/api/common' import { getLogisticsCompanyList,getUserMarkList } from '@/api/common'
import { ElButton, type FormRules } from 'element-plus' import { ElButton, type FormRules } from 'element-plus'
import { showConfirm } from '@/utils/ui' import { showConfirm } from '@/utils/ui'
import { filePath } from '@/api/axios' import { filePath } from '@/api/axios'
...@@ -978,6 +989,7 @@ const countVisible = ref(false) ...@@ -978,6 +989,7 @@ const countVisible = ref(false)
const keyCode = ref('') const keyCode = ref('')
const cardItem = ref<PodProductList | CardOrderData>() const cardItem = ref<PodProductList | CardOrderData>()
const rightMenuRef = ref() const rightMenuRef = ref()
const userMarkList = ref<string[]>([])
const count = ref<number>(0) const count = ref<number>(0)
const rightClick = (e: MouseEvent, item: PodProductList | CardOrderData) => { const rightClick = (e: MouseEvent, item: PodProductList | CardOrderData) => {
cardItem.value = item cardItem.value = item
...@@ -1302,18 +1314,21 @@ const loadDiffList = async () => { ...@@ -1302,18 +1314,21 @@ const loadDiffList = async () => {
'IN_PRODUCTION', 'IN_PRODUCTION',
'WAIT_SHIPMENT', 'WAIT_SHIPMENT',
'TO_BE_REPLENISHMENT', 'TO_BE_REPLENISHMENT',
'TO_BE_CONFIRMED',
'INVALID', 'INVALID',
].includes(status.value) ].includes(status.value)
) { ) {
await loadCardList() await loadCardList()
} else { } else {
loadOrderList() await loadOrderList()
updateColumnWidth() updateColumnWidth()
} }
selection.value = []
} }
const [searchForm] = useValue<SearchForm>({ const [searchForm] = useValue<SearchForm>({
timeType: null, timeType: null,
shopNumber: '', shopNumber: '',
userMark: '',
customizedQuantity: '', customizedQuantity: '',
order: 'desc', order: 'desc',
}) })
...@@ -1455,6 +1470,8 @@ const getLogisticsList = async () => { ...@@ -1455,6 +1470,8 @@ const getLogisticsList = async () => {
//showError(error) //showError(error)
} }
} }
const refreshProduct = async () => { const refreshProduct = async () => {
if (selection.value.length === 0) { if (selection.value.length === 0) {
return ElMessage({ return ElMessage({
...@@ -1473,7 +1490,7 @@ const refreshProduct = async () => { ...@@ -1473,7 +1490,7 @@ const refreshProduct = async () => {
return return
} }
const ids = [] const ids = []
if (['IN_PRODUCTION', 'WAIT_SHIPMENT'].includes(status.value)) { if (['IN_PRODUCTION','TO_BE_CONFIRMED', 'WAIT_SHIPMENT'].includes(status.value)) {
ids.push( ids.push(
...selection.value.map( ...selection.value.map(
(item: CardOrderData | PodProductList) => item.podOrderId as number, (item: CardOrderData | PodProductList) => item.podOrderId as number,
...@@ -1530,8 +1547,8 @@ const confirmProduce = async () => { ...@@ -1530,8 +1547,8 @@ const confirmProduce = async () => {
(item: CardOrderData | PodProductList) => item.id, (item: CardOrderData | PodProductList) => item.id,
) )
try { try {
const res = await confirmProductionOrder(ids) const res = await confirmProduct(ids)
loadDiffList() await loadDiffList()
await loadTabData() await loadTabData()
ElMessage.success(res.message) ElMessage.success(res.message)
} catch (e) { } catch (e) {
...@@ -1589,7 +1606,7 @@ const downloadMaterial = async () => { ...@@ -1589,7 +1606,7 @@ const downloadMaterial = async () => {
}) })
} }
const ids = [] const ids = []
if (['IN_PRODUCTION', 'WAIT_SHIPMENT'].includes(status.value)) { if (['IN_PRODUCTION', 'TO_BE_CONFIRMED', 'WAIT_SHIPMENT'].includes(status.value)) {
ids.push( ids.push(
...selection.value.map((item: CardOrderData | PodProductList) => item.id), ...selection.value.map((item: CardOrderData | PodProductList) => item.id),
) )
...@@ -1661,8 +1678,8 @@ const cancelOrder = async (id: number) => { ...@@ -1661,8 +1678,8 @@ const cancelOrder = async (id: number) => {
type: 'success', type: 'success',
offset: window.innerHeight / 2, offset: window.innerHeight / 2,
}) })
loadTabData() await loadTabData()
loadDiffList() await loadDiffList()
} catch (e) { } catch (e) {
// showError(e) // showError(e)
} }
...@@ -1776,42 +1793,42 @@ const printManuscript = async () => { ...@@ -1776,42 +1793,42 @@ const printManuscript = async () => {
loading.close() loading.close()
} }
} }
const exportManuscript = async () => { // const exportManuscript = async () => {
if (selection.value.length === 0) { // if (selection.value.length === 0) {
return ElMessage({ // return ElMessage({
message: '请选择订单', // message: '请选择订单',
type: 'warning', // type: 'warning',
offset: window.innerHeight / 2, // offset: window.innerHeight / 2,
}) // })
} // }
//
const ids = selection.value.map( // const ids = selection.value.map(
(item: CardOrderData | PodProductList) => item.id, // (item: CardOrderData | PodProductList) => item.id,
) // )
try { // try {
await showConfirm('是否导出生产单', { // await showConfirm('是否导出生产单', {
confirmButtonText: '确认', // confirmButtonText: '确认',
cancelButtonText: '取消', // cancelButtonText: '取消',
type: 'warning', // type: 'warning',
}) // })
} catch { // } catch {
return // return
} // }
const loading = ElLoading.service({ // const loading = ElLoading.service({
lock: true, // lock: true,
text: '加载中...', // text: '加载中...',
background: 'rgba(0, 0, 0, 0.7)', // background: 'rgba(0, 0, 0, 0.7)',
}) // })
try { // try {
const res = await exportOrder(ids, status.value) // const res = await exportOrder(ids, status.value)
window.open(filePath + res.message) // window.open(filePath + res.message)
} catch (e) { // } catch (e) {
// showError(e) // // showError(e)
console.error(e) // console.error(e)
} finally { // } finally {
loading.close() // loading.close()
} // }
} // }
const logVisible = ref(false) const logVisible = ref(false)
const logList = ref<LogListData[]>([]) const logList = ref<LogListData[]>([])
// 操作日志 // 操作日志
...@@ -1838,7 +1855,7 @@ const handleUpdateRemark = (id: number, remark: string) => { ...@@ -1838,7 +1855,7 @@ const handleUpdateRemark = (id: number, remark: string) => {
try { try {
await updateRemarkApi(id, value as string) await updateRemarkApi(id, value as string)
ElMessage.success('操作成功') ElMessage.success('操作成功')
loadDiffList() await loadDiffList()
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} }
...@@ -1877,7 +1894,7 @@ const applyEmbryoReplenishment = async (row: ProductList) => { ...@@ -1877,7 +1894,7 @@ const applyEmbryoReplenishment = async (row: ProductList) => {
try { try {
const res = await applyForReplenishmentApi(data) const res = await applyForReplenishmentApi(data)
loadDiffList() await loadDiffList()
await loadTabData() await loadTabData()
ElMessage.success(res.message) ElMessage.success(res.message)
} catch (e) { } catch (e) {
...@@ -1926,11 +1943,22 @@ const handleContextMenu = (e: MouseEvent) => { ...@@ -1926,11 +1943,22 @@ const handleContextMenu = (e: MouseEvent) => {
const listenerClick = () => { const listenerClick = () => {
tableRightMenuVisible.value = false tableRightMenuVisible.value = false
} }
onMounted(() => {
const getUserMark = async () => {
try {
const res = await getUserMarkList()
userMarkList.value = res.data
} catch (error) {
//showError(error)
}
}
onMounted(async () => {
document.addEventListener('keydown', listenerKeydown) document.addEventListener('keydown', listenerKeydown)
document.addEventListener('click', listenerClick) document.addEventListener('click', listenerClick)
await loadTabData()
getUserMark()
getLogisticsList() getLogisticsList()
loadTabData() loadDiffList()
}) })
onBeforeUnmount(() => { onBeforeUnmount(() => {
document.removeEventListener('keydown', listenerKeydown) document.removeEventListener('keydown', listenerKeydown)
......
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