index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <!-- 现货合同审核-->
  3. <a-modal class="add-custom custom-detail"
  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="refuse">审核拒绝</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. ref="formRef"
  21. :model="formState"
  22. :rules="rules">
  23. <fieldset class="formFieldSet">
  24. <legend>基本信息</legend>
  25. <a-row :gutter="24">
  26. <a-col :span="12">
  27. <a-form-item label="合同编号">
  28. <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
  29. </a-form-item>
  30. </a-col>
  31. <a-col :span="12">
  32. <a-form-item label="合同类型">
  33. <span class="white">{{ getContractTypeName(selectedRow.contracttype) }}</span>
  34. </a-form-item>
  35. </a-col>
  36. </a-row>
  37. <a-row :gutter="24">
  38. <a-col :span="12">
  39. <a-form-item label="业务类型">
  40. <span class="white">{{ getBizTypeName(selectedRow.biztype) }}</span>
  41. </a-form-item>
  42. </a-col>
  43. <a-col :span="12">
  44. <a-form-item label="采购方">
  45. <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
  46. </a-form-item>
  47. </a-col>
  48. </a-row>
  49. <a-row :gutter="24">
  50. <a-col :span="12">
  51. <a-form-item label="销售方">
  52. <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
  53. </a-form-item>
  54. </a-col>
  55. <a-col :span="12">
  56. <a-form-item label="合同附件">
  57. <div class="upload">
  58. <div class="look">{{ formatValue(selectedRow.contracctstatus) }}</div>
  59. </div>
  60. </a-form-item>
  61. </a-col>
  62. </a-row>
  63. <a-row :gutter="24">
  64. <a-col :span="24">
  65. <a-form-item label="状态">
  66. <span class="green">{{ formatValue(getContractStatusName(selectedRow.contracctstatus)) }}</span>
  67. </a-form-item>
  68. </a-col>
  69. </a-row>
  70. </fieldset>
  71. <fieldset class="formFieldSet">
  72. <legend>现货信息</legend>
  73. <a-row :gutter="24">
  74. <a-col :span="12">
  75. <a-form-item label="现货品种">
  76. <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
  77. </a-form-item>
  78. </a-col>
  79. <a-col :span="12">
  80. <a-form-item label="品类">
  81. <span class="white">{{ formatValue(selectedRow.wrstandardname) }}</span>
  82. </a-form-item>
  83. </a-col>
  84. </a-row>
  85. <a-row :gutter="24">
  86. <a-col :span="12">
  87. <a-form-item label="品牌">
  88. <span class="white">{{ formatValue(selectedRow.brandname) }}</span>
  89. </a-form-item>
  90. </a-col>
  91. <a-col :span="12">
  92. <a-form-item label="标仓系数">
  93. <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
  94. </a-form-item>
  95. </a-col>
  96. </a-row>
  97. <a-row :gutter="24">
  98. <a-col :span="24">
  99. <a-form-item label="商品规格">
  100. <span class="white">{{ formatValue(selectedRow.spotgoodsdesc) }}</span>
  101. </a-form-item>
  102. </a-col>
  103. </a-row>
  104. </fieldset>
  105. <fieldset class="formFieldSet">
  106. <legend>价格信息</legend>
  107. <a-row :gutter="24">
  108. <a-col :span="12">
  109. <a-form-item label="定价类型">
  110. <span class="white">{{ getPriceTypeName(formatValue(selectedRow.pricetype)) }}</span>
  111. </a-form-item>
  112. </a-col>
  113. <a-col :span="12">
  114. <a-form-item label="数量">
  115. <span class="white">{{ formatValue(selectedRow.qty) }}</span>
  116. </a-form-item>
  117. </a-col>
  118. </a-row>
  119. <a-row :gutter="24">
  120. <a-col :span="12">
  121. <a-form-item label="点价合约">
  122. <span class="white">{{ formatValue(selectedRow.goodscode) }}</span>
  123. </a-form-item>
  124. </a-col>
  125. <a-col :span="12">
  126. <a-form-item label="升贴水">
  127. <span class="white">{{ formatValue(selectedRow.pricemove) }}</span>
  128. </a-form-item>
  129. </a-col>
  130. </a-row>
  131. <a-row :gutter="24">
  132. <a-col :span="12">
  133. <a-form-item label="点价期">
  134. <span class="white">{{ formatValue(formatTime(selectedRow.startdate, "d") + '--' + formatTime(selectedRow.enddate, "d")) }}</span>
  135. </a-form-item>
  136. </a-col>
  137. <a-col :span="12">
  138. <a-form-item label="交收期">
  139. <span class="white">{{ formatValue(formatTime(selectedRow.deliverystartdate, "d") + '--' + formatTime(selectedRow.deliveryenddate, "d"))}}</span>
  140. </a-form-item>
  141. </a-col>
  142. </a-row>
  143. </fieldset>
  144. <fieldset class="formFieldSet">
  145. <legend>其他信息</legend>
  146. <a-row :gutter="24">
  147. <a-col :span="12">
  148. <a-form-item label="保证金">
  149. <span class="white">{{ formatValue(selectedRow.contractmargin) }}</span>
  150. </a-form-item>
  151. </a-col>
  152. <a-col :span="12">
  153. <a-form-item label="业务员"
  154. name="SaleUserID">
  155. <a-select class="inlineFormSelect"
  156. v-model:value="formState.SaleUserID"
  157. style="width: 200px"
  158. placeholder="请选择业务员">
  159. <a-select-option v-for="item in businesserList"
  160. :key="item.id"
  161. :value="item.id">
  162. {{item.name}}
  163. </a-select-option>
  164. </a-select>
  165. </a-form-item>
  166. </a-col>
  167. </a-row>
  168. <a-row :gutter="24">
  169. <a-col :span="12">
  170. <a-form-item label="跟单员"
  171. name="MerUserID">
  172. <a-select class="inlineFormSelect"
  173. v-model:value="formState.MerUserID"
  174. style="width: 200px"
  175. placeholder="请选择跟单员">
  176. <a-select-option v-for="item in merchandiserList"
  177. :key="item.id"
  178. :value="item.id">
  179. {{item.name}}
  180. </a-select-option>
  181. </a-select>
  182. </a-form-item>
  183. </a-col>
  184. <a-col :span="12">
  185. <a-form-item label="交易用户"
  186. name="TradeUserID">
  187. <a-select class="inlineFormSelect"
  188. style="width: 200px"
  189. v-model:value="formState.TradeUserID"
  190. placeholder="请选择期货账户">
  191. <a-select-option v-for="item in traderList"
  192. :key="item.id"
  193. :value="item.id">
  194. {{item.name}}
  195. </a-select-option>
  196. </a-select>
  197. </a-form-item>
  198. </a-col>
  199. </a-row>
  200. <a-row :gutter="24">
  201. <a-col :span="24">
  202. <a-form-item label="备注">
  203. <span class="white">{{ formatValue(selectedRow.remark) }}</span>
  204. </a-form-item>
  205. </a-col>
  206. </a-row>
  207. </fieldset>
  208. <fieldset class="formFieldSet">
  209. <legend>审核信息</legend>
  210. <a-row :gutter="24">
  211. <a-col :span="24">
  212. <a-form-item label="审核意见"
  213. name="Remark">
  214. <a-input class="dialogInput"
  215. v-model:value="formState.Remark"
  216. style="width: 620px"
  217. placeholder="请输入审核意见" />
  218. </a-form-item>
  219. </a-col>
  220. </a-row>
  221. </fieldset>
  222. </a-form>
  223. </a-modal>
  224. </template>
  225. <script lang="ts">
  226. import { defineComponent, PropType, ref, toRaw } from 'vue';
  227. import { closeModal } from '@/common/setup/modal/index';
  228. import { getBizTypeName, getContractStatusName, getContractTypeName, getPriceTypeName } from '@/views/information/spot-contract/setup';
  229. import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
  230. import { formatTime, formatValue, initData } from '@/common/methods';
  231. import { orderContractControl, orderContractOperateControl } from '@/views/information/spot-contract/components/setup';
  232. import { Modal } from 'ant-design-vue';
  233. import { handleForm } from './setup';
  234. import { handleAccountManager } from '../setup';
  235. import { GldErmcpSpotContractOperateReq, SpotContractOperateReq } from '@/services/proto/spotcontract/interface';
  236. import Long from 'long';
  237. export default defineComponent({
  238. name: 'spot-contract-detail',
  239. components: {},
  240. props: {
  241. selectedRow: {
  242. type: Object as PropType<Ermcp3ContractRsp>,
  243. default: {},
  244. },
  245. },
  246. setup(props, context) {
  247. const { visible, cancel } = closeModal('spot_contract_btn_check');
  248. // 账号列表: 交易用户 业务员 跟单员
  249. const { traderList, businesserList, merchandiserList, getRoleList, getBusinesserList } = handleAccountManager();
  250. const loading = ref<boolean>(false);
  251. // 表单
  252. const { rules, formState, formRef } = handleForm();
  253. function submit() {
  254. Modal.confirm({
  255. title: '是否确认审核通过',
  256. okText: '确认审核通过',
  257. cancelText: '取消',
  258. onOk() {
  259. formRef.value.validate().then(() => {
  260. const param = toRaw(formState);
  261. const reqs: GldErmcpSpotContractOperateReq = {
  262. SpotContractID: props.selectedRow.spotcontractid,
  263. OperateType: 4,
  264. Remark: param.Remark,
  265. Info: {BizType: props.selectedRow.biztype, CurrencyID: props.selectedRow.currencyid, ...param},
  266. };
  267. // 审核通过
  268. orderContractControl(reqs, loading).then(() => {
  269. cancel();
  270. context.emit('refresh');
  271. });
  272. });
  273. },
  274. onCancel() {
  275. console.log('Cancel');
  276. },
  277. });
  278. }
  279. function refuse() {
  280. Modal.confirm({
  281. title: '是否确认审核拒绝',
  282. okText: '确认审核拒绝',
  283. cancelText: '取消',
  284. onOk() {
  285. const param = toRaw(formState);
  286. const reqs: SpotContractOperateReq = {
  287. SpotContractID: props.selectedRow.spotcontractid,
  288. OperateType: 4,
  289. Remark: param.Remark,
  290. };
  291. // 审核拒绝
  292. orderContractOperateControl(reqs, loading).then(() => {
  293. cancel();
  294. context.emit('refresh');
  295. });
  296. },
  297. onCancel() {
  298. console.log('Cancel');
  299. },
  300. });
  301. }
  302. initData(() => {
  303. getRoleList();
  304. getBusinesserList();
  305. });
  306. return {
  307. visible,
  308. cancel,
  309. submit,
  310. maskClosableFlag: false,
  311. getContractTypeName,
  312. getBizTypeName,
  313. formatValue,
  314. getContractStatusName,
  315. formatTime,
  316. getPriceTypeName,
  317. refuse,
  318. traderList,
  319. businesserList,
  320. merchandiserList,
  321. loading,
  322. formState,
  323. rules,
  324. formRef,
  325. };
  326. },
  327. });
  328. </script>
  329. <style lang="less">
  330. .add-custom custom-detail {
  331. .upload {
  332. .look {
  333. margin-left: 0;
  334. }
  335. }
  336. }
  337. </style>;