leader-sampling.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div id="carry-spot-checks-layout-target" class="hc-page-layout-box">
  3. <div v-show="!isCarrySpotChecksDrawer" :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box">
  4. <div class="hc-project-box">
  5. <div class="hc-project-icon-box">
  6. <HcIcon name="stack"/>
  7. </div>
  8. <div class="ml-2 project-name-box">
  9. <span class="text-xl text-cut project-alias">{{ projectInfo['projectAlias'] }}</span>
  10. <div class="text-xs text-cut project-name">{{ projectInfo['name'] }}</div>
  11. </div>
  12. </div>
  13. <div class="hc-tree-box" v-loading="treeLoading" element-loading-text="加载中...">
  14. <el-scrollbar>
  15. <HcTree :contractId="contractId" :projectId="projectId" @nodeTap="projectTreeClick" @nodeLoading="treeNodeLoading"/>
  16. </el-scrollbar>
  17. </div>
  18. <!--左右拖动-->
  19. <div class="horizontal-drag-line" @mousedown="onmousedown"/>
  20. </div>
  21. <div v-show="!isCarrySpotChecksDrawer" class="hc-page-content-box">
  22. <HcCard>
  23. <template #header>
  24. <span>您抽检验收的分组类别为:业主组,本次验收共</span>
  25. <span class="text-orange mx-2">1232</span>
  26. <span>卷,目前已抽检</span>
  27. <span class="text-green mx-2">0</span>
  28. <span>卷</span>
  29. </template>
  30. <template #extra>
  31. <el-button hc-btn type="primary" @click="entrySamplingClick">重置验收范围</el-button>
  32. <el-button hc-btn type="warning" @click="toBackClick">
  33. <HcIcon name="arrow-go-back"/>
  34. <span>返回</span>
  35. </el-button>
  36. </template>
  37. <div class="hc-card-diy-search-box">
  38. <div class="text-gray text-sm mr-4">
  39. <span>通过关键词、题名、桩号等相关信息进行搜索:</span>
  40. <!--el-checkbox-group v-model="checkList">
  41. <el-checkbox label="目录"/>
  42. <el-checkbox label="案卷"/>
  43. <el-checkbox label="文件"/>
  44. </el-checkbox-group-->
  45. </div>
  46. <div class="autocomplete-box">
  47. <el-autocomplete v-model="state1" :fetch-suggestions="querySearch" class="w-full" clearable
  48. placeholder="搜索" @select="handleSelect"/>
  49. </div>
  50. </div>
  51. <div class="hc-card-diy-table-box">
  52. <HcTable :column="tableColumn"
  53. :datas="tableData"
  54. :loading="tableLoading"
  55. heights="auto">
  56. <template #key4="{row,index}">
  57. <span :style="row.key4_1 === '1'? 'color: #81b337' :''">{{ row.key4 }}</span>
  58. </template>
  59. <template #key5="{row,index}">
  60. <span :style="row.key5_1 === '1'? 'color: #81b337' :'color: #bd3124'">{{ row.key5 }}</span>
  61. </template>
  62. <template #action="{row,index}">
  63. <el-button size="small" type="primary" @click="tableClick(row)">查看</el-button>
  64. </template>
  65. </HcTable>
  66. </div>
  67. </HcCard>
  68. </div>
  69. <!--展开抽查-->
  70. <CarrySpotChecks :show="isCarrySpotChecksDrawer" @check="onCarrySpotChecksClose"
  71. @close="onCarrySpotChecksClose"/>
  72. </div>
  73. </template>
  74. <script setup>
  75. import {ref, watch, onMounted} from "vue";
  76. import {useAppStore} from "~src/store";
  77. import {useRouter} from "vue-router";
  78. //import HcTree from "./components/hc-tree.vue"
  79. import HcTree from "~src/components/tree/hc-tree.vue"
  80. import CarrySpotChecks from "./components/carry-spot-checks.vue"
  81. //变量
  82. const router = useRouter()
  83. const useAppState = useAppStore()
  84. const projectId = ref(useAppState.getProjectId);
  85. const contractId = ref(useAppState.getContractId);
  86. const projectInfo = ref(useAppState.getProjectInfo);
  87. const isCollapse = ref(useAppState.getCollapse)
  88. const isBubble = ref(useAppState.getBubble);
  89. //监听
  90. watch(() => [
  91. useAppState.getCollapse,
  92. useAppState.getBubble,
  93. ], ([Collapse, bubble]) => {
  94. isCollapse.value = Collapse
  95. isBubble.value = bubble
  96. })
  97. //渲染完成
  98. onMounted(() => {
  99. })
  100. //树加载
  101. const treeLoading = ref(true)
  102. const treeNodeLoading = () => {
  103. treeLoading.value = false
  104. }
  105. //项目树被点击
  106. const projectTreeClick = () => {
  107. }
  108. const checkList = ref([]);
  109. const state1 = ref('')
  110. const restaurants = ref([
  111. {value: '重庆市水利局关于安康至来凤国家高速公路奉节至巫山(渝鄂界)段水土保持方案准予许可的决定.PDF'},
  112. {value: '水土保持方案报告书、水土保持方案报告书技术评审会议纪要、水土保持方案的批复'},
  113. ])
  114. const querySearch = (queryString, cb) => {
  115. const results = queryString ? restaurants.value.filter(createFilter(queryString)) : restaurants.value
  116. cb(results)
  117. }
  118. const createFilter = (queryString) => {
  119. return (restaurant) => {
  120. return (
  121. restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
  122. )
  123. }
  124. }
  125. const handleSelect = (item) => {
  126. console.log(item)
  127. }
  128. const tableColumn = ref([
  129. {key: 'key1', name: '档号', width: 180},
  130. {key: 'key2', name: '案卷题名'},
  131. {key: 'key3', name: '立卷单位'},
  132. {key: 'key4', name: '抽检状态'},
  133. {key: 'key5', name: '抽检意见'},
  134. {key: 'action', name: '操作', width: 100},
  135. ])
  136. const tableData = ref([
  137. {
  138. id: 1,
  139. key1: 'xxxx',
  140. key2: '安康至来凤国家高速公路奉节至巫山(渝鄂界)段水土保持方案准予许可的决定',
  141. key3: 'xxxxxxx',
  142. key4: '已抽检',
  143. key4_1: '1',
  144. key5: '合格',
  145. key5_1: '1',
  146. },
  147. {
  148. id: 2,
  149. key1: 'xxxx',
  150. key2: '安康至来凤国家高速公路奉节至巫山(渝鄂界)段水土保持方案准予许可的决定',
  151. key3: 'xxxxxxx',
  152. key4: '未抽检',
  153. key4_1: '2',
  154. key5: '整改',
  155. key5_1: '2',
  156. },
  157. ])
  158. //获取数据
  159. const tableLoading = ref(false)
  160. const getTableData = async () => {
  161. }
  162. const tableClick = (row) => {
  163. isCarrySpotChecksDrawer.value = true
  164. }
  165. const isCarrySpotChecksDrawer = ref(false)
  166. //关闭抽查
  167. const onCarrySpotChecksClose = () => {
  168. isCarrySpotChecksDrawer.value = false
  169. }
  170. //返回
  171. const toBackClick = () => {
  172. router.push({
  173. name: 'transfer-initial-expert'
  174. })
  175. }
  176. //进入抽检
  177. const entrySamplingClick = () => {
  178. router.push({
  179. name: 'transfer-entry-sampling'
  180. });
  181. }
  182. //左右拖动,改变树形结构宽度
  183. const leftWidth = ref(382);
  184. const onmousedown = () => {
  185. const leftNum = isCollapse.value ? 142 : 272
  186. document.onmousemove = (ve) => {
  187. let diffVal = ve.clientX - leftNum;
  188. if (diffVal >= 310 && diffVal <= 900) {
  189. leftWidth.value = diffVal;
  190. }
  191. }
  192. document.onmouseup = () => {
  193. document.onmousemove = null;
  194. document.onmouseup = null;
  195. }
  196. }
  197. </script>
  198. <style lang="scss" scoped>
  199. .hc-card-diy-search-box {
  200. position: relative;
  201. width: 100%;
  202. .autocomplete-box {
  203. position: relative;
  204. width: 100%;
  205. margin-top: 10px;
  206. }
  207. }
  208. .hc-card-diy-table-box {
  209. position: relative;
  210. margin-top: 10px;
  211. width: 100%;
  212. height: calc(100% - 70px);
  213. }
  214. </style>
  215. <style lang="scss">
  216. .hc-csc-action-box .btn-box {
  217. .el-button + .el-button {
  218. margin-left: 50px;
  219. }
  220. }
  221. </style>