parameter.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <div class="hc-page-layout-box">
  3. <div class="hc-page-content-box">
  4. <hc-new-card>
  5. <template #header>
  6. <div class="hc-card-header-table-title">参数设置</div>
  7. </template>
  8. <template #extra>
  9. <HcTooltip keys="file_collection_btn_upload_scanned_files">
  10. <el-button type="primary" hc-btn @click="uploadModalClick">
  11. <HcIcon name="save" />
  12. <span>保存</span>
  13. </el-button>
  14. </HcTooltip>
  15. </template>
  16. <el-scrollbar>
  17. <div class="hc-page-content-box-list">
  18. <div class="hc-page-content-box-list-title">归档目录树选择范围</div>
  19. <el-alert title="选择对应的归档范围,目录树内容也会随之改变" type="error" :closable="false" />
  20. <div class="hc-card-header-tree-checkbox">
  21. <el-checkbox-group v-model="projectTypeList">
  22. <el-checkbox :label="1">公路工程</el-checkbox>
  23. <el-checkbox :label="2">水利水电工程</el-checkbox>
  24. </el-checkbox-group>
  25. </div>
  26. </div>
  27. <div class="hc-page-content-box-list">
  28. <div class="hc-page-content-box-list-title">案卷四要素设置</div>
  29. <el-alert title="勾选是否要生成封面、脊背、卷内目录、备考表" type="error" :closable="false" />
  30. <div class="hc-card-header-tree-checkbox">
  31. <el-checkbox-group v-model="factorTypeList">
  32. <el-checkbox label="1">案卷封面</el-checkbox>
  33. <el-checkbox label="2">卷内目录</el-checkbox>
  34. <el-checkbox label="3">脊背</el-checkbox>
  35. <el-checkbox label="4">备考表</el-checkbox>
  36. <el-checkbox label="5">生成页码</el-checkbox>
  37. </el-checkbox-group>
  38. </div>
  39. </div>
  40. <div class="hc-page-content-box-list">
  41. <div class="hc-page-content-box-list-title">组卷流水号设置</div>
  42. <el-alert title="配置流水号生成的规则,是否设置有虚号及位数" type="error" :closable="false" />
  43. <div class="hc-card-header-tree-checkbox">
  44. <el-radio-group v-model="dirType">
  45. <el-radio :label="1">按档案主目录类别生成后缀流水号</el-radio>
  46. <el-radio :label="0">按档案目录从上至下的顺序生成流水号</el-radio>
  47. </el-radio-group>
  48. <div class="mt-4">
  49. <el-radio-group v-model="indexType">
  50. <el-radio :label="1">有虚号</el-radio>
  51. <el-radio :label="0">无虚号</el-radio>
  52. </el-radio-group>
  53. </div>
  54. <div class="mt-4">
  55. <el-input-number v-model="indexNum" :min="0" :max="10" />
  56. </div>
  57. </div>
  58. </div>
  59. </el-scrollbar>
  60. </hc-new-card>
  61. </div>
  62. </div>
  63. </template>
  64. <script setup>
  65. import { onMounted, ref, watch } from 'vue'
  66. import { useAppStore } from '~src/store'
  67. import archiveConfigApi from '~api/archiveConfig/archiveConfig.js'
  68. //变量
  69. const useAppState = useAppStore()
  70. const projectId = ref(useAppState.getProjectId)
  71. const contractId = ref(useAppState.getContractId)
  72. const projectInfo = ref(useAppState.getProjectInfo)
  73. const isCollapse = ref(useAppState.getCollapse)
  74. const projectTypeList = ref([])
  75. const factorTypeList = ref([])
  76. const config = ref({})
  77. //组卷流水号设置
  78. const dirType = ref(0)//目录类型
  79. const indexType = ref(0)//流水号类型
  80. const indexNum = ref(0)//虚位数
  81. //监听
  82. watch(() => [
  83. useAppState.getCollapse,
  84. ], ([Collapse]) => {
  85. isCollapse.value = Collapse
  86. })
  87. //渲染完成
  88. onMounted(() => {
  89. getConfigByProjectId()
  90. })
  91. //搜索表单
  92. const searchForm = ref({
  93. contractId: null, type: null, approval: null, betweenTime: null,
  94. current: 1, size: 20, total: 0,
  95. })
  96. const getConfigByProjectId = async () => {
  97. const { code, res } = await archiveConfigApi.getConfigByProjectId({
  98. projectId: projectId.value,
  99. })
  100. //console.log(res);
  101. if (code == 200) {
  102. // 如果projectType 为 1 则选中 公路工程,为 2,则选中水里水电工程,为3,则两个都选中
  103. // factorType信息为字符串,格式为"1,2,3,4",包含 1,则选中案卷封面,包含2则选中卷内目录,包含3则选中脊背,包含4则选中备考表
  104. config.value = res.data
  105. dirType.value = res.data['dirType'] || 0//目录类型
  106. indexType.value = res.data['indexType'] || 0//流水号类型
  107. indexNum.value = res.data['indexNum'] || 0//虚位树
  108. if (config.value.projectType == 1 || config.value.projectType == 2) {
  109. projectTypeList.value = [config.value.projectType]
  110. } else if (config.value.projectType == 3) {
  111. projectTypeList.value = [1, 2]
  112. } else if (config.value.projectType == 0) {
  113. projectTypeList.value = []
  114. }
  115. factorTypeList.value = config.value.factorType.split(',')
  116. }
  117. }
  118. const uploadModalClick = async () => {
  119. let factorType = ''
  120. let projectType = 0
  121. if (projectTypeList.value.length == 1) {
  122. projectType = projectTypeList.value[0]
  123. } else if (projectTypeList.value.length > 1) {
  124. projectType = 3
  125. }
  126. factorType = factorTypeList.value.join(',')
  127. const { code, res } = await archiveConfigApi.updateConfig({
  128. id: config.value.id,
  129. projectId: projectId.value,
  130. factorType: factorType,
  131. projectType: projectType,
  132. dirType: dirType.value,
  133. indexType: indexType.value,
  134. indexNum: indexNum.value,
  135. })
  136. if (code == 200) {
  137. window.$message?.success('修改成功')
  138. }
  139. }
  140. //左右拖动,改变树形结构宽度
  141. const leftWidth = ref(382)
  142. const onmousedown = () => {
  143. const leftNum = isCollapse.value ? 142 : 272
  144. document.onmousemove = (ve) => {
  145. let diffVal = ve.clientX - leftNum
  146. if (diffVal >= 310 && diffVal <= 900) {
  147. leftWidth.value = diffVal
  148. }
  149. }
  150. document.onmouseup = () => {
  151. document.onmousemove = null
  152. document.onmouseup = null
  153. }
  154. }
  155. //保存
  156. const saveClick = () => {
  157. console.log('保存')
  158. }
  159. </script>
  160. <style lang="scss" scoped>
  161. @import '~style/custody/scoped/backup.scss';
  162. .hc-card-header-table-title {
  163. font-size: 1.125rem;
  164. line-height: 1.75rem;
  165. }
  166. .hc-card-header-tree-checkbox {
  167. margin-top: 30px;
  168. text-align: center;
  169. }
  170. .hc-page-content-box-list {
  171. width: 100%;
  172. height: 300px;
  173. border: rgb(187, 187, 187) solid 1px;
  174. margin-bottom: 30px;
  175. .hc-page-content-box-list-title {
  176. margin-top: 30px;
  177. padding-left: 30px;
  178. margin-bottom: 30px;
  179. font-size: 20px;
  180. color: rgba(52, 54, 57, 0.5);
  181. }
  182. }
  183. </style>