contractDetail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <template>
  2. <div class="flex addconstract-container">
  3. <el-form ref="form" :model="formData" label-position="left" :rules="formRule" label-width="110px" style="width: 80%">
  4. <section class="section">
  5. <h2 class="section-title">客户信息</h2>
  6. <div class="section-container">
  7. <div class="flex border-top" style="padding-top: 30px">
  8. <el-form-item label="甲方名称" prop="customeName" style="width: 50%">
  9. <el-input v-model="formData.CompanyName" placeholder="请输入或者搜索客户名称" style="width: 350px" disabled></el-input>
  10. </el-form-item>
  11. <el-form-item label="社会信用码" prop="customeXYM" style="width: 50%">
  12. <el-input v-model="formData.CreditCode" placeholder="请输入社会信用码" style="width: 350px" disabled></el-input>
  13. </el-form-item>
  14. </div>
  15. <div class="flex border-top" style="padding-top: 30px">
  16. <el-form-item label="公司地址" prop="province" style="width: 50%">
  17. <el-input :value="formData.Province + formData.City" disabled style="width: 350px"></el-input>
  18. </el-form-item>
  19. <el-form-item label="详细地址" prop="address" style="width: 50%">
  20. <el-input :value="formData.Address" disabled placeholder="请输入详细地址" style="width: 350px"></el-input>
  21. </el-form-item>
  22. </div>
  23. <div class="flex border-top" style="padding-top: 30px">
  24. <el-form-item label="传真" prop="customeCz" style="width: 50%">
  25. <el-input v-model="formData.Fax" disabled placeholder="请输入传真" style="width: 350px"></el-input>
  26. </el-form-item>
  27. <el-form-item label="电话" prop="customeTel" style="width: 50%">
  28. <el-input v-model="formData.Phone" disabled placeholder="请输入电话" style="width: 350px"></el-input>
  29. </el-form-item>
  30. </div>
  31. <el-form-item label="邮编" prop="postCode" class="border-top">
  32. <el-input v-model="formData.Postcode" disabled placeholder="请输入邮编" style="width: 350px"></el-input>
  33. </el-form-item>
  34. </div>
  35. </section>
  36. <section class="section">
  37. <h2 class="section-title">合同信息</h2>
  38. <div class="section-container">
  39. <div class="flex border-top" style="padding-top: 30px">
  40. <el-form-item label="合同编号" style="width: 50%">
  41. <span>{{ formData.ContractCode }}</span>
  42. </el-form-item>
  43. <el-form-item label="合同归属" style="width: 50%">
  44. <span>{{ formData.ProductId === 1 ? "ficc" : "权益" }}</span>
  45. </el-form-item>
  46. </div>
  47. <el-form-item label="合同类型" prop="constractType" class="border-top">
  48. <el-radio-group v-model="formData.ContractType">
  49. <div style="display:flex">
  50. <div style="margin-right:10px;">
  51. <el-radio label="新签合同" disabled>新签合同</el-radio>
  52. <el-tooltip effect="dark" style="cursor: pointer;width:20px;">
  53. <div slot="content">没有正式转试用记录的客户,在申请转正时提交的合同</div>
  54. <i class="el-icon-info" style="font-size:14px;margin-left:-20px"></i>
  55. </el-tooltip>
  56. </div>
  57. <div style="margin-right:10px">
  58. <el-radio label="续约合同" disabled>续约合同</el-radio>
  59. <el-tooltip effect="dark" style="cursor: pointer;width:20px;">
  60. <div slot="content">
  61. 1、有正式转试用记录的客户,在申请转正时提交的合同<br>
  62. 2、所有客户在续约申请时提交的合同
  63. </div>
  64. <i class="el-icon-info" style="font-size:14px;margin-left:-20px"></i>
  65. </el-tooltip>
  66. </div>
  67. <div style="margin-right:10px" v-if="RoleType!=='rai_seller'">
  68. <el-radio label="补充协议" disabled>补充协议</el-radio>
  69. </div>
  70. </div>
  71. </el-radio-group>
  72. </el-form-item>
  73. <div class="flex border-top" v-if="formData.timeRange">
  74. <el-form-item label="合同期限" prop="time" style="width: 50%">
  75. <el-date-picker disabled v-model="formData.timeRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"> </el-date-picker>
  76. </el-form-item>
  77. <span style="line-height: 40px">{{ formData.timeRange | formateYear }}</span>
  78. </div>
  79. <div class="flex border-top">
  80. <el-form-item label="合同金额" prop="price" style="width: 50%">
  81. <el-input disabled :value="formData.OriginalPrice|formatPrice" placeholder="请输入合同金额" style="width: 220px"></el-input>
  82. </el-form-item>
  83. <span style="line-height: 40px">大写:{{ formData.OriginalPrice | digitUppercase }}</span>
  84. </div>
  85. <div class="flex border-top">
  86. <el-form-item label="优惠后金额" prop="price2" style="width: 50%">
  87. <el-input disabled :vlaue="formData.Price|formatPrice" placeholder="请输入优惠后金额" style="width: 220px"></el-input>
  88. </el-form-item>
  89. <span style="line-height: 40px">大写:{{ formData.Price | digitUppercase }}</span>
  90. </div>
  91. <el-form-item label="付款方式说明" prop="remark" class="border-top">
  92. <el-input type="textarea" disabled v-model="formData.PayRemark" placeholder="请输入付款方式说明(请参考以下说明模板填写,请勿填写现金/转账等支付形式)" style="width: 80%"></el-input>
  93. </el-form-item>
  94. <el-form-item label="付款方" prop="PayChannel" class="border-top">
  95. <el-input type="textarea" disabled v-model="formData.PayChannel" placeholder="代付,请填写代付的券商名称或期货公司名称;非代付,请填写无。(请勿填写现金/转账等支付形式)" style="width: 80%"></el-input>
  96. </el-form-item>
  97. <!-- <el-form-item label="备注" class="border-top">
  98. <el-input type="textarea" disabled v-model="formData.SellerRemark" placeholder="审批人查看,不在生成合同中展示" style="width: 80%"></el-input>
  99. </el-form-item> -->
  100. </div>
  101. </section>
  102. <section class="section">
  103. <h2 class="section-title">服务内容</h2>
  104. <div class="section-container">
  105. <!-- ficc 服务内容表格 -->
  106. <FiccServiceTable
  107. :canEdit="false"
  108. :serviceData="ficcServiceData"
  109. :hasSercive="formData.Service"
  110. @handleShowService="handleShowService"
  111. v-if="formData.ProductId === 1 && ficcServiceData"
  112. ></FiccServiceTable>
  113. <!-- 权益 服务内容表格 -->
  114. <QyServiceTable
  115. :canEdit="false"
  116. :serviceData="qyServiceData"
  117. :hasSercive="formData.Service"
  118. @handleShowService="handleShowService"
  119. v-if="formData.ProductId === 2 && qyServiceData"
  120. ></QyServiceTable>
  121. </div>
  122. <p style="margin-top: 30px; margin-bottom: 20px">补充内容(eg额外赠送、路演次数规定)</p>
  123. <el-radio v-model="radio" label="2" disabled>无</el-radio>
  124. <el-radio v-model="radio" label="1" disabled>有</el-radio>
  125. <el-input v-if="radio === '1'" disabled type="textarea" v-model="formData.Remark" rows="5" placeholder="请输入内容" style="margin: 20px 0; display: block; box-sizing: border-box"></el-input>
  126. </section>
  127. <section class="section">
  128. <h2 class="section-title">审批备注</h2>
  129. <div class="section-container">
  130. <el-form-item label="备注" class="border-top">
  131. <el-input type="textarea" disabled v-model="formData.SellerRemark" placeholder="请输入备注(仅供审批人查看,不在生成合同中展示)" style="width: 80%"></el-input>
  132. </el-form-item>
  133. </div>
  134. </section>
  135. </el-form>
  136. <div class="right-wrap">
  137. <div style="display: flex; justify-content: space-between">
  138. <el-button type="primary" style="width: 45%" @click="handleGoEdit" v-if="showEdit">编辑</el-button>
  139. <el-button type="primary" plain :style="{width: showEdit?'45%':'100%'}" @click="handleGoPreview">预览</el-button>
  140. </div>
  141. <div class="timeline-wrap">
  142. <el-timeline>
  143. <el-timeline-item color="#409EFF" v-for="item in operationList" :key="item.Id" placement="top" :timestamp="item.CreateTimeStr">
  144. {{item.OpUserName}}{{ item.Remark }}
  145. </el-timeline-item>
  146. </el-timeline>
  147. </div>
  148. </div>
  149. <!-- 查看报价单弹窗 -->
  150. <el-dialog v-dialogDrag :visible.sync="serviceShow" width="60%" custom-class="self-dialog-c" :modal-append-to-body="false" @close="serviceClose" :show-close="false">
  151. <h2 class="title" style="text-align: center; color: #000">{{ serviceCon.ProductId == '1'? serviceCon.Title : serviceCon.showTitle }}</h2>
  152. <img class="img" style="width: 100%; display: block; margin: 20px auto"
  153. :src="serviceCon.ProductId == '1'? serviceCon.Value : serviceCon.showValue" />
  154. <!-- <table v-else class="table-wrap">
  155. <thead>
  156. <tr style="background: #f0f2f5">
  157. <th class="table-item" v-for="item in serviceCon.tableHeadData" :key="item.Value">{{ item.Value }}</th>
  158. </tr>
  159. </thead>
  160. <tbody>
  161. <tr v-for="(row, rindex) in serviceCon.tableData" :key="rindex" :class="rindex === selectRowIndex ? 'row-dark' : null">
  162. <td class="table-item" v-for="item in row" :key="item">
  163. <div>{{ item.Value }}</div>
  164. </td>
  165. </tr>
  166. </tbody>
  167. </table> -->
  168. <div style="text-align: center; margin-bottom: 30px">
  169. <el-button type="primary" @click="serviceShow =false">知道了</el-button>
  170. </div>
  171. </el-dialog>
  172. </div>
  173. </template>
  174. <script>
  175. import QyServiceTable from "./components/QyServiceTable"; //权益服务内容表格组件
  176. import FiccServiceTable from "./components/FiccServiceTable"; //ficc服务内容表格组件
  177. import { contractInterface } from "@/api/api.js";
  178. import {CalculationDate} from '@/utils/CalculationDate'
  179. export default {
  180. name: "constractDetail",
  181. components: {
  182. QyServiceTable,
  183. FiccServiceTable,
  184. },
  185. // beforeRouteLeave(to, from, next) {
  186. // from.matched[0].name='合同管理'
  187. // next()
  188. // },
  189. filters: {
  190. formatPrice(str){
  191. if(!str) return ''
  192. str=str.toString()
  193. let num1='',num2=''
  194. if(str.indexOf(".")!=-1){
  195. num1=str.substring(0,str.indexOf("."))
  196. num2=str.substring(str.length,str.indexOf("."))
  197. if(Number(num2)<=0){
  198. num2=''
  199. }
  200. }else{
  201. num1=str
  202. }
  203. return num1.replace(/(?!^)(?=(\d{3})+$)/g, ',')+num2
  204. },
  205. // 金额转中文大写
  206. digitUppercase(n) {
  207. let fraction = ["角", "分"];
  208. let digit = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"];
  209. let unit = [
  210. ["元", "万", "亿"],
  211. ["", "拾", "佰", "仟"],
  212. ];
  213. let head = n < 0 ? "欠" : "";
  214. n = Math.abs(n);
  215. let s = "";
  216. for (let i = 0; i < fraction.length; i++) {
  217. s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, "");
  218. }
  219. // s = s || "整";
  220. n = Math.floor(n);
  221. for (let i = 0; i < unit[0].length && n > 0; i++) {
  222. let p = "";
  223. for (let j = 0; j < unit[1].length && n > 0; j++) {
  224. p = digit[n % 10] + unit[1][j] + p;
  225. n = Math.floor(n / 10);
  226. }
  227. s = p.replace(/(零.)*零$/, "").replace(/^$/, "零") + unit[0][i] + s;
  228. }
  229. return (
  230. head + s.replace(/(零.)*零元/, "元").replace(/(零.)+/g, "零")
  231. // .replace(/^整$/, "零元整")
  232. );
  233. },
  234. //计算多少年
  235. formateYear(e) {
  236. if (e[0]) {
  237. return `有效期为${CalculationDate(e[0],e[1])}`
  238. } else {
  239. return "";
  240. }
  241. },
  242. },
  243. data() {
  244. return {
  245. RoleType: localStorage.getItem("Role") || "",
  246. contractId: this.$route.query.contractId,
  247. operationList: [],//操作记录
  248. formData: {}, //合同详情数据
  249. radio: "1", //用于显示底部是否有备注内容
  250. ficcServiceData: null, //ficc 底部表格数据
  251. qyServiceData: null, //权益底部表格数据
  252. serviceShow: false, //是否显示查看报价单
  253. serviceCon: {}, //选择的服务项 查看报价单/选择品种
  254. showEdit:false,//是否显示编辑按钮
  255. };
  256. },
  257. created() {
  258. this.getDetail();
  259. this.getContractOperationList()
  260. },
  261. methods: {
  262. //前往预览合同
  263. handleGoPreview(){
  264. let {href} = this.$router.resolve({path:"/contractdtl",query:{contractid:this.contractId}});
  265. window.open(href,'_blank');
  266. },
  267. //获取合同操作记录
  268. getContractOperationList(){
  269. contractInterface.getContractOperationList({ContractId:this.contractId}).then(res=>{
  270. if(res.Ret===200){
  271. this.operationList=res.Data.List&&res.Data.List.map(item=>{
  272. return {...item,CreateTimeStr:item.CreateTimeStr.replace(/-/g,'.')}
  273. })||[]
  274. }
  275. })
  276. },
  277. //点击编辑 跳转编辑页
  278. handleGoEdit() {
  279. this.$router.push({
  280. path: "/editcontract",
  281. query: {
  282. contractId: this.contractId,
  283. type: "edit",
  284. },
  285. });
  286. },
  287. //显示查看报价单弹窗
  288. handleShowService(e) {
  289. console.log(e);
  290. // 小套餐情况处理表格数据
  291. if (e.Detail) {
  292. let temarr = e.Detail.map((rowItem) => {
  293. let rowArr = [];
  294. for (let key in rowItem) {
  295. if (key.substr(0, 3) === "Col" && rowItem[key] !== "") {
  296. rowArr.push(JSON.parse(rowItem[key]));
  297. }
  298. }
  299. return rowArr;
  300. });
  301. this.serviceCon = { ...e, tableHeadData: temarr[0], tableData: temarr.slice(1) };
  302. } else {
  303. this.serviceCon = e;
  304. }
  305. this.serviceShow = true;
  306. },
  307. //关闭查看报价单弹窗
  308. serviceClose() {
  309. this.serviceShow = false;
  310. },
  311. //获取服务套餐模板数据
  312. getServiceList() {
  313. contractInterface.getServiceList({ ProductId: this.formData.ProductId }).then((res) => {
  314. if (res.Ret === 200) {
  315. if (this.formData.ProductId === 1) {
  316. this.ficcServiceData = res.Data;
  317. } else {
  318. this.qyServiceData = res.Data;
  319. }
  320. }
  321. });
  322. },
  323. // 获取合同详情
  324. getDetail() {
  325. contractInterface.getContractDetail({ ContractId: Number(this.contractId) }).then((res) => {
  326. if (res.Ret === 200) {
  327. this.formData = { ...res.Data, timeRange: [res.Data.StartDate, res.Data.EndDate] };
  328. if(res.Data.RelationContractDetailList.length>0){
  329. let arr=[]
  330. res.Data.RelationContractDetailList.forEach(item=>{
  331. arr.push(item.CompanyName)
  332. })
  333. this.formData.PayChannel=arr.join('、')
  334. }
  335. if (res.Data.Remark) {
  336. this.radio = "1";
  337. } else {
  338. this.radio = "2";
  339. }
  340. // 本人的合同并且合同状态不为 已审批、待审批、已作废、已签回、已解约 则显示编辑
  341. let userid=localStorage.getItem('AdminId')
  342. if(userid==res.Data.SellerId
  343. &&res.Data.Status!=='待审批'
  344. &&res.Data.Status!=='已审批'
  345. &&res.Data.Status!=='已作废'
  346. &&res.Data.Status!=='已签回'
  347. &&res.Data.Status!=='已解约'){
  348. this.showEdit=true
  349. }else{
  350. this.showEdit=false
  351. }
  352. this.getServiceList();
  353. }
  354. });
  355. },
  356. },
  357. };
  358. </script>
  359. <style>
  360. .el-radio__input.is-checked .el-radio__inner {
  361. background-color: transparent;
  362. }
  363. .el-radio__inner::after {
  364. width: 6px;
  365. height: 6px;
  366. background-color: #409eff;
  367. }
  368. .el-checkbox__label {
  369. font-size: 16px !important;
  370. }
  371. .el-form-item {
  372. margin-bottom: 30px;
  373. }
  374. .el-input.is-disabled .el-input__inner {
  375. color: #606266;
  376. }
  377. .el-radio__input.is-disabled + span.el-radio__label {
  378. color: #606266;
  379. }
  380. .el-range-editor.is-disabled input {
  381. color: #606266;
  382. }
  383. .el-textarea.is-disabled .el-textarea__inner {
  384. color: #606266;
  385. }
  386. .el-timeline-item__tail {
  387. border-left: 2px solid #409eff;
  388. }
  389. .self-dialog-c .el-dialog__header {
  390. background-color: #fff;
  391. padding: 0;
  392. }
  393. .self-dialog-c{
  394. width: auto;
  395. /* max-width: 60%; */
  396. }
  397. </style>
  398. <style lang="scss" scoped>
  399. .img{
  400. image-rendering: -moz-crisp-edges;
  401. image-rendering: -o-crisp-edges;
  402. image-rendering: -webkit-optimize-contrast;
  403. image-rendering: crisp-edges;
  404. -ms-interpolation-mode: nearest-neighbor;
  405. }
  406. .addconstract-container {
  407. min-height: calc(100vh - 250px);
  408. position: relative;
  409. font-size: 16px;
  410. color: #000;
  411. }
  412. .flex {
  413. display: flex;
  414. }
  415. .section {
  416. background-color: #fff;
  417. border: 1px solid #aab4cc;
  418. border-radius: 4px;
  419. padding: 20px;
  420. margin-bottom: 20px;
  421. .section-title {
  422. margin-bottom: 30px;
  423. }
  424. .border-top {
  425. padding-top: 30px;
  426. border-top: 1px solid #dcdfe6;
  427. }
  428. }
  429. .right-wrap {
  430. margin-left: 20px;
  431. flex: 1;
  432. .timeline-wrap {
  433. margin-top: 20px;
  434. background-color: #fff;
  435. border: 1px solid #aab4cc;
  436. padding: 20px;
  437. border-radius: 4px;
  438. text-align: left;
  439. height: calc(100% - 120px);
  440. max-height: 1130px;
  441. overflow-y: auto;
  442. }
  443. }
  444. .table-wrap {
  445. margin: 20px 0;
  446. position: relative;
  447. width: 100%;
  448. text-align: center;
  449. border-top: 1px solid #ebeef5;
  450. border-left: 1px solid #ebeef5;
  451. .row-dark {
  452. background-color: #deedff;
  453. }
  454. .table-item {
  455. padding: 12px 10px;
  456. border-right: 1px solid #ebeef5;
  457. border-bottom: 1px solid #ebeef5;
  458. min-width: 200px;
  459. position: relative;
  460. }
  461. }
  462. </style>