raiHistoryContract.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <template>
  2. <!-- 历史签约弹窗 -->
  3. <div>
  4. <el-dialog
  5. :visible.sync="isPreview"
  6. custom-class="history-contract-wrap-content_rai"
  7. append-to-body="true"
  8. :modal-append-to-body="false"
  9. @close="closePreview"
  10. title="历史签约"
  11. center
  12. top="7vh"
  13. v-dialogDrag
  14. width="1200px"
  15. >
  16. <div class="dialog-wrap">
  17. <div class="contract-list">
  18. <div class="contract-item" v-for="(item, index) in contractList" :key="item.ContractCode">
  19. <div class="contract-tag">
  20. <el-tag>
  21. {{ item.ContractType }}
  22. <el-tooltip class="item" effect="dark" v-if="item.ContractType != '补充协议'" placement="top-start">
  23. <div slot="content" v-if="item.ContractType == '新签合同'">没有正式转试用记录的客户,在申请转正时提交的合同</div>
  24. <div slot="content" v-if="item.ContractType == '续约合同'">
  25. 1、有正式转试用记录的客户,在申请转正时提交的合同<br />
  26. 2、所有客户在续约申请时提交的合同
  27. </div>
  28. <i class="el-icon-info"></i>
  29. </el-tooltip>
  30. </el-tag>
  31. <span :style="{ 'text-decoration-line': item.ContractId ? 'underline' : 'none' }" @click="toContractDetail(item)">合同编号:{{ item.ContractCode }}</span>
  32. </div>
  33. <div class="line"></div>
  34. <!-- 合同基本信息 -->
  35. <div class="contract-base">
  36. <ul class="base-lise">
  37. <li>
  38. <p>合同期限:{{ item.StartDate + "~" + item.EndDate }}</p>
  39. <p>合同金额:{{ item.Money }}</p>
  40. </li>
  41. <li>
  42. <p>付款方式:{{ item.PayMethod }}</p>
  43. <p>付款渠道:{{ item.PayChannel }}</p>
  44. </li>
  45. <li>
  46. <p>审批时间:{{ item.ModifyTimeStr | formatTime }}</p>
  47. <p></p>
  48. </li>
  49. </ul>
  50. </div>
  51. <!-- 权限设置和查看附件 -->
  52. <div class="contract-info">
  53. <div @click="showExpand(index, 'root')">
  54. 权限设置 <span><i :class="item.extend ? 'el-icon-arrow-down' : 'el-icon-arrow-right'"></i></span>
  55. </div>
  56. </div>
  57. <div class="contract-root" v-show="item.extend">
  58. <ul class="menu_lists">
  59. <li v-for="auth in item.PermissionList" :key="auth.ClassifyName" class="menu_item">
  60. <el-checkbox :indeterminate="auth.CheckList.length > 0 && auth.CheckList.length < auth.Items.length" v-model="auth.CheckAll" disabled style="marginright: 30px; fontweight: bold">{{
  61. auth.ClassifyName + ":"
  62. }}</el-checkbox>
  63. <el-checkbox-group v-model="auth.CheckList" disabled>
  64. <el-checkbox v-for="list in auth.Items" :label="list.ChartPermissionId" :key="list.ChartPermissionId" class="list_item">{{ list.PermissionName }}</el-checkbox>
  65. </el-checkbox-group>
  66. </li>
  67. </ul>
  68. </div>
  69. <div class="contract-info">
  70. <div @click="showExpand(index, 'files')">
  71. 合同附件 <span><i :class="item.filesExtend ? 'el-icon-arrow-down' : 'el-icon-arrow-right'"></i></span>
  72. </div>
  73. </div>
  74. <div class="contract-files" v-show="item.filesExtend">
  75. <ul class="file-list">
  76. <li v-for="img in item.constractFiles" :key="img">
  77. <img :src="require('@/assets/img/constract/word-icon.png')" v-if="img.type == 'word'" @click="preViewConstractFile(img)" />
  78. <img :src="require('@/assets/img/constract/pdf.png')" v-else-if="img.type == 'pdf'" @click="preViewConstractFile(img)" />
  79. <img :src="img.url" v-else-if="img.type == 'img'" @click="preViewConstractFile(img, item.constractFiles)" />
  80. </li>
  81. </ul>
  82. </div>
  83. </div>
  84. <span v-if="!contractList.length" style="font-size: 16px; color: #999">暂无历史合同</span>
  85. </div>
  86. </div>
  87. <el-image-viewer
  88. v-if="showViewer"
  89. :on-close="
  90. () => {
  91. this.showViewer = false;
  92. }
  93. "
  94. :url-list="constractFileImgList"
  95. />
  96. </el-dialog>
  97. </div>
  98. </template>
  99. <script>
  100. import ElImageViewer from "element-ui/packages/image/src/image-viewer";
  101. export default {
  102. props: {
  103. isPreview: {
  104. type: Boolean,
  105. default: false,
  106. },
  107. dealList: {
  108. type: Array,
  109. default: () => {
  110. return [];
  111. },
  112. },
  113. },
  114. components: { ElImageViewer },
  115. watch: {
  116. isPreview(val) {
  117. if (val) {
  118. this.getContractList();
  119. }
  120. },
  121. },
  122. data() {
  123. return {
  124. ficcContractList: [],
  125. raiContractList: [],
  126. contractList: [],
  127. contractType: "",
  128. showViewer: false,
  129. constractFileImgList: [],
  130. };
  131. },
  132. methods: {
  133. getContractList() {
  134. this.ficcContractList = this.dealList.filter((i) => i.ProductId === 1);
  135. this.raiContractList = this.dealList.filter((i) => i.ProductId === 2);
  136. this.changeContractType("ficc");
  137. if (!this.ficcContractList.length && this.raiContractList.length) {
  138. this.changeContractType("rai");
  139. }
  140. },
  141. changeContractType(type) {
  142. if (this.contractType === type) return;
  143. this.contractType = type;
  144. type === "ficc" && (this.contractList = this.ficcContractList);
  145. type === "rai" && (this.contractList = this.raiContractList);
  146. },
  147. showContractFiles(data) {
  148. this.constractFileImgList = [];
  149. const { constractFiles } = data;
  150. const imageList = constractFiles.filter((i) => i.type === "img");
  151. const wordList = constractFiles.filter((i) => i.type === "word");
  152. const pdfList = constractFiles.filter((i) => i.type === "pdf");
  153. imageList.forEach((i) => {
  154. this.constractFileImgList.push(i.url);
  155. });
  156. if (this.constractFileImgList.length) {
  157. this.showViewer = true;
  158. }
  159. },
  160. preViewConstractFile(data, list = []) {
  161. this.constractFileImgList = [];
  162. if (data.type === "word") {
  163. window.open("https://view.officeapps.live.com/op/view.aspx?src=" + data.url, "_blank");
  164. }
  165. if (data.type === "pdf") {
  166. window.open(data.url);
  167. }
  168. if (data.type === "img") {
  169. //改变list的顺序,当前点击的为第一个
  170. list
  171. .filter((i) => i.type === "img")
  172. .map((i) => {
  173. this.constractFileImgList.push(i.url);
  174. });
  175. const index = this.constractFileImgList.findIndex((url) => url === data.url);
  176. this.constractFileImgList = [...this.constractFileImgList.slice(index), ...this.constractFileImgList.slice(0, index)];
  177. if (this.constractFileImgList.length) {
  178. this.showViewer = true;
  179. }
  180. }
  181. },
  182. showExpand(index, type = "root") {
  183. type === "root" && (this.contractList[index].extend = !this.contractList[index].extend);
  184. type === "files" && (this.contractList[index].filesExtend = !this.contractList[index].filesExtend);
  185. this.contractList.splice(index, 1, this.contractList[index]);
  186. },
  187. toContractDetail(item) {
  188. if (!item.ContractId) return;
  189. const { href } = this.$router.resolve({ path: "/contractdetail", query: { contractId: item.ContractId } }) || { href: "" };
  190. href && window.open(href, "_blank");
  191. },
  192. closePreview() {
  193. this.$emit("update:isPreview", false);
  194. this.$emit("update:dealList", []);
  195. },
  196. },
  197. };
  198. </script>
  199. <style lang="scss">
  200. .history-contract-wrap-content_rai {
  201. .dialog-wrap {
  202. padding: 5px 60px 30px 60px;
  203. .contract-tab {
  204. display: flex;
  205. margin-bottom: 30px;
  206. span {
  207. flex: 1;
  208. text-align: center;
  209. font-size: 16px;
  210. padding-bottom: 5px;
  211. cursor: pointer;
  212. &.active {
  213. color: #0052d9;
  214. border-bottom: 2px solid #0052d9;
  215. }
  216. }
  217. }
  218. .contract-list {
  219. max-height: 600px;
  220. min-height: 200px;
  221. overflow-y: auto;
  222. padding-right: 6px;
  223. .contract-item {
  224. padding: 20px;
  225. border: 1px solid #dcdfe6;
  226. border-radius: 4px;
  227. margin-bottom: 30px;
  228. display: flex;
  229. flex-direction: column;
  230. gap: 20px 0;
  231. .contract-tag {
  232. span {
  233. cursor: pointer;
  234. &:last-child {
  235. margin-left: 12px;
  236. }
  237. font-size: 16px;
  238. color: #409eff;
  239. }
  240. }
  241. .line {
  242. height: 1px;
  243. background-color: #dcdfe6;
  244. margin: 0 -20px;
  245. }
  246. .contract-base {
  247. li {
  248. display: flex;
  249. border: 1px solid #dcdfe6;
  250. border-bottom: none;
  251. &:last-child {
  252. border-bottom: 1px solid #dcdfe6;
  253. }
  254. p {
  255. font-size: 16px;
  256. flex: 1;
  257. min-height: 48px;
  258. display: flex;
  259. align-items: center;
  260. margin-left: 20px;
  261. &:first-child {
  262. border-right: 1px solid #dcdfe6;
  263. }
  264. }
  265. }
  266. }
  267. .contract-info {
  268. display: flex;
  269. justify-content: space-between;
  270. align-items: center;
  271. div,
  272. i::before {
  273. font-size: 14px;
  274. font-weight: bold;
  275. color: #333333;
  276. cursor: pointer;
  277. }
  278. }
  279. .contract-root {
  280. border: 2px dashed #dcdfe6;
  281. border-radius: 4px;
  282. padding: 20px;
  283. .menu_lists {
  284. li {
  285. display: flex;
  286. margin-bottom: 20px;
  287. &:last-child {
  288. margin-bottom: 0;
  289. }
  290. }
  291. }
  292. }
  293. .contract-files {
  294. .file-list {
  295. display: flex;
  296. gap: 10px;
  297. flex-wrap: wrap;
  298. li {
  299. width: 240px;
  300. height: 180px;
  301. padding: 10px;
  302. box-sizing: border-box;
  303. cursor: pointer;
  304. border-radius: 4px;
  305. background-color: rgb(170, 170, 170);
  306. img {
  307. width: 100%;
  308. height: 100%;
  309. }
  310. }
  311. }
  312. }
  313. }
  314. }
  315. }
  316. }
  317. </style>