index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 class="white">499999000.00元</span>
  56. </a-form-item>
  57. </a-col>
  58. <a-col :span="12">
  59. <a-form-item label="保证金">
  60. <span class="white">1000000元</span>
  61. </a-form-item>
  62. </a-col>
  63. <a-col :span="12">
  64. <a-form-item label="其他费用">
  65. <span class="white">500.00元</span>
  66. </a-form-item>
  67. </a-col>
  68. <a-col :span="12">
  69. <a-form-item label="合计总额">
  70. <span class="white">505990500.00元</span>
  71. </a-form-item>
  72. </a-col>
  73. <a-col :span="12">
  74. <a-form-item label="已支付额 ">
  75. <span class="white">500.00元</span>
  76. </a-form-item>
  77. </a-col>
  78. <a-col :span="12">
  79. <a-form-item label="已收票额">
  80. <span class="white">505990500.00元</span>
  81. </a-form-item>
  82. </a-col>
  83. <a-col :span="24">
  84. <a-form-item label="预收票额">
  85. <span class="white">--</span>
  86. </a-form-item>
  87. </a-col>
  88. </a-row>
  89. </a-form>
  90. </fieldset>
  91. <fieldset class="formFieldSet">
  92. <legend>本次发票信息</legend>
  93. <a-form class="inlineForm"
  94. ref="formRef"
  95. :model="formState"
  96. :rules="rules">
  97. <a-row :gutter="24">
  98. <a-col :span="12">
  99. <a-form-item label="收票金额"
  100. class="relative mb40"
  101. name="PricedPrice">
  102. <a-input class="dialogInput"
  103. style="width: 200px"
  104. suffix="元"
  105. placeholder="请输入收票金额" />
  106. <div class="tip">
  107. <div>应收票额:4090500.00元</div>
  108. <div><a class="blue fr">全部登记</a></div>
  109. </div>
  110. </a-form-item>
  111. </a-col>
  112. <a-col :span="12">
  113. <a-form-item label="发票附件" class="mb40">
  114. <div class="upload">
  115. <a-upload action="">
  116. <a-button class="uploadBtn">上传</a-button>
  117. </a-upload>
  118. <div class="look">查看附件</div>
  119. </div>
  120. </a-form-item>
  121. </a-col>
  122. </a-row>
  123. </a-form>
  124. </fieldset>
  125. </a-modal>
  126. </template>
  127. <script lang="ts">
  128. import { defineComponent, PropType, reactive, ref, unref } from 'vue';
  129. import { closeModal } from '@/common/setup/modal/index';
  130. import { formatValue } from '@/common/methods';
  131. import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
  132. import { getPriceTypeName } from '@/views/business/purchase/setup';
  133. import { operationContractReq } from '@/services/proto/contract';
  134. import { message } from 'ant-design-vue';
  135. import { objectToUint8Array } from '@/utils/objHandle';
  136. import { InvoiceReq, SettlementReq } from '@/services/proto/contract/interface';
  137. import { invoiceReq, settlementReq } from '@/views/business/purchase/components/setup';
  138. import { handleForm } from './setup';
  139. export default defineComponent({
  140. name: 'purchase_pending_invoice',
  141. components: {},
  142. props: {
  143. selectedRow: {
  144. type: Object as PropType<Ermcp3SellBuyContract>,
  145. default: {},
  146. },
  147. },
  148. setup(props, context) {
  149. const { visible, cancel } = closeModal('purchase_pending_invoice');
  150. const loading = ref<boolean>(false);
  151. const { rules, formState, formRef } = handleForm();
  152. function submit() {
  153. const wrapEl = unref(formRef);
  154. wrapEl.validate().then(() => {
  155. loading.value = true;
  156. const params: InvoiceReq = {
  157. InvoiceAmount: 123,
  158. };
  159. // 发出发票登记
  160. invoiceReq(props.selectedRow.spotcontractid, params, loading)
  161. .then(() => {
  162. cancel();
  163. context.emit('refresh');
  164. })
  165. .catch((err) => {});
  166. });
  167. }
  168. return {
  169. visible,
  170. cancel,
  171. submit,
  172. loading,
  173. formRef,
  174. formState,
  175. formatValue,
  176. rules,
  177. getPriceTypeName,
  178. };
  179. },
  180. });
  181. </script>
  182. <style lang="less">
  183. </style>;