Explorar o código

开票管理调整

qymljy hai 1 ano
pai
achega
6dfb024dda

+ 17 - 0
src/HDrpManagement/invoiceapp/detail/tab/blueInvoice/index.vue

@@ -6,6 +6,7 @@
       <el-button size="small" type="primary" :disabled="selectData.length === 0 || (data.status !== '提交' && data.status != '审核') || data.byhand !== 0" @click="clickCreateBlueInvioce">勾选创建发票</el-button>
       <el-button size="small" type="primary" :disabled="selectData.length === 0 || (data.status !== '提交' && data.status != '审核') || data.byhand !== 0" @click="clickInvioceQuery">发票创建查询</el-button>
       <el-button size="small" type="primary" :disabled="selectData.length === 0 ||  (data.status !== '提交' && data.status != '审核')" @click="dialogFormVisible=true">红冲勾选行</el-button>
+      <el-button size="small" type="primary" :disabled="selectData.length === 0 ||  (data.status !== '审核')" @click="clickRedPunch">手工红冲</el-button>
     </el-button-group>
     <invoiceTable :data="data" ref="invoiceTable" @activeRow="activeRow" @selection="selection"></invoiceTable>
     <invoiceTablemx :status="data.status" ref="invoiceTablemx" @onSuccess="mxOnSuccess"></invoiceTablemx>
@@ -148,6 +149,22 @@ export default {
     },
     mxOnSuccess () {
       this.$refs['invoiceTable'].listData()
+    },
+    /*手工红冲*/
+    async clickRedPunch(){
+      console.log(this.selectData,'已选蓝票')
+      let sa_invoicebillids = []
+      sa_invoicebillids = this.selectData.map(item=>item.sa_invoicebillid)
+      console.log(sa_invoicebillids,'sa_invoicebillids1')
+      const res = await this.$api.requested({
+        "id": "20221226091503",
+        "content": {
+          "sa_invoicebillids":sa_invoicebillids
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.$refs['invoiceTable'].listData()
+      })
     }
   }
 }

+ 134 - 0
src/HDrpManagement/invoiceapp/detail/tab/redInvoice/components/canUseInvioceItem.vue

