Commit 45d4b949 by linjinhong

Merge branch 'dev_weighing_sorting' of…

Merge branch 'dev_weighing_sorting' of http://47.122.114.111:9999/qinjianhui/factory_front into dev_weighing_sorting
parents c6b3162c 1c8c8872
...@@ -63,6 +63,8 @@ export interface ILogisticsCompany { ...@@ -63,6 +63,8 @@ export interface ILogisticsCompany {
authCode: string | null // varchar(500) authCode: string | null // varchar(500)
redirectUri: string | null // varchar(256) redirectUri: string | null // varchar(256)
createTime: string | null // timestamp createTime: string | null // timestamp
orderStatus: string | null // varchar(60)
signTime: string | null // timestamp
vat: string | null // varchar(60) vat: string | null // varchar(60)
ioss: string | null // varchar(60) ioss: string | null // varchar(60)
basicType: number // int(11) basicType: number // int(11)
......
...@@ -38,6 +38,11 @@ export function syncReceiverAddress(data: number[]) { ...@@ -38,6 +38,11 @@ export function syncReceiverAddress(data: number[]) {
) )
} }
export function getEmployeeListApi() {
return axios.get(`/factory/factoryUser/list`)
}
// 播种墙配货 扫码放入箱子 // 播种墙配货 扫码放入箱子
export function getPackingCnDataApi( export function getPackingCnDataApi(
code: string, code: string,
...@@ -559,10 +564,11 @@ export function getListCraftApi() { ...@@ -559,10 +564,11 @@ export function getListCraftApi() {
} }
// 批量下载 列表 // 批量下载 列表
export function batchDownloadApi(currentPage: number, pageSize: number) { export function batchDownloadApi(params: SearchForm, currentPage: number, pageSize: number) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
`factory/podBatchDownload/cn/list_page`, `factory/podBatchDownload/cn/list_page`,
{ {
...params,
currentPage, currentPage,
pageSize, pageSize,
}, },
......
...@@ -477,10 +477,11 @@ export function getListCraftApi() { ...@@ -477,10 +477,11 @@ export function getListCraftApi() {
} }
// 批量下载 列表 // 批量下载 列表
export function batchDownloadApi(currentPage: number, pageSize: number) { export function batchDownloadApi(params: SearchForm, currentPage: number, pageSize: number) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
`factory/podBatchDownload/us/list_page`, `factory/podBatchDownload/us/list_page`,
{ {
...params,
currentPage, currentPage,
pageSize, pageSize,
}, },
...@@ -625,6 +626,11 @@ export function getAccountCodeByFactoryIdApi(params: { token: string }) { ...@@ -625,6 +626,11 @@ export function getAccountCodeByFactoryIdApi(params: { token: string }) {
export function getLogisticsWayApi() { export function getLogisticsWayApi() {
return axios.get(`logisticsWay/usableAllList`) return axios.get(`logisticsWay/usableAllList`)
} }
export function getEmployeeListApi() {
return axios.get(`/factory/factoryUser/list`)
}
// 打印拣货单item // 打印拣货单item
export function printPickPdfByBatchNumberApi(params: { export function printPickPdfByBatchNumberApi(params: {
batchArrangeNumber: string batchArrangeNumber: string
......
...@@ -48,6 +48,12 @@ export interface SearchForm { ...@@ -48,6 +48,12 @@ export interface SearchForm {
size?: string size?: string
logisticsCompanyCode?: string logisticsCompanyCode?: string
tagsIdArr?: (number | null)[] tagsIdArr?: (number | null)[]
craftType?: string
downloadStatus?: number
syntheticStatus?: number
automaticComposing?: number
employeeId?: number
blocking?: boolean
blocking?: boolean blocking?: boolean
} }
export interface PodCnOrderListData { export interface PodCnOrderListData {
...@@ -115,6 +121,7 @@ export interface ProductList { ...@@ -115,6 +121,7 @@ export interface ProductList {
variantImage?: string variantImage?: string
craftPrice?: number craftPrice?: number
craftCode?: string craftCode?: string
craftType?: string
previewImgs?: [] previewImgs?: []
platform?: string platform?: string
imageAry?: string imageAry?: string
......
...@@ -44,6 +44,11 @@ export interface SearchForm { ...@@ -44,6 +44,11 @@ export interface SearchForm {
size?: string size?: string
tagsIdArr?: (number | null)[] tagsIdArr?: (number | null)[]
replaceShipment?: number | null replaceShipment?: number | null
craftType?: string
downloadStatus?: number
syntheticStatus?: number
automaticComposing?: number
employeeId?: number
blocking?: boolean blocking?: boolean
} }
export interface PodUsOrderListData { export interface PodUsOrderListData {
...@@ -114,6 +119,7 @@ export interface ProductList { ...@@ -114,6 +119,7 @@ export interface ProductList {
variantImage?: string variantImage?: string
craftPrice?: number craftPrice?: number
craftCode?: string craftCode?: string
craftType?: string
platform?: string platform?: string
imageAry?: string imageAry?: string
previewImgs?: [] previewImgs?: []
......
...@@ -27,6 +27,23 @@ ...@@ -27,6 +27,23 @@
<template #top> <template #top>
<el-card> <el-card>
<el-form inline :model="searchForm" ref="searchFormRef"> <el-form inline :model="searchForm" ref="searchFormRef">
<el-form-item label="创建时间">
<el-date-picker
v-model="tradingTime"
:shortcuts="pickerOptions.shortcuts"
:default-time="[
new Date(0, 0, 0, 0, 0, 0),
new Date(0, 0, 0, 23, 59, 59),
]"
type="datetimerange"
start-placeholder="开始时间"
end-placeholder="结束时间"
clearable
style="width: 260px"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
<el-form-item label="物流跟踪号"> <el-form-item label="物流跟踪号">
<el-input <el-input
v-model="searchForm.trackNumber" v-model="searchForm.trackNumber"
...@@ -87,6 +104,9 @@ ...@@ -87,6 +104,9 @@
<template #shipmentType="{ row }"> <template #shipmentType="{ row }">
{{ ['自有物流', '工厂物流'][row.shipmentType] }} {{ ['自有物流', '工厂物流'][row.shipmentType] }}
</template> </template>
<template #shippingAge="{ row }">
{{ getShippingAge(row) }}
</template>
</TableView> </TableView>
</div> </div>
<div class="pagination"> <div class="pagination">
...@@ -139,7 +159,124 @@ const searchForm = ref<SearchForm>({ ...@@ -139,7 +159,124 @@ const searchForm = ref<SearchForm>({
shopNumber: '', shopNumber: '',
trackNumber: '', trackNumber: '',
}) })
function getStartTime() {
const date = new Date()
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
return `${year}-${month}-${day} 00:00:00`
}
const tradingTime = ref<string[]>([])
const pickerOptions = {
shortcuts: [
{
text: '今日',
value: () => {
const start = new Date(new Date(getStartTime()).getTime())
const end = new Date()
return [start, end]
},
},
{
text: '昨天',
value: () => {
const start = new Date()
const end = new Date(new Date(getStartTime()).getTime() - 1)
start.setTime(end.getTime() - 3600 * 1000 * 24 * 1 + 1)
return [start, end]
},
},
{
text: '最近7天',
value: () => {
const end = new Date()
const start = new Date(getStartTime())
start.setTime(start.getTime() - 3600 * 1000 * 24 * 6)
return [start, end]
},
},
{
text: '最近14天',
value: () => {
const end = new Date()
const start = new Date(getStartTime())
start.setTime(start.getTime() - 3600 * 1000 * 24 * 13)
return [start, end]
},
},
{
text: '最近30天',
value: () => {
const end = new Date()
const start = new Date(getStartTime())
start.setTime(start.getTime() - 3600 * 1000 * 24 * 29)
return [start, end]
},
},
{
text: '本星期',
value: () => {
const end = new Date()
const start = new Date()
const nowDay = new Date().getDay() - 1
start.setTime(
new Date(getStartTime()).getTime() - 3600 * 1000 * 24 * nowDay,
)
return [start, end]
},
},
{
text: '上星期',
value: () => {
const end = new Date()
const start = new Date()
const nowDay = new Date().getDay() - 1
end.setTime(
new Date(getStartTime()).getTime() - 3600 * 1000 * 24 * nowDay - 1,
)
start.setTime(end.getTime() - 3600 * 1000 * 24 * 7 + 1)
return [start, end]
},
},
{
text: '这个月',
value: () => {
const end = new Date()
const start = new Date()
const nowDate = new Date().getDate() - 1
start.setTime(
new Date(getStartTime()).getTime() - 3600 * 1000 * 24 * nowDate,
)
return [start, end]
},
},
{
text: '上个月',
value: () => {
const date = new Date()
let year = date.getFullYear()
let month = date.getMonth()
const end = new Date(
new Date(`${year}-${month + 1}-1 00:00:00`).getTime() - 1,
)
if (month === 0) {
month = 12
year = year - 1
}
const start = new Date(
new Date(`${year}-${month}-1 00:00:00`).getTime(),
)
return [start, end]
},
},
{
text: '历史',
value: () => {
return ['', '']
},
},
],
}
const treeData = ref<LogisticsTrackingTree[]>() const treeData = ref<LogisticsTrackingTree[]>()
const treeRef = ref<InstanceType<typeof ElTree>>() const treeRef = ref<InstanceType<typeof ElTree>>()
const tableRef = ref<{ internalIsMore?: boolean }>() const tableRef = ref<{ internalIsMore?: boolean }>()
...@@ -183,6 +320,19 @@ const tableColumns = computed(() => { ...@@ -183,6 +320,19 @@ const tableColumns = computed(() => {
align: 'center', align: 'center',
}, },
{ {
label: '创建时间',
prop: 'createTime',
width: 200,
align: 'center',
},
{
label: '发货时效(天)',
prop: 'shippingAge',
slot: 'shippingAge',
width: 120,
align: 'center',
},
{
label: '订单状态', label: '订单状态',
prop: 'orderStatus', prop: 'orderStatus',
slot: 'orderStatus', slot: 'orderStatus',
...@@ -261,13 +411,38 @@ const getTree = async () => { ...@@ -261,13 +411,38 @@ const getTree = async () => {
console.error(e) console.error(e)
} }
} }
/** 计算发货时效(天)
* 已签收 → 停止计时
* <12h = 0天;≥12h & <24h = 1天;≥48h = 2天 ...
*/
function getShippingAge(row: ILogisticsCompany): number {
// 成功签收就固定: 已签收时间 - 创建时间
if (row.orderStatus === 'COMPLETE') {
const signTime = new Date(row.signTime ?? 0).getTime()
const createTime = new Date(row.createTime ?? 0).getTime()
return msToDays(signTime - createTime)
}
// 未签收:当前时间 - 创建时间
const now = Date.now()
const create = new Date(row.createTime ?? 0).getTime()
return msToDays(now - create)
}
/** 毫秒 → 天数(≥12h 向上取整) */
function msToDays(ms: number): number {
const hours = ms / (1000 * 60 * 60)
if (hours < 12) return 0
return Math.ceil(hours / 24)
}
// 列表查询 // 列表查询
async function getData() { async function getData() {
const res = await logisticsTrackingPage({ const res = await logisticsTrackingPage({
trackingStatus: nodeId.value, trackingStatus: nodeId.value,
shopNumber: searchForm.value.shopNumber, shopNumber: searchForm.value.shopNumber,
trackNumber: searchForm.value.trackNumber, trackNumber: searchForm.value.trackNumber,
startTime: tradingTime.value && tradingTime.value[0],
endTime: tradingTime.value && tradingTime.value[1],
queryDateType: tradingTime.value && 1,
}) })
leftData.value = res.data.records leftData.value = res.data.records
pagination.value.total = res.data.total pagination.value.total = res.data.total
......
...@@ -59,4 +59,7 @@ export interface LogisticsTrackingParams { ...@@ -59,4 +59,7 @@ export interface LogisticsTrackingParams {
trackNumber?: number | string trackNumber?: number | string
shopNumber?: string | number shopNumber?: string | number
trackingStatus?: number trackingStatus?: number
startTime?: string
endTime?: string
queryDateType?: number | string
} }
...@@ -10,7 +10,108 @@ ...@@ -10,7 +10,108 @@
label-position="right" label-position="right"
label-width="70px" label-width="70px"
> >
<ElFormItem label="仓库"> <!-- 批量下载 -->
<ElFormItem label="创建时间" v-if="status === 'BATCH_DOWNLOAD'">
<el-date-picker
v-model="timeRange"
:teleported="false"
:default-time="[
new Date(0, 0, 0, 0, 0, 0),
new Date(0, 0, 0, 23, 59, 59),
]"
value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange"
style="width: 280px"
:shortcuts="pickerOptions.shortcuts"
start-placeholder="开始时间"
end-placeholder="结束时间"
clearable
>
</el-date-picker>
</ElFormItem>
<ElFormItem label="创建人" v-if="status === 'BATCH_DOWNLOAD'">
<ElSelect
v-model="searchForm.employeeId"
placeholder="请选择"
clearable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in employeeList"
:key="index"
:value="item.id"
:label="item.account"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="工艺类型" v-if="status === 'BATCH_DOWNLOAD'">
<ElSelect
v-model="searchForm.craftType"
placeholder="请选择"
clearable
filterable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in processType"
:key="index"
:value="item.value"
:label="item.label"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="下载状态" v-if="status === 'BATCH_DOWNLOAD'">
<ElSelect
v-model="searchForm.downloadStatus"
placeholder="下载状态"
clearable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in ['未下载', '已下载']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="排版状态" v-if="status === 'BATCH_DOWNLOAD'">
<ElSelect
v-model="searchForm.syntheticStatus"
placeholder="排版状态"
clearable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in ['否', '是']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="自动排版" v-if="status === 'BATCH_DOWNLOAD'">
<ElSelect
v-model="searchForm.automaticComposing"
placeholder="自动排版"
clearable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in ['否', '是']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="仓库" v-if="status !== 'BATCH_DOWNLOAD'">
<ElSelect <ElSelect
v-model="searchForm.warehouseId" v-model="searchForm.warehouseId"
clearable clearable
...@@ -26,7 +127,7 @@ ...@@ -26,7 +127,7 @@
></el-option> ></el-option>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="平台"> <ElFormItem label="平台" v-if="status !== 'BATCH_DOWNLOAD'">
<ElSelect <ElSelect
v-model="searchForm.platform" v-model="searchForm.platform"
value-key="" value-key=""
...@@ -52,7 +153,7 @@ ...@@ -52,7 +153,7 @@
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="工艺"> <ElFormItem label="工艺" v-if="status !== 'BATCH_DOWNLOAD'">
<LogisticsWaySelect <LogisticsWaySelect
v-model="searchForm.craftCode" v-model="searchForm.craftCode"
:company-list="craftList" :company-list="craftList"
...@@ -61,7 +162,7 @@ ...@@ -61,7 +162,7 @@
start-placeholder="请选择工艺名称" start-placeholder="请选择工艺名称"
></LogisticsWaySelect> ></LogisticsWaySelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="库存SKU"> <ElFormItem label="库存SKU" v-if="status !== 'BATCH_DOWNLOAD'">
<ElInput <ElInput
v-model.trim="searchForm.thirdSkuCode" v-model.trim="searchForm.thirdSkuCode"
placeholder="库存SKU" placeholder="库存SKU"
...@@ -69,7 +170,7 @@ ...@@ -69,7 +170,7 @@
style="width: 150px" style="width: 150px"
></ElInput> ></ElInput>
</ElFormItem> </ElFormItem>
<ElFormItem label="款号"> <ElFormItem label="款号" v-if="status !== 'BATCH_DOWNLOAD'">
<ElInput <ElInput
v-model.trim="searchForm.supplierProductNo" v-model.trim="searchForm.supplierProductNo"
placeholder="款号" placeholder="款号"
...@@ -85,7 +186,7 @@ ...@@ -85,7 +186,7 @@
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="生产单号"> <ElFormItem label="生产单号" v-if="status !== 'BATCH_DOWNLOAD'">
<ElInput <ElInput
v-model.trim="searchForm.factorySubOrderNumber" v-model.trim="searchForm.factorySubOrderNumber"
placeholder="生产单号" placeholder="生产单号"
...@@ -93,7 +194,7 @@ ...@@ -93,7 +194,7 @@
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="店铺单号"> <ElFormItem label="店铺单号" v-if="status !== 'BATCH_DOWNLOAD'">
<ElInput <ElInput
v-model.trim="searchForm.shopNumber" v-model.trim="searchForm.shopNumber"
placeholder="店铺单号" placeholder="店铺单号"
...@@ -101,7 +202,7 @@ ...@@ -101,7 +202,7 @@
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="尺码类型"> <ElFormItem label="尺码类型" v-if="status !== 'BATCH_DOWNLOAD'">
<ElSelect <ElSelect
v-model="searchForm.sizeType" v-model="searchForm.sizeType"
clearable clearable
...@@ -117,7 +218,7 @@ ...@@ -117,7 +218,7 @@
></el-option> ></el-option>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="排序"> <ElFormItem label="排序" v-if="status !== 'BATCH_DOWNLOAD'">
<el-select <el-select
v-model="searchForm.order" v-model="searchForm.order"
clearable clearable
...@@ -128,7 +229,7 @@ ...@@ -128,7 +229,7 @@
<el-option value="desc" label="倒序"></el-option> <el-option value="desc" label="倒序"></el-option>
</el-select> </el-select>
</ElFormItem> </ElFormItem>
<ElFormItem label="类型"> <ElFormItem label="类型" v-if="status !== 'BATCH_DOWNLOAD'">
<el-radio-group <el-radio-group
v-model="searchForm.customizedQuantity" v-model="searchForm.customizedQuantity"
@click.stop="(e: Event) => handleRadioGroupClick(e)" @click.stop="(e: Event) => handleRadioGroupClick(e)"
...@@ -137,7 +238,7 @@ ...@@ -137,7 +238,7 @@
<el-radio-button value="multiple">多面</el-radio-button> <el-radio-button value="multiple">多面</el-radio-button>
</el-radio-group> </el-radio-group>
</ElFormItem> </ElFormItem>
<ElFormItem label="数量"> <ElFormItem label="数量" v-if="status !== 'BATCH_DOWNLOAD'">
<el-radio-group <el-radio-group
v-model="searchForm.multi" v-model="searchForm.multi"
@click.stop="(e: Event) => handleMultiRadioGroupClick(e)" @click.stop="(e: Event) => handleMultiRadioGroupClick(e)"
...@@ -146,7 +247,7 @@ ...@@ -146,7 +247,7 @@
<el-radio-button :value="true">多件</el-radio-button> <el-radio-button :value="true">多件</el-radio-button>
</el-radio-group> </el-radio-group>
</ElFormItem> </ElFormItem>
<ElFormItem> <ElFormItem v-if="status !== 'BATCH_DOWNLOAD'">
<ElPopover placement="bottom" width="600" trigger="click"> <ElPopover placement="bottom" width="600" trigger="click">
<ElForm <ElForm
ref="searchFormPopoverRef" ref="searchFormPopoverRef"
...@@ -399,6 +500,43 @@ ...@@ -399,6 +500,43 @@
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem <ElFormItem
v-if="status !== 'CANCEL' && status !== 'INTERCEPTED'"
label="拦截订单"
>
<ElSelect
v-model="searchForm.blocking"
placeholder="请选择"
clearable
filterable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(_, index) in ['否', '是']"
:key="index"
:value="!!index"
:label="index === 0 ? '否' : '是'"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="自有物流公司">
<ElSelect
v-model="searchForm.logisticsCompanyCode"
placeholder="请选择"
clearable
filterable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in allCodelist"
:key="index"
:value="item.code"
:label="item.basicsName"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem
label="拦截订单" label="拦截订单"
v-if="status !== 'CANCEL' && status !== 'INTERCEPTED'" v-if="status !== 'CANCEL' && status !== 'INTERCEPTED'"
> >
...@@ -699,7 +837,7 @@ ...@@ -699,7 +837,7 @@
<ElButton type="success" @click="toBePicking"> 转至生产 </ElButton> <ElButton type="success" @click="toBePicking"> 转至生产 </ElButton>
</span> </span>
<span v-if="status === 'TO_BE_ARRANGE'" class="item"> <span v-if="status === 'TO_BE_ARRANGE'" class="item">
<ElButton type="warning" @click="showArrange(2)">排单完成</ElButton> <ElButton type="warning" @click="showArrange(2)">排单</ElButton>
</span> </span>
<span <span
v-if="status !== 'BATCH_DOWNLOAD' && status !== 'WAIT_SHIPMENT'" v-if="status !== 'BATCH_DOWNLOAD' && status !== 'WAIT_SHIPMENT'"
...@@ -2600,7 +2738,7 @@ ...@@ -2600,7 +2738,7 @@
" "
/> />
</template> </template>
<script setup lang="ts"> <script setup lang="tsx">
import WeightDialog from './components/WeightDialog.vue' import WeightDialog from './components/WeightDialog.vue'
import { getUserMarkList } from '@/api/common' import { getUserMarkList } from '@/api/common'
import LogisticsWaySelect from '../../logistics/components/LogisticsWaySelect.tsx' import LogisticsWaySelect from '../../logistics/components/LogisticsWaySelect.tsx'
...@@ -2667,6 +2805,7 @@ import { ...@@ -2667,6 +2805,7 @@ import {
getCustomTagListCnApi, getCustomTagListCnApi,
printNormalPdf, printNormalPdf,
changeLogisticsApi, changeLogisticsApi,
getEmployeeListApi,
allErpCodeListApi, allErpCodeListApi,
} from '@/api/podCnOrder' } from '@/api/podCnOrder'
...@@ -2794,6 +2933,7 @@ const sourceList = [ ...@@ -2794,6 +2933,7 @@ const sourceList = [
}, },
] ]
const sizes = ['FS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', '3XL', '4XL', '5XL'] const sizes = ['FS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', '3XL', '4XL', '5XL']
const employeeList = ref<{ account: string; id: number }[]>([])
const exportData = () => { const exportData = () => {
exportVisible.value = true exportVisible.value = true
...@@ -3090,7 +3230,10 @@ const printNormal = async () => { ...@@ -3090,7 +3230,10 @@ const printNormal = async () => {
} }
selection.value.forEach((s) => { selection.value.forEach((s) => {
const f = const f =
s.productList && s.productList.find((p) => p.productMark === 'normal') s.productList &&
s.productList.find(
(p) => p.productMark === 'normal' || p.productMark === 'custom_normal',
)
if (f) arr.push(s.id) if (f) arr.push(s.id)
}) })
if (!arr.length) { if (!arr.length) {
...@@ -3542,6 +3685,37 @@ const tableColumns = computed(() => { ...@@ -3542,6 +3685,37 @@ const tableColumns = computed(() => {
align: 'center', align: 'center',
}, },
{ {
label: '工艺类型',
width: 150,
prop: 'craftType',
align: 'center',
render: (item: ProductList) => {
if (!item.craftType) {
return (
<div>
<span>-</span>
</div>
)
}
// 分割字符串并查找对应的 label
const labels = item.craftType
.split(',')
.map((type) => type.trim())
.map(
(type) =>
processType.value.find((e) => e.value === type)?.label || type,
)
.filter(Boolean)
return (
<div>
<span>{labels.join(',')}</span>
</div>
)
},
},
{
label: '失败原因', label: '失败原因',
minWidth: 250, minWidth: 250,
prop: 'failReason', prop: 'failReason',
...@@ -3696,6 +3870,13 @@ const asyncOrderAddress = async () => { ...@@ -3696,6 +3870,13 @@ const asyncOrderAddress = async () => {
} }
} }
const getEmployeeList = async () => {
const { data } = await getEmployeeListApi()
employeeList.value = data
}
getEmployeeList()
const changeTab = (item: Tab) => { const changeTab = (item: Tab) => {
status.value = item.status || '' status.value = item.status || ''
localStorage.setItem('podCnStatus', item.status as string) localStorage.setItem('podCnStatus', item.status as string)
...@@ -3786,7 +3967,13 @@ const { ...@@ -3786,7 +3967,13 @@ const {
baseparams.tagsIdArr && delete baseparams.tagsIdArr baseparams.tagsIdArr && delete baseparams.tagsIdArr
// 批量下载 // 批量下载
if (status.value === 'BATCH_DOWNLOAD') { if (status.value === 'BATCH_DOWNLOAD') {
return batchDownloadApi(page, pageSize).then((res) => { return batchDownloadApi(
{
...baseparams,
},
page,
pageSize,
).then((res) => {
return res.data return res.data
}) as never }) as never
} else if ( } else if (
...@@ -4547,7 +4734,7 @@ const showArrange = async (type: number, data?: PodCnOrderListData) => { ...@@ -4547,7 +4734,7 @@ const showArrange = async (type: number, data?: PodCnOrderListData) => {
if (bool) { if (bool) {
try { try {
await ElMessageBox.confirm( await ElMessageBox.confirm(
'选中排单的生产单存在多个工艺, 是否继续排单?', '选中排单的生产单存在多个工艺类型, 是否继续排单?',
'提示', '提示',
{ {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -4571,10 +4758,10 @@ function hasDifferentCraftCodeWithSet(items: ProductList[]) { ...@@ -4571,10 +4758,10 @@ function hasDifferentCraftCodeWithSet(items: ProductList[]) {
const seen = new Set() const seen = new Set()
for (const item of items) { for (const item of items) {
if (seen.has(item.craftCode)) { if (seen.has(item.craftType)) {
if (seen.size > 1) return true if (seen.size > 1) return true
} else { } else {
seen.add(item.craftCode) seen.add(item.craftType)
if (seen.size > 1) return true if (seen.size > 1) return true
} }
} }
...@@ -5146,7 +5333,11 @@ const loadWarehouseList = async () => { ...@@ -5146,7 +5333,11 @@ const loadWarehouseList = async () => {
console.error(e) console.error(e)
} }
} }
const processType = ref([ interface ProcessTypeData {
label: string
value: string
}
const processType = ref<ProcessTypeData[]>([
{ {
label: '烫画', label: '烫画',
value: 'TH', value: 'TH',
......
...@@ -10,8 +10,122 @@ ...@@ -10,8 +10,122 @@
size="default" size="default"
inline inline
> >
<!-- 批量下载 -->
<ElFormItem label="创建时间" v-if="
status === 'BATCH_DOWNLOAD'
">
<el-date-picker
v-model="timeRange"
:teleported="false"
:default-time="[
new Date(0, 0, 0, 0, 0, 0),
new Date(0, 0, 0, 23, 59, 59),
]"
value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange"
style="width: 280px"
:shortcuts="pickerOptions.shortcuts"
start-placeholder="开始时间"
end-placeholder="结束时间"
clearable
>
</el-date-picker>
</ElFormItem>
<ElFormItem label="创建人" v-if="
status === 'BATCH_DOWNLOAD'
">
<ElSelect
v-model="searchForm.employeeId"
placeholder="请选择"
clearable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in employeeList"
:key="index"
:value="item.id"
:label="item.account"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="工艺类型" v-if="
status === 'BATCH_DOWNLOAD'
">
<ElSelect
v-model="searchForm.craftType"
placeholder="请选择"
clearable
filterable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in processType"
:key="index"
:value="item.value"
:label="item.label"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="下载状态" v-if="
status === 'BATCH_DOWNLOAD'
">
<ElSelect
v-model="searchForm.downloadStatus"
placeholder="下载状态"
clearable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in ['未下载', '已下载']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="排版状态" v-if="
status === 'BATCH_DOWNLOAD'
">
<ElSelect
v-model="searchForm.syntheticStatus"
placeholder="排版状态"
clearable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in ['否', '是']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="自动排版" v-if="
status === 'BATCH_DOWNLOAD'
">
<ElSelect
v-model="searchForm.automaticComposing"
placeholder="自动排版"
clearable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in ['否', '是']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<!-- <div> --> <!-- <div> -->
<ElFormItem label="仓库"> <ElFormItem label="仓库" v-if="
status !== 'BATCH_DOWNLOAD'
">
<ElSelect <ElSelect
v-model="searchForm.warehouseId" v-model="searchForm.warehouseId"
clearable clearable
...@@ -28,7 +142,9 @@ ...@@ -28,7 +142,9 @@
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="工艺"> <ElFormItem label="工艺" v-if="
status !== 'BATCH_DOWNLOAD'
">
<LogisticsWaySelect <LogisticsWaySelect
v-model="searchForm.craftCode" v-model="searchForm.craftCode"
:company-list="craftList" :company-list="craftList"
...@@ -37,7 +153,9 @@ ...@@ -37,7 +153,9 @@
start-placeholder="请选择工艺名称" start-placeholder="请选择工艺名称"
></LogisticsWaySelect> ></LogisticsWaySelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="库存SKU"> <ElFormItem label="库存SKU" v-if="
status !== 'BATCH_DOWNLOAD'
">
<ElInput <ElInput
v-model.trim="searchForm.thirdSkuCode" v-model.trim="searchForm.thirdSkuCode"
placeholder="库存SKU" placeholder="库存SKU"
...@@ -45,7 +163,9 @@ ...@@ -45,7 +163,9 @@
style="width: 150px" style="width: 150px"
></ElInput> ></ElInput>
</ElFormItem> </ElFormItem>
<ElFormItem label="款号"> <ElFormItem label="款号" v-if="
status !== 'BATCH_DOWNLOAD'
">
<ElInput <ElInput
v-model="searchForm.supplierProductNo" v-model="searchForm.supplierProductNo"
placeholder="款号" placeholder="款号"
...@@ -61,7 +181,9 @@ ...@@ -61,7 +181,9 @@
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="生产单号"> <ElFormItem label="生产单号" v-if="
status !== 'BATCH_DOWNLOAD'
">
<ElInput <ElInput
v-model="searchForm.factorySubOrderNumber" v-model="searchForm.factorySubOrderNumber"
placeholder="生产单号" placeholder="生产单号"
...@@ -69,7 +191,9 @@ ...@@ -69,7 +191,9 @@
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="店铺单号"> <ElFormItem label="店铺单号" v-if="
status !== 'BATCH_DOWNLOAD'
">
<ElInput <ElInput
v-model="searchForm.shopNumber" v-model="searchForm.shopNumber"
placeholder="店铺单号" placeholder="店铺单号"
...@@ -77,7 +201,9 @@ ...@@ -77,7 +201,9 @@
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="尺码类型"> <ElFormItem label="尺码类型" v-if="
status !== 'BATCH_DOWNLOAD'
">
<ElSelect <ElSelect
v-model="searchForm.sizeType" v-model="searchForm.sizeType"
clearable clearable
...@@ -93,7 +219,9 @@ ...@@ -93,7 +219,9 @@
></el-option> ></el-option>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="平台"> <ElFormItem label="平台" v-if="
status !== 'BATCH_DOWNLOAD'
">
<ElSelect <ElSelect
v-model="searchForm.platform" v-model="searchForm.platform"
value-key="" value-key=""
...@@ -119,7 +247,9 @@ ...@@ -119,7 +247,9 @@
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<!-- </div> --> <!-- </div> -->
<ElFormItem label="类型"> <ElFormItem label="类型" v-if="
status !== 'BATCH_DOWNLOAD'
">
<el-radio-group <el-radio-group
v-model="searchForm.customizedQuantity" v-model="searchForm.customizedQuantity"
@click.stop="(e: Event) => handleRadioGroupClick(e)" @click.stop="(e: Event) => handleRadioGroupClick(e)"
...@@ -129,7 +259,9 @@ ...@@ -129,7 +259,9 @@
<el-radio-button label="normal">普品</el-radio-button> <el-radio-button label="normal">普品</el-radio-button>
</el-radio-group> </el-radio-group>
</ElFormItem> </ElFormItem>
<ElFormItem label="数量"> <ElFormItem label="数量" v-if="
status !== 'BATCH_DOWNLOAD'
">
<el-radio-group <el-radio-group
v-model="searchForm.multi" v-model="searchForm.multi"
@click.stop="(e: Event) => handleMultiRadioGroupClick(e)" @click.stop="(e: Event) => handleMultiRadioGroupClick(e)"
...@@ -139,7 +271,9 @@ ...@@ -139,7 +271,9 @@
</el-radio-group> </el-radio-group>
</ElFormItem> </ElFormItem>
<ElFormItem> <ElFormItem>
<ElPopover placement="bottom" width="600" trigger="click"> <ElPopover placement="bottom" width="600" trigger="click" v-if="
status !== 'BATCH_DOWNLOAD'
">
<ElForm <ElForm
ref="searchFormPopoverRef" ref="searchFormPopoverRef"
:model="searchForm" :model="searchForm"
...@@ -704,7 +838,7 @@ ...@@ -704,7 +838,7 @@
</ElFormItem> </ElFormItem>
<ElFormItem v-if="status === 'TO_BE_ARRANGE'"> <ElFormItem v-if="status === 'TO_BE_ARRANGE'">
<span class="item"> <span class="item">
<ElButton type="warning" @click="showArrange(2)">排单完成</ElButton> <ElButton type="warning" @click="showArrange(2)">排单</ElButton>
</span> </span>
</ElFormItem> </ElFormItem>
<ElFormItem <ElFormItem
...@@ -2930,7 +3064,7 @@ ...@@ -2930,7 +3064,7 @@
:uploadList="uploadList" :uploadList="uploadList"
></uploadBox> ></uploadBox>
</template> </template>
<script setup lang="ts"> <script setup lang="tsx">
import LogisticsWaySelect from '../../logistics/components/LogisticsWaySelect.tsx' import LogisticsWaySelect from '../../logistics/components/LogisticsWaySelect.tsx'
import { getUserMarkList } from '@/api/common' import { getUserMarkList } from '@/api/common'
// import { AnyObject } from '@/types/api/warehouse' // import { AnyObject } from '@/types/api/warehouse'
...@@ -3010,6 +3144,7 @@ import { ...@@ -3010,6 +3144,7 @@ import {
getLogisticsWayApi, getLogisticsWayApi,
printNormalPickPdfApi, printNormalPickPdfApi,
updatePRNDownloadStatus, updatePRNDownloadStatus,
getEmployeeListApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
...@@ -3046,7 +3181,7 @@ import { ...@@ -3046,7 +3181,7 @@ import {
CircleCheckFilled, CircleCheckFilled,
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import { Column, ElFormItem, ElMessage } from 'element-plus' import { Column, ElFormItem, ElMessage } from 'element-plus'
import { computed, onMounted, ref, nextTick, reactive } from 'vue' import { computed, onMounted, ref, nextTick, reactive} from 'vue'
import FastProduction from './FastProduction.vue' import FastProduction from './FastProduction.vue'
import { filePath } from '@/api/axios' import { filePath } from '@/api/axios'
import PodMakeOrder from './PodMakeOrder.vue' import PodMakeOrder from './PodMakeOrder.vue'
...@@ -3107,6 +3242,7 @@ const printWarehouseSkuDialogRef = ref() ...@@ -3107,6 +3242,7 @@ const printWarehouseSkuDialogRef = ref()
const isAuto = ref(true) const isAuto = ref(true)
const countryList = ref([]) const countryList = ref([])
const logisticsWayList = ref<{ name: string; id: number }[]>([]) const logisticsWayList = ref<{ name: string; id: number }[]>([])
const employeeList = ref<{ account: string; id: number }[]>([])
const currentRow = ref<AddressInfo>({ const currentRow = ref<AddressInfo>({
receiverName: '', receiverName: '',
receiverPhone: '', receiverPhone: '',
...@@ -3555,6 +3691,36 @@ const handleReComposingDesign = async () => { ...@@ -3555,6 +3691,36 @@ const handleReComposingDesign = async () => {
typesettingRow.value = undefined typesettingRow.value = undefined
} }
} }
interface ProcessTypeData {
label: string
value:string
}
const processType = ref<ProcessTypeData[]>([
{
label: '烫画',
value: 'TH',
},
{
label: '直喷',
value: 'ZP',
},
{
label: '刺绣',
value: 'CX',
},
{
label: '雕刻',
value: 'DK',
},
{
label: '白胚',
value: 'BP',
},
{
label: '其他',
value: 'QT',
},
])
const tableColumns = computed(() => { const tableColumns = computed(() => {
let arr = [] let arr = []
if (status.value === 'BATCH_DOWNLOAD') { if (status.value === 'BATCH_DOWNLOAD') {
...@@ -3590,6 +3756,34 @@ const tableColumns = computed(() => { ...@@ -3590,6 +3756,34 @@ const tableColumns = computed(() => {
prop: 'employeeAccount', prop: 'employeeAccount',
align: 'center', align: 'center',
}, },
{
label: '工艺类型',
width: 150,
prop: 'craftType',
align: 'center',
render: (item:ProductList) => {
if (!item.craftType) {
return (
<div>
<span>-</span>
</div>
)
}
// 分割字符串并查找对应的 label
const labels = item.craftType
.split(',')
.map(type => type.trim())
.map(type => processType.value.find(e => e.value === type)?.label || type)
.filter(Boolean)
return (
<div>
<span>{labels.join(',')}</span>
</div>
)
}
},
{ {
label: '创建时间', label: '创建时间',
...@@ -3614,7 +3808,7 @@ const tableColumns = computed(() => { ...@@ -3614,7 +3808,7 @@ const tableColumns = computed(() => {
}, },
{ {
label: '失败原因', label: '失败原因',
minWidth: 250, minWidth: 200,
prop: 'failReason', prop: 'failReason',
slot: 'failReason', slot: 'failReason',
align: 'left', align: 'left',
...@@ -3938,7 +4132,11 @@ const { ...@@ -3938,7 +4132,11 @@ const {
baseparams.tagsIdArr && delete baseparams.tagsIdArr baseparams.tagsIdArr && delete baseparams.tagsIdArr
// 批量下载 // 批量下载
if (status.value === 'BATCH_DOWNLOAD') { if (status.value === 'BATCH_DOWNLOAD') {
return batchDownloadApi(page, pageSize).then((res) => { const params = {
...baseparams
}
return batchDownloadApi(params,
page, pageSize).then((res) => {
return res.data return res.data
}) as never }) as never
} else if ( } else if (
...@@ -5043,7 +5241,7 @@ const showArrange = async (type: number, data?: PodUsOrderListData) => { ...@@ -5043,7 +5241,7 @@ const showArrange = async (type: number, data?: PodUsOrderListData) => {
if (bool) { if (bool) {
try { try {
await ElMessageBox.confirm( await ElMessageBox.confirm(
'选中排单的生产单存在多个工艺, 是否继续排单?', '选中排单的生产单存在多个工艺类型, 是否继续排单?',
'提示', '提示',
{ {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -5067,10 +5265,10 @@ function hasDifferentCraftCodeWithSet(items: ProductList[]) { ...@@ -5067,10 +5265,10 @@ function hasDifferentCraftCodeWithSet(items: ProductList[]) {
const seen = new Set() const seen = new Set()
for (const item of items) { for (const item of items) {
if (seen.has(item.craftCode)) { if (seen.has(item.craftType)) {
if (seen.size > 1) return true if (seen.size > 1) return true
} else { } else {
seen.add(item.craftCode) seen.add(item.craftType)
if (seen.size > 1) return true if (seen.size > 1) return true
} }
} }
...@@ -5897,32 +6095,7 @@ const loadWarehouseList = async () => { ...@@ -5897,32 +6095,7 @@ const loadWarehouseList = async () => {
console.error(e) console.error(e)
} }
} }
const processType = ref([
{
label: '烫画',
value: 'TH',
},
{
label: '直喷',
value: 'ZP',
},
{
label: '刺绣',
value: 'CX',
},
{
label: '雕刻',
value: 'DK',
},
{
label: '白胚',
value: 'BP',
},
{
label: '其他',
value: 'QT',
},
])
// 获取工艺列表 // 获取工艺列表
const craftList = ref<IAllList[]>([]) const craftList = ref<IAllList[]>([])
...@@ -6496,8 +6669,15 @@ const getLogisticsWay = async () => { ...@@ -6496,8 +6669,15 @@ const getLogisticsWay = async () => {
logisticsWayList.value = data logisticsWayList.value = data
} }
const getEmployeeList = async () => {
const { data } = await getEmployeeListApi()
employeeList.value = data
}
getPermission() getPermission()
getLogisticsWay() getLogisticsWay()
getEmployeeList()
const globalProperties = const globalProperties =
getCurrentInstance()?.appContext.config.globalProperties // 获取全局挂载 getCurrentInstance()?.appContext.config.globalProperties // 获取全局挂载
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
<div class="box"> <div class="box">
所有生产单按{{ getLabels(item.groupField) }}进行自动排单 所有生产单按{{ getLabels(item.groupField) }}进行自动排单
</div> </div>
<div class="box">批次数量:{{ item.arrangeMax }}</div> <div class="box">烫画批次数量:{{ item.thArrangeMax }}</div>
<div class="box">非烫画批次数量:{{ item.arrangeMax }}</div>
<div class="box">每天{{ getTime(item) }}开始自动排单</div> <div class="box">每天{{ getTime(item) }}开始自动排单</div>
</div> </div>
<div class="action"> <div class="action">
...@@ -154,31 +155,6 @@ ...@@ -154,31 +155,6 @@
<div <div
style="border-top: 1px solid; color: #dcdfe6; padding-top: 10px" style="border-top: 1px solid; color: #dcdfe6; padding-top: 10px"
> >
<el-form-item
label="自动排单一个批次里生产单的最大值为:"
prop="arrangeMax"
:rules="[
{
required: true,
message: '请输入数量',
trigger: ['blur'],
},
{
pattern: /^\d+$/,
message: '请输入整数',
trigger: ['blur', 'change'],
},
]"
>
<el-input
v-model="editForm.arrangeMax"
style="width: 200px"
placeholder="请输入数量"
></el-input>
</el-form-item>
<div style="color: #f56c6c; margin: 10px 0">
注:系统限制烫画工艺一个批次不超过50个生产单!
</div>
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<div style="color: #606266; margin-right: 10px"> <div style="color: #606266; margin-right: 10px">
烫画工艺自动排版: 烫画工艺自动排版:
...@@ -195,9 +171,12 @@ ...@@ -195,9 +171,12 @@
--el-switch-off-color: #f56c6c; --el-switch-off-color: #f56c6c;
" "
/> />
<div
style="color: #606266; margin-left: 155px; margin-right: 10px"
>
状态:
</div> </div>
<div style="display: flex; align-items: center">
<div style="color: #606266; margin-right: 10px">状态:</div>
<el-switch <el-switch
v-model="editForm.status" v-model="editForm.status"
active-value="ACTIVE" active-value="ACTIVE"
...@@ -212,20 +191,109 @@ ...@@ -212,20 +191,109 @@
" "
/> />
</div> </div>
<div v-if="editForm.isAuto"> <div v-if="editForm.isAuto">
<div label="排版类型:"> <el-row :gutter="40">
<el-radio-group v-model="editForm.type"> <el-col :span="380">
<el-form-item
label="排版类型:"
prop="type"
label-width="100"
:rules="
editForm.isAuto
? [
{
required: true,
message: '请选择排版类型',
trigger: 'change',
},
]
: []
"
>
<el-radio-group
v-model="editForm.type"
:required="editForm.isAuto"
@change="() => {
if (editForm.thArrangeMax) {
editFormRef?.validateField('thArrangeMax')
}
}"
>
<el-radio label="tiff">tiff排版</el-radio> <el-radio label="tiff">tiff排版</el-radio>
<el-radio label="png">png排版</el-radio> <el-radio label="png">png排版</el-radio>
</el-radio-group> </el-radio-group>
</div> </el-form-item>
<div label="排版宽度:"> </el-col>
<el-radio-group v-model="editForm.templateWidth">
<el-col :span="12">
<el-form-item
label="排版宽度:"
prop="templateWidth"
label-width="100"
:rules="
editForm.isAuto
? [
{
required: true,
message: '请选择排版宽度',
trigger: 'change',
},
]
: []
"
>
<el-radio-group
v-model="editForm.templateWidth"
:required="editForm.isAuto"
>
<el-radio :value="42">40+2cm</el-radio> <el-radio :value="42">40+2cm</el-radio>
<el-radio :value="60">60cm</el-radio> <el-radio :value="60">60cm</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item>
</el-col>
</el-row>
<div style="color: #f56c6c; margin: 5px 0">
<!-- 注:系统限制烫画工艺一个批次不超过50个生产单! -->
注:系统限制烫画工艺排TIFF类型一个批次生产单件数不超过40,排PNG类型一个批次生产单件数不超过100!
</div> </div>
</div> </div>
<el-form-item
label="烫画类工艺自动排单一个批次里生产单件数的最大值为:"
prop="thArrangeMax"
label-width="380"
:rules="thArrangeMaxRules"
>
<el-input
v-model="editForm.thArrangeMax"
style="width: 200px"
placeholder="请输入数量"
></el-input>
</el-form-item>
<el-form-item
label="非烫画类工艺自动排单一个批次里生产单件数的最大值为:"
prop="arrangeMax"
label-width="380"
:rules="[
{
required: true,
message: '请输入数量',
trigger: ['blur'],
},
{
pattern: /^\d+$/,
message: '请输入整数',
trigger: ['blur', 'change'],
},
]"
>
<el-input
v-model="editForm.arrangeMax"
style="width: 200px"
placeholder="请输入数量"
></el-input>
</el-form-item>
</div> </div>
<el-form-item> <el-form-item>
...@@ -252,9 +320,11 @@ import { ...@@ -252,9 +320,11 @@ import {
import { Plus, Minus } from '@element-plus/icons-vue' import { Plus, Minus } from '@element-plus/icons-vue'
import LogDialog from '.././components/dialog.tsx' import LogDialog from '.././components/dialog.tsx'
import CustomizeForm from '@/components/CustomizeForm.tsx'
import { Edit } from '@element-plus/icons-vue' import { Edit } from '@element-plus/icons-vue'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
import type { FormInstance } from 'element-plus'
import { computed } from 'vue'
import type { FormItemRule } from 'element-plus'
const editForm = ref<BaseForm>({ isAuto: false, status: 'ACTIVE' }) const editForm = ref<BaseForm>({ isAuto: false, status: 'ACTIVE' })
const tableData = ref([]) const tableData = ref([])
...@@ -284,18 +354,69 @@ onMounted(() => { ...@@ -284,18 +354,69 @@ onMounted(() => {
const dialogVisible = ref(false) const dialogVisible = ref(false)
const editFormRef = ref<InstanceType<typeof CustomizeForm> | null>(null) const editFormRef = ref<FormInstance | null>(null)
const paramsList = ref(['craft_type']) const paramsList = ref(['craft_type'])
const rulesList = ref([ const rulesList = ref([
{ label: '工艺', value: 'craft_type', disabled: false }, { label: '工艺类型', value: 'craft_type', disabled: false },
{ label: '款号', value: 'supplier_product_no', disabled: false }, { label: '库存款号', value: 'supplier_product_no', disabled: false },
{ label: '尺码', value: 'size', disabled: false }, { label: '产品尺码', value: 'size', disabled: false },
{ label: '类型', value: 'customized_quantity', disabled: false }, { label: '定制类型', value: 'customized_quantity', disabled: false },
]) ])
/** /**
* @description: 烫画类工艺自动排单最大值的校验规则
*/
const thArrangeMaxRules = computed(() => {
return [
{
required: true,
message: '请输入数量',
trigger: ['blur'],
},
{
pattern: /^\d+$/,
message: '请输入整数',
trigger: ['blur', 'change'],
},
{
validator: (
_rule: FormItemRule,
value: string | number | undefined,
callback: (error?: Error) => void
) => {
if (!value) {
callback()
return
}
const numValue = Number(value)
if (isNaN(numValue)) {
callback()
return
}
if (editForm.value.type === 'tiff') {
if (numValue > 40) {
callback(new Error('排版类型为TIFF时,最大值不能超过40'))
} else {
callback()
}
} else if (editForm.value.type === 'png') {
if (numValue > 100) {
callback(new Error('排版类型为PNG时,最大值不能超过100'))
} else {
callback()
}
} else {
callback()
}
},
trigger: ['blur', 'change'],
},
]
})
/**
* @description: 取消按钮 * @description: 取消按钮
*/ */
function cancelFn() { function cancelFn() {
...@@ -335,6 +456,7 @@ interface rowData extends BaseForm { ...@@ -335,6 +456,7 @@ interface rowData extends BaseForm {
interface BaseForm { interface BaseForm {
id?: number id?: number
time?: string time?: string
thArrangeMax?: number
arrangeMax?: number arrangeMax?: number
isAuto?: boolean isAuto?: boolean
factoryNo?: number factoryNo?: number
...@@ -457,7 +579,7 @@ const getLabels = (item: string) => { ...@@ -457,7 +579,7 @@ const getLabels = (item: string) => {
* @description: 新增按钮打开弹窗 * @description: 新增按钮打开弹窗
*/ */
function addDialog() { function addDialog() {
editForm.value = { isAuto: false } editForm.value = { isAuto: true }
paramsList.value = ['craft_type'] paramsList.value = ['craft_type']
dialogVisible.value = true dialogVisible.value = true
} }
......
...@@ -215,6 +215,7 @@ import { ...@@ -215,6 +215,7 @@ import {
IsizeType, IsizeType,
IPropertyResponseItem, IPropertyResponseItem,
Iprice, Iprice,
IPropertyItem,
} from './types/index.ts' } from './types/index.ts'
const [editForm, resetEditForm] = useValue<IsupplierType>({}) const [editForm, resetEditForm] = useValue<IsupplierType>({})
...@@ -952,7 +953,7 @@ async function addPice(product: IgoodsType) { ...@@ -952,7 +953,7 @@ async function addPice(product: IgoodsType) {
} }
// 辅助函数:创建属性映射 // 辅助函数:创建属性映射
function createPropertyMap(propertyList: any[]): Map<number, number[]> { function createPropertyMap(propertyList: IPropertyItem[]): Map<number, number[]> {
const map = new Map<number, number[]>() const map = new Map<number, number[]>()
propertyList.forEach((item) => { propertyList.forEach((item) => {
......
...@@ -20,7 +20,7 @@ export interface IgoodsType { ...@@ -20,7 +20,7 @@ export interface IgoodsType {
customProductItemList?: Iprice[] customProductItemList?: Iprice[]
supplierPriceItemList?: Iprice[] supplierPriceItemList?: Iprice[]
customProductInfo?: IgoodsType customProductInfo?: IgoodsType
propertyList?: [] propertyList?: IPropertyItem[]
supplyPriceRange?: string supplyPriceRange?: string
} }
export interface IsupplierType { export interface IsupplierType {
...@@ -57,6 +57,11 @@ export interface IPropertyResponseItem { ...@@ -57,6 +57,11 @@ export interface IPropertyResponseItem {
valueList: IcolorType[] | IsizeType[] valueList: IcolorType[] | IsizeType[]
} }
export interface IPropertyItem {
propertyId?: number
valueId?: number
}
export interface Iprice { export interface Iprice {
productItemSku?: string productItemSku?: string
productItemImage?: string productItemImage?: string
......
...@@ -1059,7 +1059,7 @@ const { ...@@ -1059,7 +1059,7 @@ const {
}) })
const setCostPrice = (item: InterProductList) => { const setCostPrice = (item: InterProductList) => {
if (!item.costPrice) { if (item.costPrice !== 0 && !item.costPrice) {
ElMessage.warning('商品成本价为空,请完善商品成本价') ElMessage.warning('商品成本价为空,请完善商品成本价')
return return
} }
......
...@@ -1063,7 +1063,7 @@ const { ...@@ -1063,7 +1063,7 @@ const {
}) })
const setCostPrice = (item: InterProductList) => { const setCostPrice = (item: InterProductList) => {
if (!item.costPrice) { if (item.costPrice !== 0 && !item.costPrice) {
ElMessage.warning('商品成本价为空,请完善商品成本价') ElMessage.warning('商品成本价为空,请完善商品成本价')
return return
} }
......
...@@ -1216,7 +1216,7 @@ const { ...@@ -1216,7 +1216,7 @@ const {
}) })
const setCostPrice = (item: InterProductList) => { const setCostPrice = (item: InterProductList) => {
if (!item.costPrice) { if (item.costPrice !== 0 && !item.costPrice) {
ElMessage.warning('商品成本价为空,请完善商品成本价') ElMessage.warning('商品成本价为空,请完善商品成本价')
return return
} }
......
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