Explorar el Código

财务开票作废

wucl hace 11 meses
padre
commit
6d12b20e5a

+ 5 - 2
src/api/modules/financeInvoice.js

@@ -25,12 +25,15 @@ export default {
     return request.get(`financeInvoice/fund/${params1}/${params2}`)
    },
    cancellation(params){
-    return request.get(`financeInvoice/cancellation/${params}`)
+    return request.put(`financeInvoice/cancellation`,params)
    },
    getInvoiceAmountInfo(params){
     return request.post(`financeInvoice/productions`,params)
    },
    invoiceCheck(params) {
     return request.put(`financeInvoice/check`, params)
-  }
+  },
+  cancelling(params){
+    return request.get(`financeInvoice/cancelling/${params}`)
+   },
 }

+ 34 - 12
src/views/assets/myOrderList.vue

@@ -353,7 +353,8 @@
         <el-dialog :visible.sync="makeInvoiceListDialog" width="90%" center custom-class="doWarehouseClass">
             <el-button type="danger" round @click="openNewInvoiceDialog()">新增开票</el-button>
             <div style="margin-top:30px;">
-                <el-table :data="invoiceData" stripe style="width: 100%">
+                <el-table :data="invoiceData"  stripe :header-row-style="{ color: '#333333', 'font-size': '14px' }" border
+                style="width: 100%; margin-top:20px;font-size: 14px;">
                     <el-table-column align="center" prop="title" label="发票抬头" width="180">
                     </el-table-column>
                     <el-table-column align="center" prop="taxNo" label="税号" width="180">
@@ -361,6 +362,9 @@
                     <el-table-column align="center" prop="type" label="发票类型">
                     </el-table-column>
                     <el-table-column align="center" prop="state" label="开票状态">
+                        <template slot-scope="{row}">
+                            <span :style="stateStyle(row.state)">{{ row.state }}</span>
+                        </template>
                     </el-table-column>
                     <el-table-column align="center" prop="planAmount" label="计划开票金额">
                     </el-table-column>
@@ -376,8 +380,9 @@
                     </el-table-column>
                     <el-table-column fixed="right" label="操作" width="200" align="center">
                         <template slot-scope="{row}">
-                            <el-button v-if="row.state !== '已开票'" @click="invoiceDetail(row.id)" type="text" size="small">修改</el-button>
-                            <el-button @click="cancellation(row.id)" type="text" size="small">作废</el-button>
+                            <el-button :disabled="row.state != '审核中'" @click="invoiceDetail(row.id)" type="text" size="small">修改</el-button>
+                            <el-button :disabled="row.state != '已开票'" @click="cancellation(row.id)" type="text" size="small">申请作废</el-button>
+                            <el-button @click="copyInvoice(row)" type="text" size="small">复制</el-button>
                         </template>
                     </el-table-column>
                 </el-table>
@@ -783,6 +788,13 @@ export default {
             this.fund.orderId = row.orderId;
             this.fund.orderName = row.name;
         },