@@ -0,0 +1,134 @@
+<template>
+  <div>
+    <el-button v-if="tool.checkAuth($route.name,'editRedInvioce')" :disabled="status != '审核'" size="small" type="primary" @click="onShow">添加红冲明细行</el-button>
+    <el-dialog title="选择开票明细行" :visible.sync="dialogTableVisible" append-to-body>
+      <el-input
+        style="width:200px;margin-bottom:10px"
+        size="small"
+        suffix-icon="el-icon-search"
+        placeholder="搜索"
+        v-model="param.content.where.condition"
+        @keyup.enter.native="listData(param.content.pageNumber = 1)"
+        @clear="listData(param.content.pageNumber = 1)" clearable
+      ></el-input>
+      <el-table :data="list" size="mini" border>
+        <el-table-column prop="sonum" label="订单号" width="150"></el-table-column>
+        <!-- <el-table-column prop="type" label="订单类型" width="90"></el-table-column>
+        <el-table-column prop="checkdate" label="审核日期" width="150"></el-table-column> -->
+        <el-table-column prop="goodscode" label="产品编码" width="150"></el-table-column>
+        <el-table-column prop="goodsname" label="产品名称" width="150"></el-table-column>
+        <el-table-column prop="price" label="订单单价" width="90">
+          <template slot-scope="scope">
+            {{tool.formatAmount(scope.row.price,2)}}
+          </template>
+        </el-table-column>
+        <el-table-column prop="num" label="本次开票数量" width="120"></el-table-column>
+        <el-table-column prop="taxincludedamount" label="本次开票金额" width="120">
+          <template slot-scope="scope">
+            {{tool.formatAmount(scope.row.taxincludedamount,2)}}
+          </template>
+        </el-table-column>
+        <el-table-column prop="remarks" label="备注" min-width="150"></el-table-column>
+        <el-table-column label="操作" width="90" fixed="right">
+          <template slot-scope="scope">
+            <el-button size="small" type="text" @click="addRow(scope.row)">添 加</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="container" style="text-align:right">
+        <el-pagination
+          background
+          small
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="currentPage"
+          :page-sizes="[20, 50, 100, 200]"
+          layout="total,sizes, prev, pager, next, jumper"
+          :total="total">
+        </el-pagination>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['sa_invoicebillid','status'],
+  data () {
+    return {
+      dialogTableVisible:false,
+      param:{
+        "id": 2024052409322604,
+        "content": {
+          "pageNumber":1,
+          "pageSize":20,
+          "sa_invoicebillid":'',
+          "where":{
+            "condition":""
+          }
+        }
+      },
+      list:[],
+      total:0,
+      currentPage:0
+    }
+  },
+  methods:{
+    onShow () {
+      this.dialogTableVisible = true
+      this.listData()
+    },
+    async listData () {
+      this.param.content.sa_invoicebillid = this.sa_invoicebillid
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+    // 添加明细
+    async addRow (row) {
+      row.invoiceamount = row.taxincludedamount
+      row.invoiceaqty = row.num
+      const res = await this.$api.requested({
+        "id": "20230228090903",
+        "content": {
+          "sa_invoicebillid":this.sa_invoicebillid,
+          "sa_invoiceapplyid":this.$route.query.id,
+          "iteminfos":[{
+            "sa_invoicebill_itemid": row.sa_invoicebill_itemid,
+            "sa_invoiceapply_orderid":row.sa_invoiceapply_orderid,
+            "itemno": row.goodscode,
+            "itemname": row.goodsname,
+            "spec": row.spectype,
+            "price": row.price,
+            "invoiceaqty": row.num,
+            "invoiceamount": row.taxincludedamount,
+            "taxrate":row.taxrate,
+            "unit":row.unit
+          }]
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.listData()
+        this.$emit('onSuccess')
+      })
+    }
+  },
+  mounted () {
+    this.listData()
+  }
+}
+
+</script>
+<style>
+</style>

+ 48 - 9
src/HDrpManagement/invoiceapp/detail/tab/redInvoice/components/invoiceTable.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-table
-    ref="table"
+      ref="table"
       :data="list"
       style="width: 100%"
       border
@@ -46,11 +46,32 @@
       <el-table-column
         fixed="right"
         label="操作"
-        width="190">
+        width="260">
         <template slot-scope="scope">
-          <a class="table_row_link inline-16" :href="scope.row.paperpdfurl" target="_Blank" :style="{pointerEvents:scope.row.paperpdfurl == ''?'none':'',textDecoration:scope.row.paperpdfurl == ''?'none':'',color:scope.row.paperpdfurl == ''?'#cccccc':''}">纸票pdf</a>
-          <a class="table_row_link inline-16" :href="scope.row.pdfurl" target="_Blank" :style="{pointerEvents:scope.row.pdfurl == ''?'none':'',textDecoration:scope.row.pdfurl == ''?'none':'',color:scope.row.pdfurl == ''?'#cccccc':''}">发票pdf</a>
-          <el-button v-if="tool.checkAuth($route.name,'editRedInvioce')" @click="deleteRow(scope.row)" type="text" size="mini">删 除</el-button>
+          <div class="inline-16" v-if="data.byhand == 0">
+            <a class="table_row_link inline-16" :href="scope.row.paperpdfurl" target="_Blank" :style="{pointerEvents:scope.row.paperpdfurl == ''?'none':'',textDecoration:scope.row.paperpdfurl == ''?'none':'',color:scope.row.paperpdfurl == ''?'#cccccc':''}">纸票pdf</a>
+            <a class="table_row_link inline-16" :href="scope.row.pdfurl" target="_Blank" :style="{pointerEvents:scope.row.pdfurl == ''?'none':'',textDecoration:scope.row.pdfurl == ''?'none':'',color:scope.row.pdfurl == ''?'#cccccc':''}">发票pdf</a>
+          </div>
+          <div class="inline-16" v-else>
+            <!-- <a class="table_row_link inline-16" :href="scope.row.paperpdfurl">上传发票</a> -->
+            <upload class="inline-16" :folderid="folderid" :bindData="{ownertable: 'sa_invoicebill', ownerid: scope.row.sa_invoicebillid,usetype: 'default'}" @onSuccess="listData" btntype="icon"></upload>
+            <a class="table_row_link inline-16" v-if="scope.row.attinfos.length > 0" :href="scope.row.attinfos[scope.row.attinfos.length - 1].url">下载发票</a>
+          </div>
+<!--          <customBtn
+              class="inline-16"
+              btnName="确认红冲"
+              message="请检查红票明细数据,是否确认红冲?"
+              idName="2024052315533604"
+              keyName="sa_invoicebillid"
+              type="text"
+              :id="scope.row.sa_invoicebillid"
+              :disabled="scope.row.status == 2"
+              v-if="tool.checkAuth($route.name,'editRedInvioce') && scope.row.ishand == 1"
+              @onSuccess="listData"
+          />-->
+          <el-button :disabled="scope.row.status == 2" v-if="tool.checkAuth($route.name,'editRedInvioce') && scope.row.ishand == 1" @click="clickRed(scope.row)" type="text" size="mini">确认红冲</el-button>
+         <el-button v-if="tool.checkAuth($route.name,'editRedInvioce')" @click="deleteRow(scope.row)" type="text" size="mini">删 除</el-button>
+
         </template>
       </el-table-column>
     </el-table>
@@ -70,10 +91,14 @@
 </template>
 
 <script>
+import upload from '@/components/upload/hw_obs_upload.vue'
+import {Message} from "element-ui";
 export default {
-  props:['status'],
+  props:['status','data'],
+  components:{upload},
   data () {
     return {
+      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
       param:{
         "id": "20221223153403",
         "pageNumber":1,
@@ -124,9 +149,23 @@ export default {
           "sa_invoicebillids":[row.sa_invoicebillid]
         }
       })
-      this.tool.showMessage(res,()=>{
-        this.listData()
-      })
+      if (res.code == 0){
+        Message({
+          message: res.data[0].errmsg,
+          type: 'error',
+          duration:3000,
+          showClose:true
+        });
+      }else {
+        this.tool.showMessage(res,()=>{
+          this.listData()
+          this.$emit('onSuccess')
+        })
+      }
+
+    },
+    clickRed(){
+      this.$emit('clickRed')
     }
   },
   mounted () {

+ 47 - 1
src/HDrpManagement/invoiceapp/detail/tab/redInvoice/components/invoiceTablemx.vue

@@ -1,5 +1,6 @@
 <template>
   <div>
+    <addmx class="mt-10" :sa_invoicebillid="param.content.sa_invoicebillid" :status="status" @onSuccess="listData(param.content.sa_invoicebillid)"></addmx>
     <el-table
       :data="list"
       style="width: 100%"
@@ -61,14 +62,57 @@
         :total="total">
       </el-pagination>
     </div>
+    <el-dialog title="红冲明细" :visible.sync="redInvoice" append-to-body>
+      <el-table :data="list" max-height="300px" >
+        <el-table-column
+            prop="goodscode"
+            label="商品编码"
+            width="180">
+        </el-table-column>
+        <el-table-column
+            prop="goodsname"
+            label="商品名称">
+        </el-table-column>
+        <el-table-column
+            prop="spectype"
+            label="规格型号">
+        </el-table-column>
+        <el-table-column
+            prop="num"
+            label="数量">
+        </el-table-column>
+        <el-table-column
+            prop="price"
+            label="红票单价">
+          <template slot-scope="scope">
+            {{tool.formatAmount(scope.row.price,2)}}
+          </template>
+        </el-table-column>
+      </el-table>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="redInvoice = false" size="small" class="inline-16">取 消</el-button>
+<!--        <el-button type="primary" @click="centerDialogVisible = false" size="small">确 定</el-button>-->
+        <customBtn
+            class="inline-16"
+            btnName="确定"
+            message="请检查红票明细数据,是否确认红冲?"
+            idName="2024052315533604"
+            keyName="sa_invoicebillid"
+            :id="param.content.sa_invoicebillid"
+            @onSuccess="onSuccess"
+        />
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
+import addmx from './canUseInvioceItem.vue'
 import edit from './editmx.vue'
 export default {
   props:['status','data'],
   components:{
+    addmx,
     edit
   },
   data () {
@@ -86,7 +130,8 @@ export default {
       },
       list:[],
       total:0,
-      currentPage:0
+      currentPage:0,
+      redInvoice:false
     }
   },
   methods:{
@@ -121,6 +166,7 @@ export default {
     },
     onSuccess (refreshParent) {
       this.listData(this.param.content.sa_invoicebillid)
+      this.redInvoice = false
       if (refreshParent) {
         this.$emit('onSuccess')
       }

+ 4 - 1
src/HDrpManagement/invoiceapp/detail/tab/redInvoice/index.vue

@@ -4,7 +4,7 @@
 <!--      <el-button size="small" type="primary" :disabled="selectData.length === 0 && status != '审核'" @click="clickCreateRedInvioce">勾选创建发票</el-button>-->
       <el-button size="small" type="primary" :disabled="selectData.length === 0" @click="clickInvioceQuery">发票创建查询</el-button>
     </el-button-group>
-    <invoiceTable class="normal-margin" :status="status" ref="invoiceTable" @activeRow="activeRow" @selection="selection"></invoiceTable>
+    <invoiceTable class="normal-margin" :data="data" :status="status" ref="invoiceTable" @activeRow="activeRow" @selection="selection" @onSuccess="onSuccess" @clickRed="$refs.invoiceTablemx.redInvoice = true"></invoiceTable>
     <invoiceTablemx :data="data" :status="status" ref="invoiceTablemx" @onSuccess="queryinvoiceTable"></invoiceTablemx>
   </div>
 </template>
@@ -71,6 +71,9 @@ export default {
         this.$refs['invoiceTable'].listData()
       })
     },
+    onSuccess(){
+      this.$refs.invoiceTable.listData()
+    }
   }
 }