changhaoning 1 год назад
Родитель
Сommit
b187aef873

+ 1 - 0
src/api/pages/mst/company.js

@@ -28,5 +28,6 @@ export const routeUrl = {
     edit: {key:'edit',routeName: 'company-edit'},
     operation:{key:'operation',method:'operation'},
     upOwner:{key:'upOwner',method:'upOwner'},
+    invoicing:{key:'invoicing',routeName:'company-receipt',chooseFlag:true},
   }
 }

+ 22 - 0
src/api/pages/mst/receipt.js

@@ -0,0 +1,22 @@
+/**
+ * @desc   : 发票管理
+ * @author : 常皓宁
+ * @date   : 2024/4/29 13:38
+ */
+export default {
+  receiptService:{
+    prefix: '/mdm-server/mst/receipt/',
+    selectAllAndItem:'select_all_and_item',
+    invoicing:'invoicing',
+  }
+}
+
+/**
+ * @desc   : 发票管理
+ * @author : 常皓宁
+ * @date   : 2024/4/29 13:38
+ */
+export const routeUrl = {
+  receipt:{
+  }
+}

+ 20 - 0
src/api/pages/mst/receiptItem.js

@@ -0,0 +1,20 @@
+/**
+ * @desc   : 发票管理明细
+ * @author : 常皓宁
+ * @date   : 2024/4/29 13:38
+ */
+export default {
+  receiptItemService:{
+    prefix: '/mdm-server/mst/receiptItem/',
+  }
+}
+
+/**
+ * @desc   : 发票管理明细
+ * @author : 常皓宁
+ * @date   : 2024/4/29 13:38
+ */
+export const routeUrl = {
+  receiptItem:{
+  }
+}

+ 20 - 0
src/locale/lang/zh-CN.js

