ContractDia.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <script setup>
  2. import { dataMainInterface } from '@/api/api.js'
  3. import { watch, ref } from 'vue'
  4. import { formatTime } from '@/utils/date'
  5. const props = defineProps({
  6. isOpenDia: {
  7. type: Boolean,
  8. },
  9. item: {
  10. type: Object,
  11. },
  12. date: {
  13. type: String
  14. }
  15. })
  16. const emits = defineEmits(['cancel'])
  17. watch(
  18. () => props.item,
  19. (nval) => {
  20. if (nval.selectType === '系统合同/上传附件') {
  21. getContractDetailList()
  22. } else {
  23. getContractList();
  24. }
  25. }
  26. )
  27. const contractList = ref([])
  28. const perssionList = ref([])
  29. /* 获取合同列表 */
  30. function getContractList() {
  31. dataMainInterface.companyContractList({
  32. CompanyId: props.item.CompanyId,
  33. EndDate: props.date,
  34. PageSize: 40,
  35. CurrentIndex: 1
  36. }).then(res => {
  37. if (res.Ret === 200) {
  38. contractList.value = res.Data.List
  39. }
  40. })
  41. }
  42. function getContractDetailList() {
  43. dataMainInterface.companyContractDetailList({
  44. CompanyContractId: props.item.CompanyContractId,
  45. ContractId: props.item.ContractId
  46. }).then(res => {
  47. if (res.Ret === 200) {
  48. contractList.value = res.Data.List
  49. }
  50. })
  51. }
  52. function cancelHandle() {
  53. emits('cancel')
  54. }
  55. /* 打开权限 */
  56. function openDia(row) {
  57. perssionList.value = row.PermissionList;
  58. }
  59. </script>
  60. <template>
  61. <el-dialog
  62. :model-value="props.isOpenDia"
  63. :close-on-click-modal="false"
  64. :modal-append-to-body="false"
  65. @close="cancelHandle"
  66. class="contractDialog-dia"
  67. center
  68. :title="props.item.CompanyName"
  69. width="55%"
  70. >
  71. <div class="dialog-cont">
  72. <el-table :data="contractList" ref="authTable" border height="300">
  73. <el-table-column label="合同编号" align="center">
  74. <template #default="scope">{{ scope.row.ContractCode }}</template>
  75. </el-table-column>
  76. <el-table-column label="合同金额" align="center">
  77. <template #default="scope">{{ scope.row.Money }}</template>
  78. </el-table-column>
  79. <el-table-column label="付款方式" align="center">
  80. <template #default="scope">{{ scope.row.PayMethod }}</template>
  81. </el-table-column>
  82. <el-table-column label="付款渠道" align="center">
  83. <template #default="scope">{{ scope.row.PayChannel }}</template>
  84. </el-table-column>
  85. <el-table-column label="服务期限" align="center">
  86. <template #default="scope">{{
  87. formatTime(scope.row.StartDate + "~" + scope.row.EndDate)
  88. }}</template>
  89. </el-table-column>
  90. <el-table-column label="操作" align="center" width="120">
  91. <template #default="scope">
  92. <el-popover placement="right" width="400" trigger="click">
  93. <div
  94. style="
  95. display: flex;
  96. justify-content: space-between;
  97. font-size: 16px;
  98. "
  99. >
  100. <h3>查看权限</h3>
  101. <!-- <i class="el-icon-close" style="font-size:20px"></i> -->
  102. </div>
  103. <ul style="margin-top: 20px">
  104. <li
  105. style="
  106. margin-bottom: 15px;
  107. display: flex;
  108. align-items: center;
  109. flex-wrap: wrap;
  110. "
  111. v-for="auth in perssionList"
  112. :key="auth.ClassifyName"
  113. >
  114. <span style="color: #409eff; margin-right: 10px"
  115. >{{ auth.ClassifyName }}:</span
  116. >
  117. <template
  118. v-for="sub_auth in auth.PermissionList"
  119. :key="sub_auth.ChartPermissionId"
  120. >
  121. <el-tag size="mini" style="margin: 5px 8px">
  122. {{ sub_auth.ChartPermissionName }}
  123. </el-tag>
  124. </template>
  125. </li>
  126. </ul>
  127. <template #reference>
  128. <span class="editsty" @click="openDia(scope.row)"
  129. >查看权限详情</span
  130. >
  131. </template>
  132. </el-popover>
  133. </template>
  134. </el-table-column>
  135. </el-table>
  136. </div>
  137. <div class="bot_dia">
  138. <el-button type="primary" @click="cancelHandle">关闭</el-button>
  139. </div>
  140. </el-dialog>
  141. </template>
  142. <style lang="scss">
  143. .contractDialog-dia {
  144. .el-dialog__header {
  145. background: #fff !important;
  146. }
  147. .el-dialog__title {
  148. color: #333 !important;
  149. }
  150. .el-dialog__close {
  151. color: #909399 !important;
  152. }
  153. .bot_dia {
  154. display: flex;
  155. justify-content: center;
  156. margin: 30px 0 20px;
  157. }
  158. }
  159. </style>