consignor.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <div class="contrl">
  3. <div style="width: 95%;">
  4. <div class="title-div">
  5. <span>上传估价结果一览表-表单</span>
  6. </div>
  7. </div>
  8. <div class="download-btn">
  9. <img src="../../../assets/icons/form.png"
  10. style="width: 26px; height: 26px; float: left; margin-top: 27px;" />
  11. <el-tooltip content="点击下载" effect="light" placement="top">
  12. <span class="form-name" @click="downloadCollect1">估价结果一览表-表单.xlsx</span>
  13. </el-tooltip>
  14. </div>
  15. <div class="target-windows">
  16. <SheetView :uploadUrl="'/api/file/house/guaranty/target'" @getExcelDate="excelDate"
  17. @getUploadReture="uploadReture" v-model:targetsHtml="process.targetsHtml"></SheetView>
  18. </div>
  19. <SwitchButton :nextPath="nextPath" :nextDo="genarate"></SwitchButton>
  20. <Steps :stepArray="stepArray" ref="steps" :stepsDialogVisible="stepDialog"></Steps>
  21. </div>
  22. </template>
  23. <script>
  24. import SwitchButton from '../../../components/SwichButton/index.vue'
  25. import SheetView from '../../../components/SheetView/index.vue'
  26. import houseGuaranty from '@/api/houseGuaranty';
  27. import { downloadCollect1 } from '@/api/fileUpload'
  28. import fileUtil from '@/utils/file'
  29. import Steps from '../../../components/Steps/index.vue'
  30. export default {
  31. components: {
  32. SwitchButton,
  33. SheetView,
  34. Steps,
  35. },
  36. data() {
  37. return {
  38. nextPath: '/home/houseWorkbench/certificate',
  39. excelHtml: null,
  40. upload: null,
  41. processId: null,
  42. docId: null,
  43. process:{
  44. id:null,
  45. home:null,
  46. targetsHtml:null,
  47. createdTime:null,
  48. updateTime:null
  49. },
  50. stepDialog:false,
  51. stepArray:[
  52. {name:'上传表单'},
  53. {name:'解析估价对象一览表'},
  54. {name:'生成致委托人函'},
  55. {name:'完成'}
  56. ]
  57. }
  58. },
  59. created() {
  60. this.docId = this.$route.query.id;
  61. this.getProcess();
  62. },
  63. methods: {
  64. genConsignorLetter(id) {
  65. houseGuaranty.genConsignorLetter(id).then(res => {
  66. ElMessage({
  67. message: '致委托人函已生成',
  68. type: 'success',
  69. plain: true
  70. })
  71. })
  72. },
  73. excelDate(data) {
  74. this.excelHtml = data;
  75. },
  76. uploadReture(data) {
  77. this.upload = data;
  78. //this.genTargetTableWord(this.excelHtml,data.filePath);
  79. },
  80. genTargetTableWord(excelData, homePath) {
  81. if (excelData && homePath) {
  82. const param = new Object();
  83. param.html = excelData;
  84. param.homePath = homePath;
  85. houseGuaranty.genTargetsTableWord(param).then(res => {
  86. if (res.code === 200) {
  87. this.processId = res.data;
  88. }
  89. })
  90. }
  91. },
  92. analysisExcel(id) {
  93. houseGuaranty.analysisCollect1(id).then(res => {
  94. if (res.code === 200) {
  95. this.genConsignorLetter(id);
  96. }
  97. })
  98. },
  99. async genarate() {
  100. this.stepDialog = true;
  101. if (this.excelHtml && this.upload) {
  102. const param = new Object();
  103. param.html = this.excelHtml;
  104. param.homePath = this.upload.filePath;
  105. await houseGuaranty.genTargetsTableWord(param).then(res => {
  106. if (res.code === 200) {
  107. this.processId = res.data;
  108. this.$refs.steps.next()
  109. }
  110. })
  111. await houseGuaranty.analysisCollect1(this.processId).then(res => {
  112. if (res.code === 200) {
  113. this.$refs.steps.next()
  114. }
  115. })
  116. await houseGuaranty.genConsignorLetter(this.processId).then(res => {
  117. if (res.code === 200) {
  118. ElMessage({
  119. message: '致委托人函已生成',
  120. type: 'success',
  121. plain: true
  122. })
  123. this.$emit('getProcessParentId',this.processId);
  124. this.$refs.steps.next();
  125. }
  126. })
  127. }
  128. setTimeout(()=>{
  129. this.$refs.steps.next();
  130. },500)
  131. },
  132. getProcess(){
  133. if (this.docId){
  134. houseGuaranty.getProcessByDocId(this.docId).then(res=>{
  135. if (res.code === 200){
  136. this.process = res.data;
  137. this.$emit('getProcessParentId',this.process.id)
  138. }
  139. })
  140. }
  141. },
  142. downloadCollect1(){
  143. fileUtil.download("/file/download/house/guaranty/collect1");
  144. },
  145. }
  146. }
  147. </script>
  148. <style scoped>
  149. .contrl {
  150. font-size: 20px;
  151. width: 70.9%;
  152. border-right: 1.5px #dae1eb solid;
  153. padding: 0px 20px 20px 0px;
  154. float: left;
  155. }
  156. :deep(.el-input__wrapper.is-focus) {
  157. --el-input-focus-border: #ff6154;
  158. --el-input-focus-border-color: #ff6154;
  159. }
  160. .target-windows {
  161. margin-top: 80px;
  162. overflow-y: scroll;
  163. padding: 5px;
  164. border: 1.5px #dae1eb solid;
  165. border-radius: 0.3em;
  166. }
  167. .download-btn {
  168. height: 80px;
  169. line-height: 80px;
  170. float: right;
  171. margin-left: 20px;
  172. }
  173. .form-name {
  174. margin-left: 5px;
  175. font-size: 16px;
  176. text-decoration: underline;
  177. }
  178. .form-name:hover {
  179. cursor: pointer;
  180. color: #ff6154;
  181. }
  182. .title-div {
  183. height: 80px;
  184. line-height: 80px;
  185. width: 300px;
  186. float: left;
  187. font-size: 20px;
  188. font-weight: 900;
  189. }
  190. </style>