Commit caafaa17 by wuqian

重新生成

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