Explorar el Código

加二次校验

@dongkboy hace 4 meses
padre
commit
380023ec2f
Se han modificado 1 ficheros con 33 adiciones y 18 borrados
  1. 33 18
      src/views/receivable/handingFee/invoiceRecord.vue

+ 33 - 18
src/views/receivable/handingFee/invoiceRecord.vue

@@ -16,7 +16,7 @@
         </el-col>
         <el-col :span="8">
           <el-form-item prop="invoiceParty" label="开票方">
-            <el-select v-model="form.invoiceParty" clearable >
+            <el-select v-model="form.invoiceParty" clearable>
               <el-option v-for="item in optionObj['invoice_party']" :key="item.value" :value="item.value"
                 :label="item.label"></el-option>
             </el-select>
@@ -24,7 +24,7 @@
         </el-col>
         <el-col :span="8">
           <el-form-item prop="accountsReceivable" label="应收项">
-            <el-select v-model="form.accountsReceivable" clearable >
+            <el-select v-model="form.accountsReceivable" clearable>
               <el-option v-for="item in optionObj['invoice_risk_type']" :key="item.value" :value="item.value"
                 :label="item.label"></el-option>
             </el-select>
@@ -32,7 +32,7 @@
         </el-col>
         <el-col :span="8">
           <el-form-item prop="settlementStatus" label="结算状态">
-            <el-select v-model="form.settlementStatus" clearable >
+            <el-select v-model="form.settlementStatus" clearable>
               <el-option v-for="item in optionObj['settlement_status']" :key="item.value" :value="item.value"
                 :label="item.label"></el-option>
             </el-select>
@@ -146,7 +146,7 @@
 <script setup lang="ts">
 
 import api from "@/api";
-import { ElMessage } from 'element-plus'
+import { ElMessage, ElMessageBox } from 'element-plus'
 
 let form = ref({})
 let tableData = ref([])
@@ -219,24 +219,38 @@ const uploadImage = async (file, fileList) => {
 }
 // 明细查询
 const handleView = (row) => {
-  const href= window.location.href.split('#')
-  const newHref=href[0]+'#/receivable/private/handingFee?activeName=2&id='+row.id
+  const href = window.location.href.split('#')
+  const newHref = href[0] + '#/receivable/private/handingFee?activeName=2&id=' + row.id
   window.open(newHref, '_blank');
 }
 // 删除
 const handleDelete = (row) => {
-  api.financeApi.deleteInvoiceById(row.id).then((res: any) => {
-    if (res.code == 200) {
-      reset()
-      ElMessage({
-        message: res.msg,
-        type: 'success'
-      })
-      initList()
-    } else {
-
+  ElMessageBox.confirm(
+    '确定要删除吗',
+    '删除发票',
+    {
+      confirmButtonText: '确定',
+      type: 'error',
+      center: true,
+      confirmButtonClass: 'el-button--danger',
     }
-  })
+  )
+    .then(() => {
+      api.financeApi.deleteInvoiceById(row.id).then((res: any) => {
+        if (res.code == 200) {
+          reset()
+          ElMessage({
+            message: res.msg,
+            type: 'success'
+          })
+          initList()
+        } else {
+
+        }
+      })
+    })
+    .catch(() => {
+    })
 }
 // 列表
 const initList = () => {
@@ -340,11 +354,12 @@ onMounted(() => {
 </script>
 
 <style scoped lang="scss">
-:deep(.el-upload-dragger){
+:deep(.el-upload-dragger) {
   padding: unset;
   border: unset;
   border-radius: unset;
 }
+
 .pagination {
   margin-top: 10px;
   display: flex;