Commit 782d121a by qinjianhui

fix: 对账单待确认加驳回

parent 0c69be4f
...@@ -105,13 +105,16 @@ export function getOrderBySubOrderNumber(orderNumber: string) { ...@@ -105,13 +105,16 @@ export function getOrderBySubOrderNumber(orderNumber: string) {
) )
} }
export function getQaOrderBySubOrderNumber(orderNumber: string,shipmentUid?:string) { export function getQaOrderBySubOrderNumber(
orderNumber: string,
shipmentUid?: string,
) {
return axios.get<never, BaseRespData<QaData[]>>( return axios.get<never, BaseRespData<QaData[]>>(
'factory/customJomallOrder/inspectionQuery', 'factory/customJomallOrder/inspectionQuery',
{ {
params: { params: {
subOrderNumber: orderNumber, subOrderNumber: orderNumber,
shipmentUid:shipmentUid, shipmentUid: shipmentUid,
}, },
}, },
) )
...@@ -356,8 +359,20 @@ export function getShipmentOrderDetailById(id?: number | string) { ...@@ -356,8 +359,20 @@ export function getShipmentOrderDetailById(id?: number | string) {
} }
export function confirmOrderApi(data: ConfirmOrderForm) { export function confirmOrderApi(data: ConfirmOrderForm) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>('reconciliation/confirm', data)
'reconciliation/confirm', }
data, export function rejectOrderApi({
) ids,
} description,
\ No newline at end of file pass
}: {
ids: string
pass: number
description: string
}) {
return axios.post<never, BaseRespData<never>>('reconciliation/confirm', {
ids,
description,
pass
})
}
...@@ -117,13 +117,13 @@ ...@@ -117,13 +117,13 @@
> >
确认对账单 确认对账单
</el-button> </el-button>
<!-- <el-button <el-button
v-if="nodeId === 20" v-if="nodeId === 10"
type="warning" type="warning"
@click="auditOrder('pay')" @click="rejectOrder"
> >
付款 驳回
</el-button> --> </el-button>
<el-button <el-button
v-if="nodeId === 30" v-if="nodeId === 30"
type="danger" type="danger"
...@@ -532,11 +532,13 @@ ...@@ -532,11 +532,13 @@
:key="index" :key="index"
style="display: flex" style="display: flex"
> >
<span style="display: inline-block;"> <span style="display: inline-block">
{{ item.create_time }} {{ item.create_time }}
</span> </span>
<span style="margin: 0 5px 0 20px;">{{ item.employee_account }}</span> <span style="margin: 0 5px 0 20px">{{
<span style="display: inline-block;">{{ item.employee_account
}}</span>
<span style="display: inline-block">{{
item.description item.description
}}</span> }}</span>
</li> </li>
...@@ -606,6 +608,7 @@ import { ...@@ -606,6 +608,7 @@ import {
auditOrderApi, auditOrderApi,
getShipmentOrderDetailById, getShipmentOrderDetailById,
confirmOrderApi, confirmOrderApi,
rejectOrderApi,
} from '@/api/order' } from '@/api/order'
import { ref, onMounted, watch, nextTick } from 'vue' import { ref, onMounted, watch, nextTick } from 'vue'
...@@ -620,6 +623,7 @@ import { ...@@ -620,6 +623,7 @@ import {
import { ShipmentOrderDetailData } from '@/types/api/deliveryNote' import { ShipmentOrderDetailData } from '@/types/api/deliveryNote'
import shipmentOrderDetailInfo from '@/components/ShipmentOrderDetail.vue' import shipmentOrderDetailInfo from '@/components/ShipmentOrderDetail.vue'
import ImageView from '@/components/ImageView.vue' import ImageView from '@/components/ImageView.vue'
import { showConfirm } from '@/utils/ui'
// import { getUserMarkList } from '@/api/auth.ts' // import { getUserMarkList } from '@/api/auth.ts'
interface Tree { interface Tree {
...@@ -818,17 +822,62 @@ const auditOrder = (key: string) => { ...@@ -818,17 +822,62 @@ const auditOrder = (key: string) => {
await getTreeNum() await getTreeNum()
}) })
} }
const rejectOrder = () => {
if (selections.value.length === 0) {
return ElMessage.warning('请选择要操作的数据')
}
ElMessageBox.prompt('请输入驳回原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
inputPattern: /.+/,
customClass: 'reject',
inputErrorMessage: '请输入驳回原因',
inputPlaceholder: '驳回原因',
}).then(async ({ value }) => {
const ids = selections.value.map((el) => el.id).join(',')
try {
await rejectOrderApi({ ids: ids, description: value, pass: 0 })
ElMessage.success('操作成功')
search()
await getTreeNum()
} catch (e) {
console.error(e)
}
})
}
const confirmOrder = async () => { const confirmOrder = async () => {
if (selections.value.length === 0) { if (selections.value.length === 0) {
return ElMessage.warning('请选择要操作的数据') return ElMessage.warning('请选择要操作的数据')
} }
confirmOrderVisible.value = true try {
auditForm.value = { await showConfirm('是否确认对账单?', {
pass: 1, confirmButtonText: '确定',
description: '', cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
const ids = selections.value.map((el) => el.id).join(',')
try {
await confirmOrderApi({
ids,
})
confirmOrderVisible.value = false
ElMessage.success('操作成功')
search()
await getTreeNum()
} catch (e) {
console.error(e)
} }
await nextTick() // confirmOrderVisible.value = true
auditFormRef.value!.clearValidate() // auditForm.value = {
// pass: 1,
// description: '',
// }
// await nextTick()
// auditFormRef.value!.clearValidate()
} }
const submitConfirmOrder = async () => { const submitConfirmOrder = async () => {
try { try {
......
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