index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <!-- 发票登记-->
  3. <a-modal class="commonModal paddingDialog invoice"
  4. :title="selectedRow.contracttype===1? '采购合同-发票登记': '销售合同-发票登记'"
  5. v-model:visible="visible"
  6. centered
  7. @cancel="cancel"
  8. width="890px">
  9. <template #footer>
  10. <a-button key="submit"
  11. class="cancelBtn"
  12. @click="cancel">取消
  13. </a-button>
  14. <a-button key="submit"
  15. type="primary"
  16. :loading="loading"
  17. @click="submit">发票登记
  18. </a-button>
  19. </template>
  20. <fieldset class="formFieldSet">
  21. <legend>合同基本信息</legend>
  22. <a-form class="inlineForm">
  23. <a-row :gutter="24">
  24. <a-col :span="12">
  25. <a-form-item label="合同编号">
  26. <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
  27. </a-form-item>
  28. </a-col>
  29. <a-col :span="12">
  30. <a-form-item label="定价类型">
  31. <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
  32. </a-form-item>
  33. </a-col>
  34. </a-row>
  35. <a-row :gutter="24">
  36. <a-col :span="12">
  37. <a-form-item :label="'销售方'">
  38. <span class="white">{{ formatValue(selectedRow.accountname) }}</span>
  39. </a-form-item>
  40. </a-col>
  41. <a-col :span="12">
  42. <a-form-item label="现货品种">
  43. <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
  44. </a-form-item>
  45. </a-col>
  46. </a-row>
  47. </a-form>
  48. </fieldset>
  49. <fieldset class="formFieldSet">
  50. <legend>已登记信息</legend>
  51. <a-form class="inlineForm">
  52. <a-row :gutter="24">
  53. <a-col :span="12">
  54. <a-form-item label="贷款总额">
  55. <span
  56. class="white">{{ formatValue(selectedRow.loanamount) + " 元" }}</span>
  57. </a-form-item>
  58. </a-col>
  59. <a-col :span="12">
  60. <a-form-item label="保证金">
  61. <span
  62. class="white">{{ formatValue(selectedRow.margin)+ " 元" }}</span>
  63. </a-form-item>
  64. </a-col>
  65. <a-col :span="12">
  66. <a-form-item label="其他费用">
  67. <span
  68. class="white">{{ selectedRow.reckonotheramount + " 元"}}</span>
  69. </a-form-item>
  70. </a-col>
  71. <a-col :span="12">
  72. <a-form-item label="合计总额">
  73. <span class="white">{{ selectedRow.totalamount+ " 元" }}</span>
  74. </a-form-item>
  75. </a-col>
  76. <a-col :span="12">
  77. <a-form-item label="已支付额 ">
  78. <span class="white">{{ selectedRow.payamount + " 元"}}</span>
  79. </a-form-item>
  80. </a-col>
  81. <a-col :span="12">
  82. <a-form-item label="已收票额">
  83. <span class="white">{{ selectedRow.invoiceamount + " 元" }}</span>
  84. </a-form-item>
  85. </a-col>
  86. <a-col :span="24">
  87. <a-form-item label="预收票额">
  88. <span
  89. class="white">{{ selectedRow.preinvoiceamount + " 元" }}</span>
  90. </a-form-item>
  91. </a-col>
  92. </a-row>
  93. </a-form>
  94. </fieldset>
  95. <fieldset class="formFieldSet">
  96. <legend>本次发票信息</legend>
  97. <a-form class="inlineForm"
  98. ref="formRef"
  99. :model="formState"
  100. :rules="rules">
  101. <a-row :gutter="24">
  102. <a-col :span="12">
  103. <a-form-item label="收票金额"
  104. class="relative mb40"
  105. name="InvoiceAmount">
  106. <a-input-number v-model:value="formState.InvoiceAmount"
  107. class="dialogInput"
  108. style="width: 200px"
  109. :min="0"
  110. suffix="元"
  111. placeholder="请输入收票金额" />
  112. <div class="tip">
  113. <div>应收票额:{{ selectedRow.daikaiamount + " 元" }} </div>
  114. <div><a class="blue fr">全部登记</a></div>
  115. </div>
  116. </a-form-item>
  117. </a-col>
  118. <a-col :span="12">
  119. <a-form-item label="发票附件"
  120. class="mb40">
  121. <UploadImg :visible="visible"
  122. @upload="uploadImgAction" />
  123. </a-form-item>
  124. </a-col>
  125. </a-row>
  126. </a-form>
  127. </fieldset>
  128. </a-modal>
  129. </template>
  130. <script lang="ts">
  131. import { defineComponent, PropType, ref, unref } from 'vue';
  132. import { formatValue } from '@/common/methods';
  133. import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
  134. import { getPriceTypeName } from '@/common/constants/enumsName';
  135. import { InvoiceReq } from '@/services/proto/contract/interface';
  136. import { invoiceReq } from '@/views/business/purchase/components/setup';
  137. import { handleForm } from './setup';
  138. import { _closeModal } from '@/common/setup/modal/modal';
  139. import UploadImg from '@/common/components/uploadImg/index.vue';
  140. import { getUploadImg } from '@/common/setup/upload';
  141. export default defineComponent({
  142. name: 'purchase_pending_invoice',
  143. components: { UploadImg },
  144. emits: ['cancel', 'update'],
  145. props: {
  146. selectedRow: {
  147. type: Object as PropType<Ermcp3SellBuyContract>,
  148. default: {},
  149. },
  150. },
  151. setup(props, context) {
  152. const { visible, cancel } = _closeModal(context);
  153. const { getFirstImg, uploadImgAction } = getUploadImg();
  154. const loading = ref<boolean>(false);
  155. const { rules, formState, formRef } = handleForm();
  156. function submit() {
  157. const wrapEl = unref(formRef);
  158. wrapEl.validate().then(() => {
  159. loading.value = true;
  160. const params: InvoiceReq = {
  161. InvoiceAmount: formState.InvoiceAmount!,
  162. };
  163. // 发出发票登记
  164. invoiceReq(props.selectedRow.spotcontractid, params, loading, getFirstImg())
  165. .then(() => {
  166. cancel(true);
  167. })
  168. .catch((err) => {});
  169. });
  170. }
  171. return {
  172. visible,
  173. cancel,
  174. submit,
  175. loading,
  176. formRef,
  177. formState,
  178. formatValue,
  179. rules,
  180. getPriceTypeName,
  181. uploadImgAction,
  182. };
  183. },
  184. });
  185. </script>
  186. <style lang="less">
  187. </style>;