writing-conclusion.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <div id="submit-report-layout-target" class="hc-page-box conclusion">
  3. <hc-new-card>
  4. <template #header>
  5. <div class="hc-conclusion-header-box">
  6. <div class="hc-conclusion-icon-box">
  7. <HcIcon name="file-ppt-2" fill />
  8. </div>
  9. <div class="ml-2 conclusion-name-box">
  10. <span class="text-xl text-cut conclusion-alias">编写结论、提交报告</span>
  11. <div class="text-xs text-cut conclusion-name">{{ projectInfo.name }}</div>
  12. </div>
  13. </div>
  14. </template>
  15. <template #extra>
  16. <el-button type="danger" round @click="writeReportClick">下一步、编写报告</el-button>
  17. <el-button type="danger" plain round @click="toBackClick">返回主页</el-button>
  18. </template>
  19. <el-container class="hc-table-layout">
  20. <el-container id="hc_table_container" class="hc-table-container">
  21. <HcCardItem id="hc_table_data" title="抽检统计:">
  22. <template #extra>
  23. <span class="text-red">{{ tips }}</span>
  24. </template>
  25. <TableStats :contract-id="contractId" :project-id="projectId" @change-tips="changeTips" />
  26. </HcCardItem>
  27. <HcCardItem id="hc_table_score" title="专家验收评分表:">
  28. <template #header>
  29. <span>专家验收评分表:</span>
  30. <el-checkbox v-model="searchFormScore.score" class="size-xl" @change="changeScore">生成打分表</el-checkbox>
  31. </template>
  32. <template #extra>
  33. <div class="w-40">
  34. <el-select v-model="searchFormScore.unitType" placeholder="参建方类型表">
  35. <el-option label="总承包单位" value="1" />
  36. <el-option label="监理单位" value="2" />
  37. <el-option label="施工单位" value="3" />
  38. </el-select>
  39. </div>
  40. </template>
  41. <TableScore :contract-id="contractId" :project-id="projectId" :type="searchFormScore.unitType" :state="state" />
  42. </HcCardItem>
  43. </el-container>
  44. <el-aside id="hc_table_aside" class="hc-table-aside">
  45. <HcCardItem title="抽检意见记录汇总:">
  46. <TableOpinion ref="tableOpinionRef" :contract-id="contractId" :project-id="projectId" @opinion-tap="tableOpinionTap" />
  47. </HcCardItem>
  48. </el-aside>
  49. </el-container>
  50. </hc-new-card>
  51. <!-- 抽检记录详情 -->
  52. <hc-new-dialog v-model="isOpinionModal" title="抽检记录详情" widths="60%" is-table :footer="false" @close="onOpinionModalClose">
  53. <div class="hc-table-opinion-text">
  54. <div class="title">案卷题名:{{ opRow.archiveName }}</div>
  55. <div class="opinion-text">
  56. <div class="text-1">抽检意见:</div>
  57. <div v-if="!opinionTextEdit" class="text-2">{{ opinionText }}</div>
  58. <div v-if="opinionTextEdit" class="text-2 input">
  59. <el-input v-model="opinionText" style="flex: 1;" :rows="3" placeholder="请输入抽检意见" type="textarea" resize="none" />
  60. <el-button class="ml-4" hc-btn type="primary" :loading="submitLoading" @click="opinionTextEditHihe">保存</el-button>
  61. </div>
  62. <div v-if="!opinionTextEdit " class="text-blue text-hover icon-1" @click="opinionTextEditShow">
  63. <HcIcon v-if="!state" name="edit-2" />
  64. </div>
  65. </div>
  66. </div>
  67. <div class="hc-table-opinion-pdf">
  68. <HcPdf
  69. :src="opRow.filePdf"
  70. />
  71. </div>
  72. </hc-new-dialog>
  73. </div>
  74. </template>
  75. <script setup>
  76. import { onActivated, onMounted, ref } from 'vue'
  77. import { useAppStore } from '~src/store'
  78. import { useRouter } from 'vue-router'
  79. import TableStats from './components/conclusion/table-stats.vue'
  80. import TableOpinion from './components/conclusion/table-opinion.vue'
  81. import TableScore from './components/conclusion/table-score.vue'
  82. import initialgApi from '~api/initial/initial'
  83. import writeApi from '~api/transfer/write-conclusion'
  84. import { isNullES } from 'js-fast-way'
  85. //变量
  86. const router = useRouter()
  87. const useAppState = useAppStore()
  88. const projectId = ref(useAppState.getProjectId)
  89. const contractId = ref(useAppState.getContractId)
  90. const projectInfo = ref(useAppState.getProjectInfo)
  91. //渲染完成
  92. onMounted(() => {
  93. setSplitRef()
  94. getScore()
  95. })
  96. onActivated(()=>{
  97. getStatus()
  98. })
  99. //初始化设置拖动分割线
  100. const setSplitRef = () => {
  101. //配置参考: https://split.js.org/#/?direction=vertical&snapOffset=0
  102. setTimeout(() => {
  103. window.$split(['#hc_table_container', '#hc_table_aside'], {
  104. sizes: [80, 20],
  105. snapOffset: 0,
  106. minSize: [400, 600],
  107. })
  108. window.$split(['#hc_table_data', '#hc_table_score'], {
  109. direction: 'vertical',
  110. snapOffset: 0,
  111. minSize: 200,
  112. })
  113. }, 800)
  114. }
  115. //获取是否可以修改
  116. const state = ref(false)
  117. const getStatus = async ()=>{
  118. const { error, code, data } = await initialgApi.getTable({
  119. projectId: projectId.value,
  120. })
  121. if (!error && code === 200) {
  122. state.value = data['status'] === 2 ? true : false
  123. }
  124. }
  125. const searchFormScore = ref({
  126. unitType: '1', score: false,
  127. })
  128. //获取是否打分
  129. const getScore = async ()=>{
  130. const { error, code, data, msg } = await writeApi.creatScore({
  131. projectId:projectId.value,
  132. })
  133. if (!error && code === 200) {
  134. if (data === 1) {
  135. searchFormScore.value.score = true
  136. } else {
  137. searchFormScore.value.score = false
  138. }
  139. } else {
  140. searchFormScore.value.score = false
  141. }
  142. }
  143. const changeScore = async (val)=>{
  144. const { error, code, data, msg } = await writeApi.updateScore({
  145. projectId:projectId.value,
  146. isSelect:val ? 1 : 0,
  147. })
  148. if (!error && code === 200) {
  149. window.$message.success(msg)
  150. }
  151. }
  152. //查看意见
  153. const isOpinionModal = ref(false)
  154. const opRow = ref({})
  155. const tableOpinionTap = (row) => {
  156. isOpinionModal.value = true
  157. opRow.value = row
  158. opinionText.value = row.opinion
  159. }
  160. const onOpinionModalClose = () => {
  161. isOpinionModal.value = false
  162. tableOpinionRef.value.getTableData()
  163. }
  164. const tableOpinionRef = ref(null)
  165. //抽检记录意见
  166. const opinionText = ref('')
  167. const opinionTextEdit = ref(false)
  168. const opinionTextEditShow = () => {
  169. opinionTextEdit.value = true
  170. }
  171. const submitLoading = ref(false)
  172. const opinionTextEditHihe = async () => {
  173. submitLoading.value = true
  174. const { error, code, data, msg } = await initialgApi.saveInspect({
  175. ... opRow.value,
  176. opinion:opinionText.value,
  177. })
  178. submitLoading.value = false
  179. if (!error && code === 200) {
  180. window.$message.success(msg)
  181. }
  182. if (isNullES(opinionText.value)) {
  183. onOpinionModalClose()
  184. }
  185. opinionTextEdit.value = false
  186. }
  187. //编写报告
  188. const writeReportClick = async () => {
  189. const { error, code, data, msg } = await writeApi.checkTable({
  190. projectId: projectId.value,
  191. })
  192. if (!error && code === 200) {
  193. if (data) {
  194. router.push({
  195. name: 'transfer-write-report',
  196. })
  197. }
  198. }
  199. }
  200. //返回
  201. const toBackClick = () => {
  202. router.push({
  203. name: 'transfer-initial-expert',
  204. })
  205. }
  206. //预警提示
  207. const tips = ref('预警提示:抽检率未达到验收要求,目前至抽检了4.5%')
  208. const changeTips = (val)=>{
  209. tips.value = val
  210. }
  211. </script>
  212. <style lang="scss" scoped>
  213. @import '~style/transfer/scoped/submit-report.scss';
  214. .hc-conclusion-header-box {
  215. position: relative;
  216. display: flex;
  217. align-items: flex-start;
  218. .hc-conclusion-icon-box {
  219. font-size: 28px;
  220. color: var(--el-color-primary);
  221. }
  222. .conclusion-name-box {
  223. flex: auto;
  224. position: relative;
  225. overflow: hidden;
  226. .conclusion-alias {
  227. color: var(--el-color-primary);
  228. }
  229. .conclusion-name {
  230. margin-top: 4px;
  231. color: #838791;
  232. }
  233. }
  234. }
  235. .hc-table-opinion-text {
  236. position: relative;
  237. color: #010101;
  238. font-size: 16px;
  239. margin-bottom: 10px;
  240. .title {
  241. position: relative;
  242. margin-bottom: 10px;
  243. }
  244. .opinion-text {
  245. position: relative;
  246. display: flex;
  247. align-items: flex-start;
  248. height: 73px;
  249. .text-2 {
  250. position: relative;
  251. }
  252. .text-2.input {
  253. position: relative;
  254. display: flex;
  255. align-items: flex-end;
  256. flex: 1;
  257. }
  258. .icon-1 {
  259. position: relative;
  260. margin-top: 3px;
  261. margin-left: 12px;
  262. }
  263. }
  264. }
  265. .hc-table-opinion-pdf {
  266. position: relative;
  267. height: calc(100% - 118px);
  268. }
  269. </style>
  270. <style lang="scss">
  271. @import '~style/transfer/submit-report.scss';
  272. .hc-page-box.conclusion .hc-table-layout .hc-table-aside {
  273. width: var(--el-aside-width,600px);
  274. }
  275. </style>