+        stateStyle(state){
+            if (state==='已开票'){
+            return 'color:green'
+            }else{
+            return 'color:red'
+            }
+        },
         openProShouldAmountDialog(row) {
             if (row.orderFundId !== null) {
                 this.proShouldAmountDialog = true;
@@ -1204,17 +1216,18 @@ export default {
             this.newInvoiceDialog = true;
         },
         cancellation(id) {
-            this.$confirm('请确认是否作废此开票?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning',
-                center: true
-            }).then(() => {
-                this.$api.financeInvoice.cancellation(id).then(res => {
+            this.$prompt('作废原因:','已开发票作废',{
+              confirmButtonText: '确认',
+              cancelButtonText: '取消',
+              type: 'warning',
+          }).then(({value}) => {
+                this.invoice.reason = value;
+                this.invoice.id = id;
+                this.$api.financeInvoice.cancellation(this.invoice).then(res => {
                     if (res.code === 200 && res.data) {
                         this.$notify({
                             title: '成功',
-                            message: '开票已作废',
+                            message: '作废申请已提交',
                             type: 'success',
                             duration: 2000
                         });
@@ -1222,7 +1235,7 @@ export default {
                     } else {
                         this.$notify({
                             title: '失败',
-                            message: '开票作废失败',
+                            message: '作废提交失败',
                             type: 'error',
                             duration: 2000
                         });
@@ -1260,6 +1273,15 @@ export default {
                     this.allotDepartment = res.data;
                 }
             })
+        },
+        copyInvoice(row){
+            this.invoice = row;
+            this.invoice.id = null;
+            this.invoice.state = null;
+            this.invoice.reason = null;
+            this.invoice.created = null;
+            this.invoice.modified = null;
+            this.newInvoiceDialog = true;
         }
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 705 - 375
src/views/finance/invoiceCheck.vue


+ 29 - 28
src/views/major/myOrder.vue

@@ -150,8 +150,8 @@
           </el-table-column>
           <el-table-column fixed="right" label="操作" width="200" align="center">
             <template slot-scope="{row}">
-              <el-button v-if="row.state !== '已开票'" @click="invoiceDetail(row.id)" type="text" size="small">修改</el-button>
-              <el-button @click="cancellation(row.id)" type="text" size="small">作废</el-button>
+              <el-button :disabled="row.state != '审核中'" @click="invoiceDetail(row.id)" type="text" size="small">修改</el-button>
+              <el-button :disabled="row.state != '已开票'" @click="cancellation(row.id)" type="text" size="small">申请作废</el-button>
               <el-button @click="copyInvoice(row)" type="text" size="small">复制</el-button>
             </template>
           </el-table-column>
@@ -985,32 +985,33 @@ export default {
       this.newInvoiceDialog = true;
     },
     cancellation(id) {
-      this.$confirm('请确认是否作废此开票?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
-        center: true
-      }).then(() => {
-        this.$api.financeInvoice.cancellation(id).then(res => {
-          if (res.code === 200 && res.data) {
-            this.$notify({
-              title: '成功',
-              message: '开票已作废',
-              type: 'success',
-              duration: 2000
-            });
-            this.getFinanceInvoiceList();
-          } else {
-            this.$notify({
-              title: '失败',
-              message: '开票作废失败',
-              type: 'error',
-              duration: 2000
-            });
-          }
-        })
-      })
-    },
+            this.$prompt('作废原因:','已开发票作废',{
+              confirmButtonText: '确认',
+              cancelButtonText: '取消',
+              type: 'warning',
+          }).then(({value}) => {
+                this.invoice.reason = value;
+                this.invoice.id = id;
+                this.$api.financeInvoice.cancellation(this.invoice).then(res => {
+                    if (res.code === 200 && res.data) {
+                        this.$notify({
+                            title: '成功',
+                            message: '作废申请已提交',
+                            type: 'success',
+                            duration: 2000
+                        });
+                        this.getFinanceInvoiceList();
+                    } else {
+                        this.$notify({
+                            title: '失败',
+                            message: '作废提交失败',
+                            type: 'error',
+                            duration: 2000
+                        });
+                    }
+                })
+            })
+        },
     openApplyOutWarehouseList(row) {
       if (row.orderShouldAmount) {
         this.getListByBizTypeProductionId('MAJOR_BUSINESS', row.id);

+ 30 - 29
src/views/personal/myOrder.vue

@@ -379,9 +379,9 @@
           </el-table-column>
           <el-table-column fixed="right" label="操作" width="200" align="center">
             <template slot-scope="{row}">
-              <el-button v-if="row.state !== '已开票'" @click="invoiceDetail(row.id)" type="text" size="small">修改</el-button>
-              <el-button @click="cancellation(row.id)" type="text" size="small">作废</el-button>
-              <el-button @click="copyInvoice(row)" type="text" size="small">复制</el-button>
+              <el-button :disabled="row.state != '审核中'" @click="invoiceDetail(row.id)" type="text" size="small">修改</el-button>
+              <el-button :disabled="row.state != '已开票'" @click="cancellation(row.id)" type="text" size="small">申请作废</el-button>
+              <el-button  @click="copyInvoice(row)" type="text" size="small">复制</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -1034,32 +1034,33 @@ export default {
       this.newInvoiceDialog = true;
     },
     cancellation(id) {
-      this.$confirm('请确认是否作废此开票?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
-        center: true
-      }).then(() => {
-        this.$api.financeInvoice.cancellation(id).then(res => {
-          if (res.code === 200 && res.data) {
-            this.$notify({
-              title: '成功',
-              message: '开票已作废',
-              type: 'success',
-              duration: 2000
-            });
-            this.getFinanceInvoiceList();
-          } else {
-            this.$notify({
-              title: '失败',
-              message: '开票作废失败',
-              type: 'error',
-              duration: 2000
-            });
-          }
-        })
-      })
-    },
+            this.$prompt('作废原因:','已开发票作废',{
+              confirmButtonText: '确认',
+              cancelButtonText: '取消',
+              type: 'warning',
+          }).then(({value}) => {
+                this.invoice.reason = value;
+                this.invoice.id = id;
+                this.$api.financeInvoice.cancellation(this.invoice).then(res => {
+                    if (res.code === 200 && res.data) {
+                        this.$notify({
+                            title: '成功',
+                            message: '作废申请已提交',
+                            type: 'success',
+                            duration: 2000
+                        });
+                        this.getFinanceInvoiceList();
+                    } else {
+                        this.$notify({
+                            title: '失败',
+                            message: '作废提交失败',
+                            type: 'error',
+                            duration: 2000
+                        });
+                    }
+                })
+            })
+        },
     copyInvoice(row){
         this.invoice = row;
         this.invoice.id = null;