Commit 01070396 by zhuzhequan

工厂端提交

parent 5dc1a684
......@@ -11,6 +11,7 @@ declare module 'vue' {
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDate: typeof import('element-plus/es')['ElDate']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
......
......@@ -35,6 +35,7 @@ export function getOrderTabData() {
'factory/customJomallOrder/findStateGroupList',
)
}
// 确认生产
export function confirmProductionOrder(ids: number[]) {
return axios.post<never, BaseRespData<never>>(
......@@ -50,18 +51,23 @@ export function downloadOrder(id: number) {
{ params: { id } },
)
}
// 重新生成稿件
export function reGenerateScriptUrlApi(ids: number[]) {
export function reGenerateScriptUrlApi(ids: string) {
return axios.post<never, BaseRespData<never>>(
'factory/customJomallOrder/downloadAgain',
'factory/customJomallOrder/rebuildFileByOrderId',
ids,
)
}
export function reCreateScriptUrlApi(ids: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/customJomallOrder/rebuildFileByOrderIds',
ids,
export function reCreateScriptUrlApi(id: string) {
return axios.get<never, BaseRespData<never>>(
'factory/customJomallOrder/rebuildFileByOrderId',
{
params:{
id
}
},
)
}
......@@ -74,14 +80,10 @@ export function printOrder(ids: number[]) {
}
// 导出生产单
export function exportOrder(status?: string | number) {
return axios.get<never, BaseRespData<never>>(
export function exportOrder(data?: { ids: number[], status: string | number }) {
return axios.post<never, BaseRespData<never>>(
'factory/customJomallOrder/exportData',
{
params: {
status,
},
},
data,
)
}
......@@ -96,6 +98,7 @@ export function getOrderBySubOrderNumber(orderNumber: string) {
},
)
}
export function getQaOrderBySubOrderNumber(orderNumber: string) {
return axios.get<never, BaseRespData<QaData[]>>(
'factory/customJomallOrder/inspectionQuery',
......@@ -106,6 +109,7 @@ export function getQaOrderBySubOrderNumber(orderNumber: string) {
},
)
}
// 质检完成
export function qaFinishedApi(data: InspectionData[]) {
return axios.post<never, BaseRespData<never>>(
......@@ -132,6 +136,7 @@ export function addInternalTagApi(idList: number[], memo: string) {
{ idList, content: memo },
)
}
// 查看发货单
export function loadSendOutList(id: number) {
return axios.get<never, BaseRespData<SendOrderData[]>>(
......@@ -143,6 +148,7 @@ export function loadSendOutList(id: number) {
},
)
}
// 操作日志
export function getLogList(id: number) {
return axios.get<never, BaseRespData<LogListData[]>>(
......@@ -181,6 +187,7 @@ export function refreshProductInfo(data: number[]) {
data,
)
}
export function getDeliveryNoteList(
data: DeliveryNoteSearchForm,
currentPage: number,
......@@ -195,6 +202,7 @@ export function getDeliveryNoteList(
},
)
}
export function customJomallReconciliation(
data: AccountStatementNoteSearchForm,
currentPage: number,
......@@ -209,7 +217,8 @@ export function customJomallReconciliation(
},
)
}
export function printDeliveryNote(data: string[],userMark?:string) {
export function printDeliveryNote(data: string[], userMark?: string) {
return axios.post<never, BaseRespData<never>>(
'factory/customJomallShipment/printInvoiceStatistics',
{
......@@ -219,6 +228,7 @@ export function printDeliveryNote(data: string[],userMark?:string) {
},
)
}
export function createReconciliation(data: { shipmentIdList: number[] }) {
return axios.post<never, BaseRespData<never>>(
'factory/customJomallReconciliation/createReconciliation',
......@@ -247,6 +257,7 @@ export function getOrderByIdApi(id?: number) {
},
)
}
export function getReconciliationAmount(id?: number) {
return axios.get<never, BaseRespData<CountStatus[]>>(
'factory/customJomallReconciliation/getReconciliationAmount',
......@@ -257,17 +268,18 @@ export function getReconciliationAmount(id?: number) {
},
)
}
export function getCustomJomallReconciliationById(id?: number) {
return axios.get<never, BaseRespData<OrderData>>(
'factory/customJomallReconciliation/getById',
{
params:{
id
}
}
params: {
id,
},
},
)
}
export function customJomallReconciliationLog(reconciliationId?: number) {
return axios.get<never, BaseRespData<OrderData>>(
'factory/customJomallReconciliationLog/getListById',
......@@ -278,6 +290,7 @@ export function customJomallReconciliationLog(reconciliationId?: number) {
},
)
}
export function updateReconciliation(
data: AccountStatementNote,
) {
......@@ -286,6 +299,7 @@ export function updateReconciliation(
data,
)
}
export function getShipmentDetailsById(shipmentId?: string) {
return axios.get<never, BaseRespData<AccountStatementNote[]>>(
'factory/customJomallReconciliation/getShipmentDetailsById',
......@@ -302,6 +316,6 @@ export function factoryConfirm(
) {
return axios.post(
'factory/customJomallReconciliation/factoryConfirm',
data
data,
)
}
\ No newline at end of file
......@@ -2,68 +2,113 @@
import { Splitpanes, Pane } from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
import { onMounted, onUnmounted, ref } from 'vue'
defineProps({
size: {
default: '15',
type: String
}
const props = defineProps({
size: {
default: '',
type: String,
},
})
const domSize = ref<number>(0)
function domResize() {
const father = document.getElementsByClassName('splitpanes')[0]
const top = document.getElementById('top')
const v = ((top.clientHeight / father.clientHeight) * 100).toFixed(2)
if (props.size === '') {
domSize.value = v
} else {
domSize.value = props.size
}
}
onUnmounted(()=>{
window.removeEventListener('resize', domResize)
})
onMounted(() => {
window.addEventListener('resize', domResize)
domResize()
})
defineExpose({
domResize
})
</script>
<template>
<splitpanes horizontal style="height: 100%">
<pane :size="size">
<slot name="top"></slot>
</pane>
<pane style="flex: 1; flex-shrink: 0">
<slot name="bottom"></slot>
</pane>
</splitpanes>
<splitpanes horizontal style="height: 100%">
<pane :size="domSize">
<div id="top">
<slot name="top"></slot>
</div>
</pane>
<pane style="flex: 1; flex-shrink: 0">
<div id="bottom">
<slot name="bottom"></slot>
</div>
</pane>
</splitpanes>
</template>
<style scoped lang="scss">
#top {
height: fit-content;
}
#bottom {
height: 100%;
}
#top, #bottom {
display: flex;
flex-direction: column;
}
::v-deep(.splitpanes__splitter) {
width: 100%;
border-left: 1px solid #eee;
margin-left: -1px;
background-color: #ececec;
cursor: row-resize;
box-sizing: border-box;
position: relative;
flex-shrink: 0;
min-width: 1px;
margin-top: 5px;
margin-bottom: 5px;
&::before{
margin-top: -2px;
background-color: #00000040;
transform: translate(-50%);
width: 30px;
height: 1px;
content: "";
position: absolute;
top: 50%;
left: 50%;
transition: background-color .3s;
}
&::after{
margin-top: 1px;
background-color: #00000040;
transform: translate(-50%);
width: 30px;
height: 1px;
content: "";
position: absolute;
top: 50%;
left: 50%;
transition: background-color .3s;
}
width: 100%;
border-left: 1px solid #eee;
margin-left: -1px;
background-color: #ececec;
cursor: row-resize;
box-sizing: border-box;
position: relative;
flex-shrink: 0;
min-width: 1px;
margin-top: 5px;
margin-bottom: 5px;
&::before {
margin-top: -2px;
background-color: #00000040;
transform: translate(-50%);
width: 30px;
height: 1px;
content: "";
position: absolute;
top: 50%;
left: 50%;
transition: background-color .3s;
}
&::after {
margin-top: 1px;
background-color: #00000040;
transform: translate(-50%);
width: 30px;
height: 1px;
content: "";
position: absolute;
top: 50%;
left: 50%;
transition: background-color .3s;
}
}
::v-deep(.splitpanes__pane) {
.el-card {
height: 100%;
}
.el-card {
height: 100%;
}
}
</style>
......@@ -5,6 +5,9 @@ export interface SearchForm {
endProductId: string
orderNumber: string
shopNumber: string
timeType: string | null
startTime?: string | null
endTime?: string | null
logisticsTracking: string
lanshouName: string
billNumber: string
......
......@@ -286,6 +286,7 @@ const productProps = [
{ label: '质检(不通过)', key: 'notPassNum' },
],
]
const logisticsProps = [
{ label: '订单号', key: 'orderNumber', copyable: true },
{
......
<template>
<div class="card flex-column h-100 overflow-hidden">
<split-div size="10">
<split-div ref="splitRef">
<template #top>
<div class="header-filter">
<div class="header-filter-form">
<ElForm :model="searchForm" size="default" inline>
<ElFormItem>
<el-select v-model="searchForm.timeType" clearable style="width:100px;margin-right: 5px ;" placeholder="时间类型" >
<el-option v-if="statusCode !== 6" value="1" label="创建时间"></el-option>
<el-option value="2" label="确认时间"></el-option>
<el-option v-if="statusCode !== 6" value="3" label="完成时间"></el-option>
<el-option v-if="statusCode === 6" value="4" label="发货时间"></el-option>
</el-select>
<el-date-picker
v-model="timeRange"
:default-time="[new Date(0,0,0,0,0,0),new Date(0,0,0,23,59,59)]"
placeholder="收货人"
value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange"
:shortcuts="pickerOptions.shortcuts"
start-placeholder="开始时间"
end-placeholder="结束时间"
clearable
style="width: 210px"
>
</el-date-picker>
</ElFormItem>
<ElFormItem label="SKU">
<ElInput
v-model="searchForm.mainSku"
......@@ -90,12 +112,14 @@
style="width: 130px"
></ElInput>
</ElFormItem>
<ElFormItem>
<ElButton type="primary" @click="search">查询</ElButton>
</ElFormItem>
<!-- <ElFormItem>-->
<!-- <ElButton @click="resetSearchForm">重置</ElButton>-->
<!-- </ElFormItem>-->
<!-- <ElFormItem>-->
<!-- <ElButton @click="resetSearchForm">重置</ElButton>-->
<!-- </ElFormItem>-->
</ElForm>
</div>
<div class="header-filter-tab">
......@@ -126,7 +150,9 @@
v-if="statusCode === 2 || statusCode === 3 || statusCode === 4"
class="item"
>
<ElButton :disabled="selection.find(item=>item.manuscriptStatus !== 30)" type="warning" is-dark @click="downloadManuscript"
<ElButton
:disabled="selection.find(item=>item.manuscriptStatus !== 30)" type="warning" is-dark
@click="downloadManuscript"
>下载稿件</ElButton
>
</span>
......@@ -134,7 +160,9 @@
v-if="statusCode === 2 || statusCode === 3 || statusCode === 4"
class="item"
>
<ElButton :disabled="selection.find(item=>item.manuscriptStatus !== 30)" type="success" is-dark @click="reGenerateManuscript"
<ElButton
:disabled="selection.find(item=>item.manuscriptStatus !== 30) || selection.length!==1" type="success" is-dark
@click="reGenerateManuscript"
>重新打包稿件 </ElButton
>
</span>
......@@ -142,7 +170,9 @@
v-if="statusCode === 2 || statusCode === 3 || statusCode === 4"
class="item"
>
<ElButton type="warning" is-dark @click="reCreateManuscript"
<ElButton
:disabled="selection.find(item=>item.manuscriptStatus !== 30) || selection.length!==1"
type="warning" is-dark @click="reCreateManuscript"
>重新生成稿件 </ElButton
>
</span>
......@@ -468,8 +498,10 @@
row.orderNumber
}}</span>
<el-icon class="icon" @click="copy(row.orderNumber || '')"
><DocumentCopy
/></el-icon>
>
<DocumentCopy
/>
</el-icon>
</div>
<!-- <div class="order-list-expand_item_info_title">-->
......@@ -630,7 +662,7 @@
type="primary"
size="large"
@click="searchShipmentByOrderNumber"
>查询
>查询
</el-button>
</div>
<Shipment
......@@ -699,10 +731,10 @@
<template #footer>
<div class="dialog-footer">
<el-button size="large" @click="shipmentVisible = false"
>取消
>取消
</el-button>
<el-button size="large" type="primary" @click="saveShipment"
>发货
>发货
</el-button>
</div>
</template>
......@@ -742,17 +774,17 @@
@keyup.enter="searchQaByOrderNumber"
/>
<el-button type="primary" size="large" @click="searchQaByOrderNumber"
>查询
>查询
</el-button>
</div>
<Quarantine :quarantine="quarantine" />
<template #footer>
<div class="dialog-footer">
<el-button size="large" @click="quarantineVisible = false"
>取消
>取消
</el-button>
<el-button size="large" type="primary" @click="() => saveQuarantine()"
>质检完成
>质检完成
</el-button>
</div>
</template>
......@@ -781,7 +813,7 @@ import type {
LogListData,
ProductList,
} from '@/types/api/order'
import { onMounted, reactive, ref } from 'vue'
import { nextTick, onMounted, reactive, ref } from 'vue'
import useElTableColumnWidth from '@/utils/hooks/useElTableColumnWidth'
import { ArrowDown, ArrowUp, DocumentCopy } from '@element-plus/icons-vue'
import usePageList from '@/utils/hooks/usePageList'
......@@ -799,7 +831,7 @@ import {
reGenerateScriptUrlApi,
refreshProductInfo, reCreateScriptUrlApi,
} from '@/api/order'
import { showError, showConfirm } from '@/utils/ui'
import { showConfirm } from '@/utils/ui'
import { useValue } from '@/utils/hooks/useValue'
import { filePath } from '@/api/axios'
import { getLogisticsCompanyList } from '@/api/common'
......@@ -816,6 +848,7 @@ import Quarantine from './Quarantine.vue'
const [searchForm] = useValue<SearchForm>({
mainSku: '',
endProductId: '',
timeType: '',
logisticsTracking: '',
lanshouName: '',
billNumber: '',
......@@ -825,10 +858,128 @@ const [searchForm] = useValue<SearchForm>({
subOrderNumber: '',
})
const tabsNav = ref<Tab[]>([])
const splitRef = ref<never>()
const btnLoading = ref<boolean>(false)
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 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 statusCode = ref(2)
const selection = ref<OrderData[]>([])
const timeRange = ref<string[]>([])
const logisticsCompanyList = ref<LogisticsData[]>([])
const rules = reactive<FormRules<ShipmentForm>>({
shippingWay: [
......@@ -870,7 +1021,13 @@ const {
} = usePageList({
query: (page, pageSize) =>
getOrderList(
{ ...searchForm.value, status: statusCode.value },
{
...searchForm.value,
status: statusCode.value,
timeType: timeRange.value.length > 0 ? searchForm.value.timeType : null,
startTime: searchForm.value.timeType === '' ? null : timeRange.value.length > 0 ? timeRange.value[0] : null,
endTime: searchForm.value.timeType === '' ? null : timeRange.value.length > 0 ? timeRange.value[1] : null,
},
page,
pageSize,
).then((res) => res.data),
......@@ -948,7 +1105,11 @@ const arraySpanMethod = ({ columnIndex }: SpanMethodProps) => {
}
const changeTab = (item: Tab) => {
statusCode.value = item.statusCode
searchForm.value.timeType = ''
search()
nextTick(()=>{
splitRef.value.domResize()
})
}
const copy = (text: string) => {
navigator.clipboard.writeText(text)
......@@ -1031,7 +1192,7 @@ const downloadManuscript = async () => {
window.open(filePath + path)
})
}
// 重新生成稿件
// 重新打包稿件
const reGenerateManuscript = async () => {
if (selection.value.length === 0) {
return ElMessage({
......@@ -1058,6 +1219,7 @@ const reGenerateManuscript = async () => {
// showError(e)
}
}
//重新生成稿件
const reCreateManuscript = async () => {
if (selection.value.length === 0) {
return ElMessage({
......@@ -1077,7 +1239,7 @@ const reCreateManuscript = async () => {
return
}
try {
const res = await reCreateScriptUrlApi(ids)
const res = await reCreateScriptUrlApi(ids[0])
ElMessage.success(res.message)
search()
} catch (e) {
......@@ -1117,7 +1279,7 @@ const printManuscript = async () => {
// 导出生产单
const exportManuscript = async () => {
try {
const res = await exportOrder(statusCode.value)
const res = await exportOrder({ids:selection.value.map(el=>el.id),status: statusCode.value })
window.open(filePath + res.message)
} catch (e) {
// showError(e)
......
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