| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <template>
- <!-- 发票登记-->
- <a-modal class="commonModal paddingDialog invoice"
- :title="selectedRow.contracttype===1? '采购合同-发票登记': '销售合同-发票登记'"
- v-model:visible="visible"
- centered
- @cancel="cancel"
- width="890px">
- <template #footer>
- <a-button key="submit"
- class="cancelBtn"
- @click="cancel">取消
- </a-button>
- <a-button key="submit"
- type="primary"
- :loading="loading"
- @click="submit">发票登记
- </a-button>
- </template>
- <fieldset class="formFieldSet">
- <legend>合同基本信息</legend>
- <a-form class="inlineForm">
- <a-row :gutter="24">
- <a-col :span="12">
- <a-form-item label="合同编号">
- <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
- </a-form-item>
- </a-col>
- <a-col :span="12">
- <a-form-item label="定价类型">
- <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="12">
- <a-form-item :label="'销售方'">
- <span class="white">{{ formatValue(selectedRow.accountname) }}</span>
- </a-form-item>
- </a-col>
- <a-col :span="12">
- <a-form-item label="现货品种">
- <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
- </a-form-item>
- </a-col>
- </a-row>
- </a-form>
- </fieldset>
- <fieldset class="formFieldSet">
- <legend>已登记信息</legend>
- <a-form class="inlineForm">
- <a-row :gutter="24">
- <a-col :span="12">
- <a-form-item label="贷款总额">
- <span
- class="white">{{ formatValue(selectedRow.loanamount) + " 元" }}</span>
- </a-form-item>
- </a-col>
- <a-col :span="12">
- <a-form-item label="保证金">
- <span
- class="white">{{ formatValue(selectedRow.margin)+ " 元" }}</span>
- </a-form-item>
- </a-col>
- <a-col :span="12">
- <a-form-item label="其他费用">
- <span
- class="white">{{ selectedRow.reckonotheramount + " 元"}}</span>
- </a-form-item>
- </a-col>
- <a-col :span="12">
- <a-form-item label="合计总额">
- <span class="white">{{ selectedRow.totalamount+ " 元" }}</span>
- </a-form-item>
- </a-col>
- <a-col :span="12">
- <a-form-item label="已支付额 ">
- <span class="white">{{ selectedRow.payamount + " 元"}}</span>
- </a-form-item>
- </a-col>
- <a-col :span="12">
- <a-form-item label="已收票额">
- <span class="white">{{ selectedRow.invoiceamount + " 元" }}</span>
- </a-form-item>
- </a-col>
- <a-col :span="24">
- <a-form-item label="预收票额">
- <span
- class="white">{{ selectedRow.preinvoiceamount + " 元" }}</span>
- </a-form-item>
- </a-col>
- </a-row>
- </a-form>
- </fieldset>
- <fieldset class="formFieldSet">
- <legend>本次发票信息</legend>
- <a-form class="inlineForm"
- ref="formRef"
- :model="formState"
- :rules="rules">
- <a-row :gutter="24">
- <a-col :span="12">
- <a-form-item label="收票金额"
- class="relative mb40"
- name="InvoiceAmount">
- <a-input-number v-model:value="formState.InvoiceAmount"
- class="dialogInput"
- style="width: 200px"
- :min="0"
- suffix="元"
- placeholder="请输入收票金额" />
- <div class="tip">
- <div>应收票额:{{ selectedRow.daikaiamount + " 元" }} </div>
- <div><a class="blue fr">全部登记</a></div>
- </div>
- </a-form-item>
- </a-col>
- <a-col :span="12">
- <a-form-item label="发票附件"
- class="mb40">
- <UploadImg :visible="visible"
- @upload="uploadImgAction" />
- </a-form-item>
- </a-col>
- </a-row>
- </a-form>
- </fieldset>
- </a-modal>
- </template>
- <script lang="ts">
- import { defineComponent, PropType, ref, unref } from 'vue';
- import { formatValue } from '@/common/methods';
- import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
- import { getPriceTypeName } from '@/common/constants/enumsName';
- import { InvoiceReq } from '@/services/proto/contract/interface';
- import { invoiceReq } from '@/views/business/purchase/components/setup';
- import { handleForm } from './setup';
- import { _closeModal } from '@/common/setup/modal/modal';
- import UploadImg from '@/common/components/uploadImg/index.vue';
- import { getUploadImg } from '@/common/setup/upload';
- export default defineComponent({
- name: 'purchase_pending_invoice',
- components: { UploadImg },
- emits: ['cancel', 'update'],
- props: {
- selectedRow: {
- type: Object as PropType<Ermcp3SellBuyContract>,
- default: {},
- },
- },
- setup(props, context) {
- const { visible, cancel } = _closeModal(context);
- const { getFirstImg, uploadImgAction } = getUploadImg();
- const loading = ref<boolean>(false);
- const { rules, formState, formRef } = handleForm();
- function submit() {
- const wrapEl = unref(formRef);
- wrapEl.validate().then(() => {
- loading.value = true;
- const params: InvoiceReq = {
- InvoiceAmount: formState.InvoiceAmount!,
- };
- // 发出发票登记
- invoiceReq(props.selectedRow.spotcontractid, params, loading, getFirstImg())
- .then(() => {
- cancel(true);
- })
- .catch((err) => {});
- });
- }
- return {
- visible,
- cancel,
- submit,
- loading,
- formRef,
- formState,
- formatValue,
- rules,
- getPriceTypeName,
- uploadImgAction,
- };
- },
- });
- </script>
- <style lang="less">
- </style>;
|