index.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <!-- 现货合同撤销-->
  3. <a-modal class="add-custom custom-detail commonModal addSpotVariety"
  4. title="现货合同撤销"
  5. v-model:visible="visible"
  6. centered
  7. :maskClosable="maskClosableFlag"
  8. @cancel="cancel"
  9. width="890px">
  10. <template #footer>
  11. <a-button key="submit"
  12. class="cancelBtn"
  13. @click="cancel">取消</a-button>
  14. <a-button key="submit"
  15. type="primary"
  16. :loading="loading"
  17. @click="submit">确认撤销</a-button>
  18. </template>
  19. <a-form class="inlineForm"
  20. :form="form"
  21. @submit="handleSearch">
  22. <fieldset class="formFieldSet">
  23. <legend>基本信息</legend>
  24. <a-row :gutter="24">
  25. <a-col :span="12">
  26. <a-form-item label="合同编号">
  27. <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
  28. </a-form-item>
  29. </a-col>
  30. <a-col :span="12">
  31. <a-form-item label="合同类型">
  32. <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
  33. </a-form-item>
  34. </a-col>
  35. </a-row>
  36. <a-row :gutter="24">
  37. <a-col :span="12">
  38. <a-form-item label="业务类型">
  39. <span class="white">{{ formatValue(selectedRow.biztype) }}</span>
  40. </a-form-item>
  41. </a-col>
  42. <a-col :span="12">
  43. <a-form-item label="采购方">
  44. <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
  45. </a-form-item>
  46. </a-col>
  47. </a-row>
  48. <a-row :gutter="24">
  49. <a-col :span="12">
  50. <a-form-item label="销售方">
  51. <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
  52. </a-form-item>
  53. </a-col>
  54. <a-col :span="12">
  55. <a-form-item label="合同附件">
  56. <span class="white">{{ formatValue(selectedRow.contracctstatus) }}</span>
  57. </a-form-item>
  58. </a-col>
  59. </a-row>
  60. <a-row :gutter="24">
  61. <a-col :span="12">
  62. <a-form-item label="状态">
  63. <span class="yellow">{{ formatValue(getContractStatusName(selectedRow.contracctstatus)) }}</span>
  64. </a-form-item>
  65. </a-col>
  66. </a-row>
  67. </fieldset>
  68. <fieldset class="formFieldSet">
  69. <legend>现货信息</legend>
  70. <a-row :gutter="24">
  71. <a-col :span="12">
  72. <a-form-item label="现货品种">
  73. <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
  74. </a-form-item>
  75. </a-col>
  76. <a-col :span="12">
  77. <a-form-item label="品类">
  78. <span class="white">{{ formatValue(selectedRow.wrstandardname) }}</span>
  79. </a-form-item>
  80. </a-col>
  81. </a-row>
  82. <a-row :gutter="24">
  83. <a-col :span="12">
  84. <a-form-item label="品牌">
  85. <span class="white">{{ formatValue(selectedRow.brandname) }}</span>
  86. </a-form-item>
  87. </a-col>
  88. <a-col :span="12">
  89. <a-form-item label="标仓系数">
  90. <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
  91. </a-form-item>
  92. </a-col>
  93. </a-row>
  94. <a-row :gutter="24">
  95. <a-col :span="12">
  96. <a-form-item label="商品规格">
  97. <span class="white">{{ formatValue(selectedRow.spotgoodsdesc) }}</span>
  98. </a-form-item>
  99. </a-col>
  100. </a-row>
  101. </fieldset>
  102. <fieldset class="formFieldSet">
  103. <legend>价格信息</legend>
  104. <a-row :gutter="24">
  105. <a-col :span="12">
  106. <a-form-item label="定价类型">
  107. <span class="white">{{ getPriceTypeName(formatValue(selectedRow.pricetype)) }}</span>
  108. </a-form-item>
  109. </a-col>
  110. <a-col :span="12">
  111. <a-form-item label="数量">
  112. <span class="white">{{ formatValue(selectedRow.qty) }}</span>
  113. </a-form-item>
  114. </a-col>
  115. </a-row>
  116. <a-row :gutter="24">
  117. <a-col :span="12">
  118. <a-form-item label="点价合约">
  119. <span class="white">{{ formatValue(selectedRow.goodscode) }}</span>
  120. </a-form-item>
  121. </a-col>
  122. <a-col :span="12">
  123. <a-form-item label="升贴水">
  124. <span class="white">{{ formatValue(selectedRow.pricemove) }}</span>
  125. </a-form-item>
  126. </a-col>
  127. </a-row>
  128. <a-row :gutter="24">
  129. <a-col :span="12">
  130. <a-form-item label="点价期">
  131. <span class="white">{{ formatValue(formatTime(selectedRow.startdate, "d") + '--' + formatTime(selectedRow.enddate, "d")) }}</span>
  132. </a-form-item>
  133. </a-col>
  134. <a-col :span="12">
  135. <a-form-item label="交收期">
  136. <span class="white">{{ formatValue(formatTime(selectedRow.deliverystartdate, "d") + '--' + formatTime(selectedRow.deliveryenddate, "d"))}}</span>
  137. </a-form-item>
  138. </a-col>
  139. </a-row>
  140. </fieldset>
  141. <fieldset class="formFieldSet">
  142. <legend>其它信息</legend>
  143. <a-row :gutter="24">
  144. <a-col :span="12">
  145. <a-form-item label="保证金">
  146. <span class="white">{{ formatValue(selectedRow.contractmargin) }}</span>
  147. </a-form-item>
  148. </a-col>
  149. <a-col :span="12">
  150. <a-form-item label="业务员">
  151. <span class="white">{{ formatValue(selectedRow.saleuserlogincode) }}</span>
  152. </a-form-item>
  153. </a-col>
  154. </a-row>
  155. <a-row :gutter="24">
  156. <a-col :span="12">
  157. <a-form-item label="跟单员">
  158. <span class="white">{{ formatValue(selectedRow.meruserlogincode) }}</span>
  159. </a-form-item>
  160. </a-col>
  161. <a-col :span="12">
  162. <a-form-item label="期货账户">
  163. <span class="white">{{ formatValue(selectedRow.accountid) }}</span>
  164. </a-form-item>
  165. </a-col>
  166. </a-row>
  167. <a-row :gutter="24">
  168. <a-col :span="12">
  169. <a-form-item label="备注">
  170. <span class="white">{{ formatValue(selectedRow.remark) }}</span>
  171. </a-form-item>
  172. </a-col>
  173. </a-row>
  174. </fieldset>
  175. </a-form>
  176. </a-modal>
  177. </template>
  178. <script lang="ts">
  179. import {defineComponent, PropType, ref} from 'vue';
  180. import { closeModal } from '@/common/setup/modal/index';
  181. import {Ermcp3ContractRsp} from "@/services/go/ermcp/spot-contract/interface";
  182. import {formatTime, formatValue} from "@/common/methods";
  183. import {getContractStatusName, getPriceTypeName} from "@/views/information/spot-contract/setup";
  184. import {message, Modal} from "ant-design-vue";
  185. import {deleteOrderContract} from "@/views/information/spot-contract/components/setup";
  186. export default defineComponent({
  187. name: 'spot-contract-detail',
  188. components: {},
  189. props: {
  190. selectedRow: {
  191. type: Object as PropType<Ermcp3ContractRsp>,
  192. default: {},
  193. },
  194. },
  195. setup(props, context) {
  196. const { visible, cancel } = closeModal('spot_contract_btn_cancel');
  197. const {loading, orderContractState} = deleteOrderContract()
  198. const maskClosableFlag = ref<boolean>(false);
  199. function submit() {
  200. loading.value = true;
  201. Modal.confirm({
  202. title: '是否确认撤销',
  203. okText: '确认撤销',
  204. cancelText: '取消',
  205. onOk() {
  206. // 删除客户资料
  207. orderContractState(props.selectedRow.spotcontractid)
  208. .then(res => {
  209. message.success(res);
  210. // 通知上层 刷新数据
  211. context.emit('refresh');
  212. cancel();
  213. }).catch(err => {
  214. message.error(err);
  215. });
  216. },
  217. onCancel() {
  218. console.log('Cancel');
  219. },
  220. });
  221. }
  222. return {
  223. visible,
  224. cancel,
  225. submit,
  226. loading,
  227. maskClosableFlag,
  228. formatValue,
  229. getPriceTypeName,
  230. getContractStatusName,
  231. formatTime,
  232. };
  233. },
  234. });
  235. </script>
  236. <style lang="less">
  237. .custom-detail {
  238. .upload {
  239. .look {
  240. margin-left: 0;
  241. }
  242. }
  243. }
  244. </style>;