|
@@ -89,7 +89,7 @@ import { useRouter } from 'vue-router'
|
|
|
import mainApi from '~api/expense/invoice'
|
|
|
import { getProjectList } from '~api/other'
|
|
|
import { getArrValue } from 'js-fast-way'
|
|
|
-import { delMessage } from '~uti/tools'
|
|
|
+import { delMessageV2 } from '~com/message/index.js'
|
|
|
import { getTokenHeader } from '~src/api/request/header'
|
|
|
|
|
|
const router = useRouter()
|
|
@@ -235,18 +235,26 @@ const pdfCloseClick = () => {
|
|
|
//删除
|
|
|
const rowCancel = (row) => {
|
|
|
console.log('删除')
|
|
|
- delMessage(async () => {
|
|
|
- const { error, code, msg } = await mainApi.cancel({
|
|
|
- id: row.id,
|
|
|
- })
|
|
|
- //判断状态
|
|
|
- if (!error && code === 200) {
|
|
|
- window.$message?.success(msg)
|
|
|
- getTableData().then()
|
|
|
- } else {
|
|
|
- window.$message?.error(msg)
|
|
|
- }
|
|
|
+ delMessageV2(async (action, instance, done) => {
|
|
|
+ if (action === 'confirm') {
|
|
|
+ instance.confirmButtonLoading = true
|
|
|
+ const { error, code, msg } = await mainApi.cancel({
|
|
|
+ id: row.id,
|
|
|
+ })
|
|
|
+ //判断状态
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message?.success(msg)
|
|
|
+ getTableData().then()
|
|
|
+ } else {
|
|
|
+ window.$message?.error(msg)
|
|
|
+ }
|
|
|
+ instance.confirmButtonLoading = false
|
|
|
+ done()
|
|
|
+ } else {
|
|
|
+ done()
|
|
|
+ }
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//草稿箱
|
|
@@ -294,17 +302,24 @@ const editDraftClick = ({ id }) => {
|
|
|
|
|
|
//删除草稿
|
|
|
const delDraftClick = ({ id }) => {
|
|
|
- delMessage(async () => {
|
|
|
- const { error, code, msg } = await mainApi.remove({
|
|
|
- id: id,
|
|
|
+ delMessageV2(async (action, instance, done) => {
|
|
|
+ if (action === 'confirm') {
|
|
|
+ instance.confirmButtonLoading = true
|
|
|
+ const { error, code, msg } = await mainApi.remove({
|
|
|
+ id: id,
|
|
|
+ })
|
|
|
+ //判断状态
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message?.success(msg)
|
|
|
+ getDraftNum().then()
|
|
|
+ } else {
|
|
|
+ window.$message?.error(msg)
|
|
|
+ }
|
|
|
+ instance.confirmButtonLoading = false
|
|
|
+ done()
|
|
|
+ } else {
|
|
|
+ done()
|
|
|
+ }
|
|
|
})
|
|
|
- //判断状态
|
|
|
- if (!error && code === 200) {
|
|
|
- window.$message?.success(msg)
|
|
|
- getDraftNum().then()
|
|
|
- } else {
|
|
|
- window.$message?.error(msg)
|
|
|
- }
|
|
|
- })
|
|
|
}
|
|
|
</script>
|