detailDialog.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. v-if="visible"
  6. :visible.sync="visible"
  7. :title="title"
  8. :close-on-click-modal="false"
  9. width="80%"
  10. @close="cancel"
  11. >
  12. <div class="switch">
  13. <div class="switch_left">
  14. <ul>
  15. <li
  16. v-for="item in tabOptions"
  17. :key="item.key"
  18. :class="{ active: activeComp == item.key }"
  19. @click="activeComp = item.key"
  20. >
  21. {{ item.name }}
  22. </li>
  23. </ul>
  24. </div>
  25. </div>
  26. <div v-if="activeComp === 'main'">
  27. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  28. <headerTitle title="合同信息"></headerTitle>
  29. <el-row>
  30. <el-col :span="12">
  31. <el-form-item
  32. label="合同类型:"
  33. prop="type"
  34. style="margin-bottom: 16px"
  35. >
  36. {{ form.typeName }} {{ form.categoryName }}
  37. </el-form-item>
  38. <el-form-item
  39. label="合同名称:"
  40. prop="contractName"
  41. style="margin-bottom: 16px"
  42. >
  43. {{ form.contractName }}
  44. </el-form-item>
  45. <el-form-item
  46. label="编码:"
  47. prop="contractNumber"
  48. style="margin-bottom: 16px"
  49. >
  50. {{ form.contractNo }}
  51. </el-form-item>
  52. <el-form-item
  53. label="编号:"
  54. prop="contractNumber"
  55. style="margin-bottom: 16px"
  56. >
  57. {{ form.contractNumber }}
  58. </el-form-item>
  59. </el-col>
  60. <el-col :span="12">
  61. <el-form-item
  62. label="签订日期:"
  63. prop="contractStartDate"
  64. style="margin-bottom: 16px"
  65. >
  66. {{ form.contractStartDate }}
  67. </el-form-item>
  68. <el-form-item
  69. label="结束日期:"
  70. prop="contractEndDate"
  71. style="margin-bottom: 16px"
  72. >
  73. {{ form.contractEndDate }}
  74. </el-form-item>
  75. <el-form-item
  76. :label="form.type == '2' ? '付款类型:' : '收款类型:'"
  77. prop="receiptPaymentType"
  78. style="margin-bottom: 16px"
  79. >
  80. {{ form.receiptPaymentType == 1 ? '固定' : '分期' }}
  81. </el-form-item>
  82. <el-form-item prop="contractFile" label="合同附件:">
  83. <div v-if="form.contractFile && form.contractFile?.length">
  84. <el-link
  85. v-for="link in form.contractFile"
  86. :key="link.id"
  87. type="primary"
  88. :underline="false"
  89. @click="downloadFile(link)"
  90. >
  91. {{ link.name }}</el-link
  92. >
  93. </div>
  94. </el-form-item>
  95. </el-col>
  96. </el-row>
  97. <headerTitle title="基本信息"></headerTitle>
  98. <el-row>
  99. <el-col :span="12">
  100. <el-form-item
  101. label="甲方名称:"
  102. prop="partaName"
  103. style="margin-bottom: 16px"
  104. >
  105. {{ form.partaName }}
  106. </el-form-item>
  107. <el-form-item
  108. label="甲方统一社会信用代码:"
  109. prop="partaName"
  110. label-width="180px"
  111. style="margin-bottom: 16px"
  112. >
  113. {{ form.partaUnifiedSocialCreditCode }}
  114. </el-form-item>
  115. <el-form-item
  116. label="甲方联系人:"
  117. prop="partaLinkName"
  118. style="margin-bottom: 16px"
  119. >
  120. {{ form.partaLinkName }}
  121. </el-form-item>
  122. <el-form-item
  123. label="甲方电话:"
  124. prop="partaTel"
  125. style="margin-bottom: 16px"
  126. >
  127. {{ form.partaTel }}
  128. </el-form-item>
  129. <el-form-item
  130. label="甲方传真:"
  131. prop="partaFax"
  132. style="margin-bottom: 16px"
  133. >
  134. {{ form.partaFax }}
  135. </el-form-item>
  136. <el-form-item
  137. label=" 甲方Email:"
  138. prop="partaEmail"
  139. style="margin-bottom: 16px"
  140. >
  141. {{ form.partaEmail }}
  142. </el-form-item>
  143. <el-form-item
  144. label="甲方地址:"
  145. prop="partaAddress"
  146. style="margin-bottom: 16px"
  147. >
  148. {{ form.partaAddress }}
  149. </el-form-item>
  150. <!-- <el-form-item
  151. label="甲方税号"
  152. prop="contactAddress"
  153. style="margin-bottom: 16px"
  154. >
  155. <el-input
  156. clearable
  157. v-model="form.contactAddress"
  158. placeholder="请输入"
  159. />
  160. </el-form-item> -->
  161. </el-col>
  162. <el-col :span="12">
  163. <el-form-item
  164. label="乙方名称:"
  165. prop="partbName"
  166. style="margin-bottom: 16px"
  167. >
  168. {{ form.partbName }}
  169. </el-form-item>
  170. <el-form-item
  171. label="乙方统一社会信用代码:"
  172. prop="partaName"
  173. label-width="180px"
  174. style="margin-bottom: 16px"
  175. >
  176. {{ form.partbUnifiedSocialCreditCode }}
  177. </el-form-item>
  178. <el-form-item
  179. label="乙方联系人:"
  180. prop="partbLinkName"
  181. style="margin-bottom: 16px"
  182. >
  183. {{ form.partbLinkName }}
  184. </el-form-item>
  185. <el-form-item prop="partbTel" label="乙方联系电话:">
  186. {{ form.partbTel }}
  187. </el-form-item>
  188. <el-form-item prop="partbFax" label="乙方传真:">
  189. {{ form.partbFax }}
  190. </el-form-item>
  191. <el-form-item
  192. label="乙方Email:"
  193. prop="partbEmail"
  194. style="margin-bottom: 16px"
  195. >
  196. {{ form.partbEmail }}
  197. </el-form-item>
  198. <el-form-item
  199. label="乙方地址:"
  200. prop="partbAddress"
  201. style="margin-bottom: 16px"
  202. >
  203. {{ form.partbAddress }}
  204. </el-form-item>
  205. <!-- <el-form-item
  206. label="乙方税号"
  207. prop="contactAddress"
  208. style="margin-bottom: 16px"
  209. >
  210. <el-input
  211. clearable
  212. v-model="form.contactAddress"
  213. placeholder="请输入"
  214. />
  215. </el-form-item> -->
  216. </el-col>
  217. </el-row>
  218. </el-form>
  219. <headerTitle title="产品清单"></headerTitle>
  220. <inventoryTabledetail
  221. ref="inventoryTabledetailRef"
  222. ></inventoryTabledetail>
  223. <headerTitle
  224. :title="form.type == '2' ? '付款方式' : '收款方式'"
  225. style="margin-top: 30px"
  226. ></headerTitle>
  227. <ele-pro-table
  228. ref="table"
  229. :needPage="false"
  230. :columns="receiptPaymentListcolumns"
  231. :toolkit="[]"
  232. :datasource="detailData.receiptPaymentList"
  233. row-key="id"
  234. >
  235. </ele-pro-table>
  236. </div>
  237. <bpmDetail
  238. v-if="activeComp === 'bpm' && form.processInstanceId"
  239. :id="form.processInstanceId"
  240. ></bpmDetail>
  241. <div slot="footer" class="footer">
  242. <el-button @click="cancel">返回</el-button>
  243. </div>
  244. </ele-modal>
  245. </template>
  246. <script>
  247. import { getDetail, getExport } from '@/api/contractManage/contractBook';
  248. import { getFile } from '@/api/system/file';
  249. import dictMixins from '@/mixins/dictMixins';
  250. import { copyObj } from '@/utils/util';
  251. import bpmDetail from '@/views/bpm/processInstance/detail.vue';
  252. import inventoryTabledetail from './inventoryTabledetail.vue';
  253. export default {
  254. mixins: [dictMixins],
  255. components: {
  256. inventoryTabledetail,bpmDetail
  257. },
  258. data() {
  259. return {
  260. activeComp: 'main',
  261. tabOptions: [
  262. { key: 'main', name: '合同详情' },
  263. { key: 'bpm', name: '流程详情' }
  264. ],
  265. visible: false,
  266. detailId: '',
  267. title: '详情',
  268. row: {},
  269. activeName: 'base',
  270. form: {},
  271. rules: {},
  272. detailData: {},
  273. receiptPaymentListcolumns: [
  274. {
  275. width: 45,
  276. type: 'index',
  277. columnKey: 'index',
  278. align: 'center',
  279. fixed: 'left'
  280. },
  281. {
  282. width: 200,
  283. prop: 'moneyName',
  284. label: '款项名称',
  285. slot: 'moneyName'
  286. },
  287. {
  288. width: 100,
  289. prop: 'price',
  290. label: '金额',
  291. slot: 'price',
  292. formatter: (_row, _column, cellValue) => {
  293. return _row.price + '元';
  294. }
  295. },
  296. {
  297. width: 100,
  298. prop: 'ratio',
  299. label: '比例',
  300. slot: 'ratio',
  301. formatter: (_row, _column, cellValue) => {
  302. return _row.ratio + '%';
  303. }
  304. },
  305. {
  306. width: 160,
  307. prop: 'deadLine',
  308. label: '截止日期',
  309. slot: 'deadLine'
  310. },
  311. {
  312. prop: 'remark',
  313. label: ' 说明',
  314. slot: 'remark'
  315. }
  316. ]
  317. };
  318. },
  319. methods: {
  320. //导出
  321. async exportTable() {
  322. this.loading = true;
  323. const response = await getExport(this.detailId);
  324. },
  325. async open(row) {
  326. this.form = row;
  327. this.visible = true;
  328. this.getDetailData(row.id);
  329. this.detailId = row.id;
  330. },
  331. cancel() {
  332. this.$nextTick(() => {
  333. // 关闭后,销毁所有的表单数据
  334. (this.form = copyObj(this.formDef)),
  335. (this.otherForm = copyObj(this.otherFormDef)),
  336. (this.tableBankData = []);
  337. this.tableLinkData = [];
  338. this.visible = false;
  339. });
  340. },
  341. downloadFile(file) {
  342. getFile({ objectName: file.storePath }, file.name);
  343. },
  344. async getDetailData(id) {
  345. this.loading = true;
  346. const data = await getDetail(id);
  347. this.loading = false;
  348. if (data) {
  349. this.detailData = data;
  350. this.form = data.contractVO;
  351. this.$nextTick(() => {
  352. this.$refs.inventoryTabledetailRef &&
  353. this.$refs.inventoryTabledetailRef.putTableValue({...data,...data.contractVO});
  354. });
  355. }
  356. }
  357. }
  358. };
  359. </script>
  360. <style scoped lang="scss">
  361. .ele-dialog-form {
  362. .el-form-item {
  363. margin-bottom: 10px;
  364. }
  365. }
  366. .headbox {
  367. display: flex;
  368. justify-content: flex-start;
  369. align-items: center;
  370. .amount {
  371. font-size: 14px;
  372. font-weight: bold;
  373. margin-right: 20px;
  374. }
  375. }
  376. </style>