|
|
@@ -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>
|