zhangqiOMG 2 年之前
父节点
当前提交
df265f34e1

+ 6 - 1
src/HDrpManagement/invoiceapp/detail/detail.vue

@@ -27,6 +27,9 @@
       <div slot="slot1" >
         <blueInvoice :status="mainData.status"></blueInvoice>
       </div>
+      <div slot="slot2">
+        <redInvoice :status="mainData.status"></redInvoice>
+      </div>
     </basicDetails>
   </div>
 </template>
@@ -34,6 +37,7 @@
 <script>
 import invoiceOrder from './tab/invoiceOrder/invoiceOrder.vue'
 import blueInvoice from './tab/blueInvoice/index.vue'
+import redInvoice from './tab/redInvoice/index.vue'
 
 export default {
   name: "detail",
@@ -45,7 +49,8 @@ export default {
   },
   components:{
     invoiceOrder,
-    blueInvoice
+    blueInvoice,
+    redInvoice
   },
   methods:{
     async queryMainData(id) {

+ 2 - 2
src/HDrpManagement/invoiceapp/detail/tab/blueInvoice/components/canUseInvioceItem.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button size="small" type="primary" @click="onShow">添加开票明细行</el-button>
+    <el-button v-if="tool.checkAuth($route.name,'editBlueInvioce')" :disabled="status !== '新建'" size="small" type="primary" @click="onShow">添加开票明细行</el-button>
     <el-dialog title="选择开票明细行" :visible.sync="dialogTableVisible" append-to-body>
       <el-table :data="list" size="mini" border>
         <el-table-column prop="sonum" label="订单号" width="150"></el-table-column>
@@ -36,7 +36,7 @@
 
 <script>
 export default {
-  props:['sa_invoicebillid'],
+  props:['sa_invoicebillid','status'],
   data () {
     return {
       dialogTableVisible:false,

+ 2 - 2
src/HDrpManagement/invoiceapp/detail/tab/blueInvoice/components/editmx.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button :disabled="status !== '新建'" size="small" type="text" @click="onShow">修 改</el-button>
+    <el-button v-if="tool.checkAuth($route.name,'editBlueInvioce')" :disabled="status !== '新建'" size="small" type="text" @click="onShow">修 改</el-button>
     <el-dialog title="修改明细信息" :visible.sync="dialogFormVisible" append-to-body width="400px">
       <el-form :model="form" size="small" :rules="rules" ref="form" label-position="right" label-width="90px">
         <el-form-item label="含税金额">
@@ -84,7 +84,7 @@ export default {
           }
         })
         this.tool.showMessage(res,()=>{
-          this.$emit('onSuccess')
+          this.$emit('onSuccess',true)
           this.dialogFormVisible = false
         })
       });

+ 36 - 2
src/HDrpManagement/invoiceapp/detail/tab/blueInvoice/components/invoiceTable.vue

@@ -48,7 +48,8 @@
         label="操作"
         width="90">
         <template slot-scope="scope">
-          <el-button @click="deleteRow(scope.row)" type="text" size="mini" :disabled="status !== '新建'">删 除</el-button>
+          <el-button v-if="tool.checkAuth($route.name,'editBlueInvioce')" @click="editRow(scope.row)" type="text" size="mini" :disabled="status !== '新建'">编 辑</el-button>
+          <el-button v-if="tool.checkAuth($route.name,'editBlueInvioce')" @click="deleteRow(scope.row)" type="text" size="mini" :disabled="status !== '新建'">删 除</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -64,6 +65,17 @@
         :total="total">
       </el-pagination>
     </div>
+    <el-dialog title="编辑发票" :visible.sync="dialogFormVisible" width="500px" append-to-body>
+      <el-form :model="form" size="small" label-position="right" label-width="100px">
+        <el-form-item label="备注">
+          <el-input v-model="form.remarks" autocomplete="off" type="textarea" :autosize="{minRows:3}" placeholder="请输入备注"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false" size="small">取 消</el-button>
+        <el-button type="primary" @click="submit" size="small">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -72,12 +84,17 @@ export default {
   props:['status'],
   data () {
     return {
+      dialogFormVisible:false,
+      form:{},
       param:{
         "id": "20221223153403",
         "pageNumber":1,
         "pageSize":20,
         "content": {
-          "sa_invoiceapplyid":this.$route.query.id
+          "sa_invoiceapplyid":this.$route.query.id,
+          "where":{
+            "rb":1
+          }
         }
       },
       list:[],
@@ -122,6 +139,23 @@ export default {
       this.tool.showMessage(res,()=>{
         this.listData()
       })
+    },
+    editRow (row) {
+      this.form = Object.assign({},this.form,row)
+      this.dialogFormVisible = true
+    },
+    async submit () {
+      const res = await this.$api.requested({
+        "id": "20221223154403",
+        "content": {
+          "sa_invoicebillid":this.form.sa_invoicebillid,
+          "remarks":this.form.remarks
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.listData()
+        this.dialogFormVisible = false
+      })
     }
   },
   mounted () {

+ 10 - 4
src/HDrpManagement/invoiceapp/detail/tab/blueInvoice/components/invoiceTablemx.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <addmx class="mt-10" :sa_invoicebillid="param.content.sa_invoicebillid" @onSuccess="listData(param.content.sa_invoicebillid)"></addmx>
+    <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%"
@@ -42,8 +42,8 @@
       </el-table-column>
       <el-table-column label="操作" width="90" fixed="right">
         <template slot-scope="scope">
-          <editmx class="inline-16" :status="status" :sa_invoicebillid="param.content.sa_invoicebillid" :data="scope.row" @onSuccess="listData(param.content.sa_invoicebillid)"></editmx>
-          <el-button :disabled="status !== '新建'" size="small" type="text" @click="deleteRow(scope.row)">删 除</el-button>
+          <editmx class="inline-16" :status="status" :sa_invoicebillid="param.content.sa_invoicebillid" :data="scope.row" @onSuccess="onSuccess"></editmx>
+          <el-button v-if="tool.checkAuth($route.name,'editBlueInvioce')" :disabled="status !== '新建'" size="small" type="text" @click="deleteRow(scope.row)">删 除</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -117,7 +117,13 @@ export default {
       this.tool.showMessage(res,()=>{
         this.listData(this.param.content.sa_invoicebillid)
       })
-    } 
+    },
+    onSuccess (refreshParent) {
+      this.listData(this.param.content.sa_invoicebillid)
+      if (refreshParent) {
+        this.$emit('onSuccess')
+      }
+    }
   },
   mounted () {
   }

+ 20 - 4
src/HDrpManagement/invoiceapp/detail/tab/blueInvoice/index.vue

@@ -1,13 +1,13 @@
 <template>
   <div>
-    <el-button-group style="margin-bottom:10px">
+    <el-button-group v-if="tool.checkAuth($route.name,'editBlueInvioce')" style="margin-bottom:10px">
       <el-button size="small" type="primary" :disabled="status !== '新建'" @click="addInvoiceapp">一键添加发票</el-button>
       <el-button size="small" type="primary" :disabled="selectData.length === 0" @click="clickCreateBlueInvioce">勾选创建发票</el-button>
       <el-button size="small" type="primary" :disabled="selectData.length === 0" @click="clickInvioceQuery">发票创建查询</el-button>
-      <el-button size="small" type="primary" :disabled="selectData.length === 0">红冲勾选行</el-button>
+      <el-button size="small" type="primary" :disabled="selectData.length === 0" @click="blueInvioceToRed">红冲勾选行</el-button>
     </el-button-group>
     <invoiceTable :status="status" ref="invoiceTable" @activeRow="activeRow" @selection="selection"></invoiceTable>
-    <invoiceTablemx :status="status" ref="invoiceTablemx"></invoiceTablemx>
+    <invoiceTablemx :status="status" ref="invoiceTablemx" @onSuccess="mxOnSuccess"></invoiceTablemx>
   </div>
 </template>
 
@@ -82,7 +82,23 @@ export default {
         this.$refs['invoiceTable'].listData()
       })
     },
-
+    // 红冲蓝字发票
+    async blueInvioceToRed () {
+      const res = await this.$api.requested({
+        "id": "20221226091503",
+        "content": {
+          "sa_invoicebillids":this.selectData.map(e=>{
+            return e.sa_invoicebillid
+          })
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.$refs['invoiceTable'].listData()
+      })
+    },
+    mxOnSuccess () {
+      this.$refs['invoiceTable'].listData()
+    }
   }
 }
 

+ 1 - 1
src/HDrpManagement/invoiceapp/detail/tab/invoiceOrder/components/addorderline.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button v-if="tool.checkAuth($route.name,'addorderline')" :disabled="status !== '新建'" style="margin-bottom:10px" size="small" type="primary" @click="onShow">添加订单行</el-button>
+    <el-button v-if="tool.checkAuth($route.name,'editBlueInvioce')" :disabled="status !== '新建'" style="margin-bottom:10px" size="small" type="primary" @click="onShow">添加订单行</el-button>
     <el-dialog title="可添加订单" append-to-body :visible.sync="dialogTableVisible">
       <el-table :data="list" size="mini" border>
         <el-table-column prop="sonum" label="订单号" width="150"></el-table-column>

+ 2 - 2
src/HDrpManagement/invoiceapp/detail/tab/invoiceOrder/invoiceOrder.vue

@@ -14,8 +14,8 @@
       <el-table-column prop="remarks" label="备注" min-width="150"></el-table-column>
       <el-table-column label="操作" width="90" fixed="right">
         <template slot-scope="scope">
-          <changeOrderline v-if="tool.checkAuth($route.name,'editorderline')" class="inline-16" :row="scope.row" :status="status" @onSuccess="listData"></changeOrderline>
-          <el-button v-if="tool.checkAuth($route.name,'deleteorderline')" :disabled="status !== '新建'" size="small" type="text" @click="deleteRow(scope.row)">删 除</el-button>
+          <changeOrderline v-if="tool.checkAuth($route.name,'editBlueInvioce')" class="inline-16" :row="scope.row" :status="status" @onSuccess="listData"></changeOrderline>
+          <el-button v-if="tool.checkAuth($route.name,'editBlueInvioce')" :disabled="status !== '新建'" size="small" type="text" @click="deleteRow(scope.row)">删 除</el-button>
         </template>
       </el-table-column>
     </el-table>

+ 137 - 0
src/HDrpManagement/invoiceapp/detail/tab/redInvoice/components/invoiceTable.vue

@@ -0,0 +1,137 @@
+<template>
+  <div>
+    <el-table
+    ref="table"
+      :data="list"
+      style="width: 100%"
+      border
+      size="mini"
+      highlight-current-row
+      @selection-change="onSelection"
+      @row-click="activeRow">
+      <el-table-column
+        type="selection"
+        align="center">
+      </el-table-column>
+      <el-table-column
+        prop="sa_invoicebillid"
+        label="发票ID"
+        width="180">
+      </el-table-column>
+      <el-table-column
+        prop="sumtaxincludedamount"
+        label="发票金额"
+        width="180">
+      </el-table-column>
+      <el-table-column
+        prop="invoiceserialnum"
+        label="发票流水号">
+      </el-table-column>
+      <el-table-column
+        prop="invoicecode"
+        label="发票代码">
+      </el-table-column>
+      <el-table-column
+        prop="invoiceno"
+        label="发票号码">
+      </el-table-column>
+      <el-table-column
+        prop="remarks"
+        label="反馈消息">
+      </el-table-column>
+      <el-table-column
+        prop="status"
+        label="发票状态">
+      </el-table-column>
+      <!-- <el-table-column
+        fixed="right"
+        label="操作"
+        width="90">
+        <template slot-scope="scope">
+          <el-button v-if="tool.checkAuth($route.name,'editBlueInvioce')" @click="deleteRow(scope.row)" type="text" size="mini" :disabled="status !== '新建'">删 除</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>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['status'],
+  data () {
+    return {
+      param:{
+        "id": "20221223153403",
+        "pageNumber":1,
+        "pageSize":20,
+        "content": {
+          "sa_invoiceapplyid":this.$route.query.id,
+          "where":{
+            "rb":0
+          }
+        }
+      },
+      list:[],
+      total:0,
+      currentPage:0,
+    }
+  },
+  methods:{
+    async listData () {
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
+      if (res.data.length > 0) {
+        this.activeRow(res.data[0])
+        this.$refs.table.setCurrentRow(this.list[0])
+      }
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+    activeRow (row) {
+      this.$emit('activeRow',row)
+    },
+    onSelection (selection) {
+      this.$emit('selection',selection)
+    },
+    async deleteRow (row) {
+      const res = await this.$api.requested({
+        "id": "20221223160103",
+        "content": {
+          "sa_invoicebillids":[row.sa_invoicebillid]
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.listData()
+      })
+    }
+  },
+  mounted () {
+    this.listData()
+  }
+}
+
+</script>
+<style>
+</style>

+ 129 - 0
src/HDrpManagement/invoiceapp/detail/tab/redInvoice/components/invoiceTablemx.vue

@@ -0,0 +1,129 @@
+<template>
+  <div>
+    <el-table
+      :data="list"
+      style="width: 100%"
+      border
+      size="mini">
+      <el-table-column
+        prop="sonum"
+        label="订单号"
+        width="180">
+      </el-table-column>
+      <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="unit"
+        label="单位">
+      </el-table-column>
+      <el-table-column
+        prop="num"
+        label="数量">
+      </el-table-column>
+      <el-table-column
+        prop="price"
+        label="含税单价">
+      </el-table-column>
+      <el-table-column
+        prop="taxrate"
+        label="税率">
+      </el-table-column>
+      <!-- <el-table-column label="操作" width="90" fixed="right">
+        <template slot-scope="scope">
+         
+          <el-button v-if="tool.checkAuth($route.name,'editBlueInvioce')" :disabled="status !== '新建'" size="small" type="text" @click="deleteRow(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>
+  </div>
+</template>
+
+<script>
+
+export default {
+  props:['status'],
+  components:{
+  },
+  data () {
+    return {
+      param:{
+        "id": 20221228101203,
+        "content": {
+          "sa_invoicebillid":0,
+          "where":{
+              "condition":""
+          }
+        }
+      },
+      list:[],
+      total:0,
+      currentPage:0,
+    }
+  },
+  methods:{
+    async listData (id) {
+      this.param.content.sa_invoicebillid = id
+      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 deleteRow (row) {
+      const res = await this.$api.requested({
+        "id": "20221228101303",
+        "content": {
+          "sa_invoicebill_itemids":[row.sa_invoicebill_itemid]
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.listData(this.param.content.sa_invoicebillid)
+      })
+    },
+    onSuccess (refreshParent) {
+      this.listData(this.param.content.sa_invoicebillid)
+      if (refreshParent) {
+        this.$emit('onSuccess')
+      }
+    }
+  },
+  mounted () {
+  }
+}
+
+</script>
+<style>
+</style>

+ 76 - 0
src/HDrpManagement/invoiceapp/detail/tab/redInvoice/index.vue

@@ -0,0 +1,76 @@
+<template>
+  <div>
+    <el-button-group v-if="tool.checkAuth($route.name,'editBlueInvioce')" style="margin-bottom:10px">
+      <el-button size="small" type="primary" :disabled="selectData.length === 0" @click="clickCreateRedInvioce">勾选创建发票</el-button>
+      <el-button size="small" type="primary" :disabled="selectData.length === 0" @click="clickInvioceQuery">发票创建查询</el-button>
+    </el-button-group>
+    <invoiceTable :status="status" ref="invoiceTable" @activeRow="activeRow" @selection="selection"></invoiceTable>
+    <invoiceTablemx :status="status" ref="invoiceTablemx"></invoiceTablemx>
+  </div>
+</template>
+
+<script>
+import invoiceTable from './components/invoiceTable'
+import invoiceTablemx from './components/invoiceTablemx'
+
+export default {
+  props:['status'],
+  components:{
+    invoiceTable,
+    invoiceTablemx
+  },
+  data () {
+    return {
+      sa_invoicebillid:0,
+      selectData:[]
+    }
+  },
+  methods:{
+
+    activeRow (row){
+      this.$refs['invoiceTablemx'].listData(row.sa_invoicebillid)
+    },
+    selection (selection) {
+      this.selectData = selection
+    },
+    clickCreateRedInvioce () {
+      this.selectData.forEach(e=>{
+        this.createRedInvioce(e.sa_invoicebillid)
+      })
+    },
+    // 创建红字发票
+    async createRedInvioce(sa_invoicebillid) {
+      const res = await this.$api.requested({
+        "id": "20221226151903",
+        "content": {
+          "sa_invoiceapplyid":this.$route.query.id,
+          "sa_invoicebillid":sa_invoicebillid
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.$refs['invoiceTable'].listData()
+      })
+    },
+    clickInvioceQuery () {
+      this.selectData.forEach(e=>{
+        this.invioceQuery(e.sa_invoicebillid)
+      })
+    },
+    // 发票查询
+    async invioceQuery (sa_invoicebillid) {
+      const res = await this.$api.requested({
+        "id": "20221226152003",
+        "content": {
+          "sa_invoicebillid":sa_invoicebillid
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.$refs['invoiceTable'].listData()
+      })
+    },
+  }
+}
+
+</script>
+<style>
+</style>