Commit caafaa17 by wuqian

重新生成

parent 2c4a4234
......@@ -9,7 +9,9 @@ import {
ShipmentForm,
ShipmentOrderRes,
Tab,
InspectionData, CountStatus, Confirm,
InspectionData,
CountStatus,
Confirm,
} from '@/types/api/order'
import {
AccountStatementNote,
......@@ -64,9 +66,9 @@ export function reCreateScriptUrlApi(id: number) {
return axios.get<never, BaseRespData<never>>(
'factory/customJomallOrder/rebuildFileByOrderId',
{
params:{
id
}
params: {
id,
},
},
)
}
......@@ -80,7 +82,7 @@ export function printOrder(ids: number[]) {
}
// 导出生产单
export function exportOrder(data?: { ids: number[], status: string | number }) {
export function exportOrder(data?: { ids: number[]; status: string | number }) {
return axios.post<never, BaseRespData<never>>(
'factory/customJomallOrder/exportData',
data,
......@@ -155,7 +157,18 @@ export function backEndCommentsApi(id: number, remark: string) {
{
params: {
id,
remark
remark,
},
},
)
}
//重新生成
export function regenerateSingle(subNumber: string) {
return axios.get<never, BaseRespData<SendOrderData[]>>(
'productionFile/regenerateSingle',
{
params: {
subNumber,
},
},
)
......@@ -302,9 +315,7 @@ export function customJomallReconciliationLog(reconciliationId?: number) {
)
}
export function updateReconciliation(
data: AccountStatementNote,
) {
export function updateReconciliation(data: AccountStatementNote) {
return axios.post(
'factory/customJomallReconciliation/updateReconciliation',
data,
......@@ -322,11 +333,6 @@ export function getShipmentDetailsById(shipmentId?: string) {
)
}
export function factoryConfirm(
data: Confirm[],
) {
return axios.post(
'factory/customJomallReconciliation/factoryConfirm',
data,
)
export function factoryConfirm(data: Confirm[]) {
return axios.post('factory/customJomallReconciliation/factoryConfirm', data)
}
......@@ -112,7 +112,7 @@
<el-icon
class="icon"
style="color: #e6a23c"
@click="setRemarks(item.id, (item as InterItem).remark||'')"
@click="setRemarks(item.id, (item as InterItem).remark || '')"
><EditPen
/></el-icon>
</div>
......@@ -173,6 +173,12 @@
@click="downloadManuscriptBySubOrder(item)"
>下载稿件</el-button
>
<el-button
type="primary"
size="small"
@click="regenerate(item.subOrderNumber || '')"
>重新生成</el-button
>
</div>
</div>
</div>
......@@ -182,7 +188,7 @@ import { DocumentCopy, EditPen } from '@element-plus/icons-vue'
import { filePath } from '@/api/axios'
import { downloadOrder } from '@/api/order'
import { OrderData, ProductList } from '@/types/api/order'
import { PropType ,defineEmits} from 'vue'
import { PropType, defineEmits } from 'vue'
defineProps({
row: {
type: Object as PropType<OrderData>,
......@@ -197,13 +203,15 @@ defineProps({
},
})
interface InterItem {
id: number;
remark?: string; // 可选属性
[propName: string]: string | number | boolean | undefined | unknown; // 额外属性
id: number
remark?: string // 可选属性
[propName: string]: string | number | boolean | undefined | unknown // 额外属性
}
// 传递多个emit 带参数的事件
const emit = defineEmits<{
(e: 'update-remark', payload: { id: number; remark: string }): void;
}>();
(e: 'update-remark', payload: { id: number; remark: string }): void
(e: 'again-generated', payload: { id: string }): void
}>()
const downloadManuscriptBySubOrder = async (item: ProductList) => {
try {
const res = await downloadOrder(item.id)
......@@ -212,6 +220,9 @@ const downloadManuscriptBySubOrder = async (item: ProductList) => {
//showError(e)
}
}
const regenerate = async (id: string) => {
emit('again-generated', { id })
}
const copy = (text: string) => {
navigator.clipboard.writeText(text)
ElMessage.success('复制成功')
......
......@@ -216,7 +216,10 @@
>重新生成稿件
</ElButton>
</span>
<span v-if="statusCode === 2 || statusCode === 3 || statusCode === 4" class="item">
<span
v-if="statusCode === 2 || statusCode === 3 || statusCode === 4"
class="item"
>
<ElButton
:loading="btnLoading"
type="primary"
......@@ -280,6 +283,7 @@
:row="row"
:status="statusCode"
@update-remark="handleUpdateRemark"
@again-generated="handleAgainGenerated"
/>
<template v-if="row.productList.length > 2">
<div class="order-list-expand_more">
......@@ -919,6 +923,7 @@ import {
exportOrder,
addInternalTagApi,
backEndCommentsApi,
regenerateSingle,
loadSendOutList,
getLogList,
getOrderDetail,
......@@ -1225,6 +1230,24 @@ const handleUpdateRemark = (payload: { id: number; remark: string }) => {
inputValue.value = payload.remark
remarkId.value = payload.id
}
// 重新生成
const handleAgainGenerated = async (payload: { id: string }) => {
try {
const res = await regenerateSingle(payload.id)
search()
ElMessage({
message: res.message,
type: 'success',
offset: window.innerHeight / 2,
})
} catch (e) {
ElMessage({
message: '提交失败,请重试',
type: 'error',
offset: window.innerHeight / 2,
})
}
}
const submitRemark = async () => {
try {
const res = await backEndCommentsApi(remarkId.value, inputValue.value)
......
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