@@ -114,6 +114,7 @@ export const button = {
   layoutSetting: '模板设置',
   operation:'绑定员工',
   upOwner:'责任人转让',
+  invoicing:'开具发票',
 }
 
 /**
@@ -627,6 +628,24 @@ export const columns = {
   useDate:'核销日期',
   couponStatusName:'优惠券状态',
   assistDate:'助力日期',
+  invoicingFlag:'是否开票',
+  invoiceType:'发票类型',
+  invoiceStatue:'发票状态',
+  applyStaff:'申请人',
+  applyDate:'申请日期',
+  taxNo:'公司税号',
+  cpEmail:'电子邮箱',
+  cpAddress:'注册地址',
+  openBank:'开户行',
+  bankAccount:'银行账户',
+  invoiceAmt:'发票金额',
+  receiptContent:'发票内容',
+  invoiceDate:'开票日期',
+  invoiceStaff:'开票人',
+  receiptObj:'开票方名称',
+  taxRate:'税率',
+  tradeDesc:'交易描述',
+  receiptStatus:'开票标识'
 }
 
 /**
@@ -720,6 +739,7 @@ export const messages = {
   W_115: '发布状态的活动不允许再进行发布',
   W_116: '未发布状态的活动不允许再进行下架',
   W_117: '发布状态的活动不允许进行编辑',
+  W_118: '当前商户不存在待开发票',
   E_001: '系统出现异常,请联系管理员。',
   Q_001: '当前页面的数据有过更改,请确认需要保存吗?',
   Q_002: '确定要进行{param}操作吗?',

+ 17 - 0
src/view/mst/company/index.vue

@@ -9,6 +9,7 @@
         <BaseIndexButton ref="edit" name="edit"></BaseIndexButton>
         <BaseIndexButton ref="operation" name="operation"></BaseIndexButton>
         <BaseIndexButton ref="upOwner" name="upOwner"></BaseIndexButton>
+        <BaseIndexButton ref="invoicing" name="invoicing"></BaseIndexButton>
       </template>
       <template #right>
         <BaseIndexButton ref="add" name="add"></BaseIndexButton>
@@ -35,6 +36,7 @@
                  :choose-flag="false"
                  @current-change="currentChange($event)"
                  :height="this.tableHeight * split - 35" showFooter>
+          <DkTableColumn field="invoicingFlag" type="switch"/>
           <DkTableColumn field="cpCode"></DkTableColumn>
           <DkTableColumn field="cpName"></DkTableColumn>
           <DkTableColumn field="svcCode"></DkTableColumn>
@@ -234,6 +236,21 @@ export default {
     },
 
     /**
+    * @desc   : 开具发票验证
+    * @author : 常皓宁
+    * @date   : 2024/8/5 13:24
+    */
+    openValidData(btnName, rows) {
+      if (rows && rows[0] && btnName === 'invoicing') {
+        if (!rows.invoicingFlag) {
+          this.$Message.warning(this.$t('W_007', {'param': this.$t('W_118')}));
+          return false
+        }
+      }
+      return true;
+    },
+
+    /**
     * @desc   : 问题运维绑定工号
     * @author : 常皓宁
     * @date   : 2024/6/19 9:01

+ 292 - 0
src/view/mst/company/receipt.vue

@@ -0,0 +1,292 @@
+<!-- @desc:开具发票  @auth:常皓宁  @time:2024/8/1 9:15 -->
+<template>
+  <div class="main-div">
+    <DkCollapse @on-change="changeCollapse" ref="collapse">
+      <DkTabs v-model="tabsModel" :options="tabsOptions" @on-click="tabsClick"></DkTabs>
+      <DkPanel prop="essentialInformation">
+        <!--单据信息  -->
+        <DkForm slot="content" ref="formInline" v-model="formData"
+                style="width:100%" :label-max-words="5">
+          <!--发票类型-->
+          <DkFormItem prop="receiptTypeName" :label="$t('invoiceType')">
+            <InputPop ref="receiptTypeName" v-model="formData.receiptTypeName" :readonly="true"/>
+          </DkFormItem>
+          <!--发票状态-->
+          <DkFormItem prop="receiptStatusName" :label="$t('invoiceStatue')">
+            <InputPop ref="receiptStatusName" v-model="formData.receiptStatusName" :readonly="true"/>
+          </DkFormItem>
+          <!-- 申请人 -->
+          <DkFormItem prop="applyStaff">
+            <InputPop ref="applyStaff" v-model="formData.applyStaff" :readonly="true"/>
+          </DkFormItem>
+          <!--申请日期-->
+          <DkFormItem prop="applyDate">
+            <InputPop ref="applyDate" v-model="formData.applyDate" :readonly="true"/>
+          </DkFormItem>
+          <!--公司名称-->
+          <DkFormItem prop="cpName">
+            <InputPop ref="cpName" v-model="formData.cpName" :readonly="true"/>
+          </DkFormItem>
+          <!--公司税号-->
+          <DkFormItem prop="taxNo">
+            <InputPop ref="taxNo" v-model="formData.taxNo" :readonly="true"/>
+          </DkFormItem>
+          <!--电子邮箱-->
+          <DkFormItem prop="cpEmail">
+            <InputPop ref="cpEmail" v-model="formData.cpEmail" :readonly="true"/>
+          </DkFormItem>
+          <!--注册地址-->
+          <DkFormItem prop="cpAddress">
+            <InputPop ref="cpAddress" v-model="formData.cpAddress" :readonly="true"/>
+          </DkFormItem>
+          <!--注册电话-->
+          <DkFormItem prop="cpPhone">
+            <InputPop ref="cpPhone" v-model="formData.cpPhone" :readonly="true"/>
+          </DkFormItem>
+          <!--开户行-->
+          <DkFormItem prop="openBank">
+            <InputPop ref="openBank" v-model="formData.openBank" :readonly="true"/>
+          </DkFormItem>
+          <!--银行账户-->
+          <DkFormItem prop="bankAccount">
+            <InputPop ref="bankAccount" v-model="formData.bankAccount" :readonly="true"/>
+          </DkFormItem>
+          <!--发票金额-->
+          <DkFormItem prop="receiptAmt" :label="$t('invoiceAmt')">
+            <InputNumberPop ref="receiptAmt" v-model="formData.receiptAmt" :readonly="true" :digits="2"/>
+          </DkFormItem>
+          <!--发票内容-->
+          <DkFormItem prop="receiptContent">
+            <InputPop ref="receiptContent" v-model="formData.receiptContent" :readonly="true"/>
+          </DkFormItem>
+          <!--开票日期-->
+          <DkFormItem prop="receiptDate">
+            <InputPop ref="receiptDate" v-model="formData.receiptDate" :readonly="true"/>
+          </DkFormItem>
+          <!--开票人-->
+          <DkFormItem prop="receiptStaff">
+            <InputPop ref="receiptStaff" v-model="formData.receiptStaff" :readonly="true"/>
+          </DkFormItem>
+          <!--开票方名称-->
+          <DkFormItem prop="receiptObj">
+            <InputPop ref="receiptObj" v-model="formData.receiptObj" :readonly="true"/>
+          </DkFormItem>
+          <!--税率-->
+          <DkFormItem prop="taxRate">
+            <InputNumberPop ref="taxRate" v-model="formData.taxRate" :readonly="true" :digits="2"/>
+          </DkFormItem>
+        </DkForm>
+      </DkPanel>
+      <!--明细-->
+      <DkPanel prop="goodsInformation">
+        <div id="pur-enter" ref="pur-enter" slot="content">
+          <EditTable ref="purEntryTable"
+                     majorField="intoItemId"
+                     :data="receiptItemList"
+                     :columns="receiptItemColumns"
+                     :height="400"
+                     :freeze="false"
+                     :show-footer="true"
+                     :delete-flag="false"
+                     :add-flag="false"
+          ></EditTable>
+        </div>
+      </DkPanel>
+    </DkCollapse>
+
+    <!--      下部分按钮区域-->
+    <DkSaveButton ref="saveButton" :loading="loading" @save="save" @close="close" ></DkSaveButton>
+  </div>
+</template>
+
+<script>
+
+import {formMixin} from '@/mixins/form'
+
+export default {
+  name: 'company-receipt',
+  mixins: [formMixin],
+  data() {
+    let self = this
+    return {
+      // 模式切换值
+      tabsModel: null,
+      formData: {},
+      tabsOptions: ['receiptContent'],
+      receiptData: [],
+      receiptItemList: [],
+      //明细列
+      receiptItemColumns: [
+        {
+          field: 'tradeNo',
+          type: 'disabled',
+        },
+        {
+          field: 'tradeAmount',
+          type: 'disabled',
+        },
+        {
+          field: 'tradeTime',
+          type: 'disabled',
+        },
+        {
+          field: 'tradeTypeName',
+          title: self.$t('tradeType'),
+          type: 'disabled',
+        },
+        {
+          field: 'tradeStatusName',
+          title: self.$t('tradeStatus'),
+          type: 'disabled',
+        },
+        {
+          field: 'buyLong',
+          type: 'disabled',
+        },
+        {
+          field: 'buyBeginDate',
+          type: 'disabled',
+        },
+        {
+          field: 'buyEndDate',
+          type: 'disabled',
+        },
+        {
+          field: 'gradeName',
+          type: 'disabled',
+        },
+        {
+          field: 'wxTradeNo',
+          type: 'disabled',
+        },
+        {
+          field: 'extendDays',
+          type: 'disabled',
+        },
+        {
+          field: 'tradeDesc',
+          type: 'disabled',
+        },
+        {
+          field: 'receiptStatusName',
+          title: self.$t('receiptStatus'),
+          type: 'disabled',
+        },
+        {
+          field: 'receiptDate',
+          type: 'disabled',
+        },
+      ],
+    }
+  },
+  methods: {
+    /**
+     * @desc   : tab切换
+     * @author : 常皓宁
+     * @date   : 2024/4/22 13:44
+     */
+    tabsClick(val) {
+      //如果切换的tab存在就去根据条件查询
+      if (val) {
+        this.totalTab = val
+        this.receiptData.forEach(it => {
+          if (it.receiptContent == val) {
+            this.formData = it
+            this.receiptItemList = it.receiptItemList
+          }
+        })
+      }
+    },
+
+    /**
+     * @desc   : 通过id查询
+     * @author : 常皓宁
+     * @date   : 2024/7/29 9:50
+     */
+    detail() {
+      this.loading = true
+      let params = {
+        cpId: this.$route.params.id,
+        receiptStatus:'发票状态-申请',
+      }
+      //开票管理信息
+      this.excute(this.$service.receiptService, this.$service.receiptService.selectAllAndItem, params, false).then(res => {
+        if (res.code === 200) {
+          this.receiptData = res.data
+          if (this.receiptData && this.receiptData.length > 0) {
+            this.formData = this.receiptData[0]
+            this.receiptItemList = this.receiptData[0].receiptItemList
+            this.tabsOptions = this.receiptData.map(m => {
+              return {label: m.receiptContent, name: m.receiptContent}
+            })
+          }
+          this.loading = false
+        } else {
+          this.$Message.error(res.message)
+          this.loading = false
+        }
+      })
+    },
+    /**
+    * @desc   : 设置参数
+    * @author : 常皓宁
+    * @date   : 2024/8/2 13:32
+    */
+    setParams() {
+      this.params = {...this.formData}
+      console.log(' this.params', this.params)
+    },
+
+    /**
+    * @desc   : 开具发票
+    * @author : 常皓宁
+    * @date   : 2024/8/2 13:45
+    */
+    saveData(){
+      this.loading = false
+      this.excute(this.$service.receiptService, this.$service.receiptService.invoicing, this.params).then(res =>{
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.loading = false
+          this.$Message.success(res.message)
+          //通过id查询
+          this.detail()
+        }else{
+          this.$Message.error(res.message)
+          this.loading = false
+        }
+      })
+    },
+  },
+
+  activated() {
+    //通过id查询
+    this.detail()
+  }
+}
+</script>
+
+
+<style scoped>
+.card {
+  width: 99%;
+  margin-bottom: 10px;
+}
+
+.col {
+  padding-bottom: 10px;
+}
+
+.order-info {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.order-info > div:nth-child(n) {
+  text-align: center;
+}
+
+.yuan-fh {
+  font-size: 8px
+}
+</style>