阅行客电子档案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

292 lines
9.6 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div>
  3. <!-- 批量成件 -->
  4. <el-dialog class="batch-form" append-to-body :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible="batchVisible" title="批量成件">
  5. <span class="dialog-right-top" />
  6. <span class="dialog-left-bottom" />
  7. <div class="setting-dialog">
  8. <el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="130px">
  9. <el-form-item label="对应规则" prop="rules">
  10. <el-select v-model="form.ruleName" placeholder="请选择" style="width: 225px;" @change="selectRules">
  11. <el-option
  12. v-for="item in rulesOptions"
  13. :key="item.value"
  14. :label="item.label"
  15. :value="item.value"
  16. />
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item label="归档范围" prop="scope">
  20. <el-input v-model="form.scope" type="text" readonly>
  21. <i slot="suffix" class="el-input__icon iconfont icon-sousuo" @click="selectScope" />
  22. </el-input>
  23. </el-form-item>
  24. <el-form-item label="源分类" prop="documentName">
  25. <el-input v-model="form.documentName" type="text" disabled />
  26. </el-form-item>
  27. <el-form-item label="目标门类" prop="categoryId">
  28. <treeselect
  29. v-model="form.categoryId"
  30. :options="categoryTree"
  31. flat
  32. :multiple="false"
  33. :normalizer="normalizer"
  34. placeholder="请选择目标门类(整理库/管理库门类)"
  35. @select="handleSelectCategory"
  36. />
  37. </el-form-item>
  38. </el-form>
  39. <div class="corres-field-main">
  40. <div class="corres-field-list corres-field-left">
  41. <div class="corres-field-title">
  42. <p>字段取值</p>
  43. </div>
  44. <div class="field-list">
  45. <div v-for="(item, index) in selectStatus" :key="index" class="field-item">
  46. <el-select :key="index" v-model="item.fiedType">
  47. <el-option
  48. v-for="v in fiedOption"
  49. :key="v.value"
  50. :label="v.label"
  51. :value="v.value"
  52. />
  53. </el-select>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="corres-field-list corres-field-middle">
  58. <div class="corres-field-title">
  59. <p>源分类文件库-文件表</p>
  60. <span>{{ form.documentName }}</span>
  61. </div>
  62. <div class="field-list">
  63. <div v-for="(item, index) in selectStatus" :key="index" class="field-item">
  64. <el-select v-if="item.mode" :key="index" v-model="item.value" @change="selectChange(index)">
  65. <el-option value="">请选择</el-option>
  66. <el-option
  67. v-for="v in options"
  68. :key="v.id"
  69. :label="v.fieldCnName"
  70. :value="v.fieldCnName"
  71. />
  72. </el-select>
  73. <p v-if="!item.mode" @click="textMode(index)">
  74. {{ item.value }}
  75. </p>
  76. <div v-if="!item.mode" class="field-state"><span :class="item.isDisplay ? 'is-select' : 'is-hide'">{{ item.isDisplay ? '显示': '隐藏' }}</span></div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="corres-field-list corres-field-right">
  81. <div class="corres-field-title">
  82. <p>目标门类整理库/管理库-文件表</p>
  83. <span>{{ selectedCategoryName }}</span>
  84. </div>
  85. <div class="field-list">
  86. <div v-for="(item,index) in targetData" :key="index" class="field-item">
  87. <p>{{ item.fieldCnName }}</p>
  88. <div class="field-state"><span :class=" item.isDisplay ? 'is-select' : 'is-hide'">{{ item.isDisplay ? '显示': '隐藏' }}</span></div>
  89. </div>
  90. </div>
  91. </div>
  92. <div v-if="selectStatus.length === 0" class="empty-data" />
  93. </div>
  94. <div slot="footer" class="dialog-footer">
  95. <el-button type="text" @click="batchVisible = false">取消</el-button>
  96. <el-button type="primary" @click="batchVisible = false">确定</el-button>
  97. </div>
  98. </div>
  99. </el-dialog>
  100. <ScopeModule ref="scopeModule" @getScope="hanleScopeSelect" />
  101. </div>
  102. </template>
  103. <script>
  104. import { FetchInitFieldMateList, FetchInitFieldMate } from '@/api/system/fieldMate'
  105. import { FetchDocumentMenu } from '@/api/system/fileLibrary/fileLibrary'
  106. import { FetchCategoryMenu } from '@/api/system/category/category'
  107. import Treeselect from '@riophae/vue-treeselect'
  108. import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  109. // import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
  110. import fieldData from './data.json'
  111. import ScopeModule from './scope'
  112. export default {
  113. name: 'BatchFile',
  114. components: { Treeselect, ScopeModule },
  115. data() {
  116. return {
  117. batchVisible: false,
  118. rulesOptions: [],
  119. categoryTree: [],
  120. form: {
  121. ruleName: null,
  122. scope: null,
  123. documentId: null,
  124. documentName: '',
  125. categoryId: null
  126. },
  127. selectedCategoryName: null,
  128. scopeVisible: false,
  129. loadSource: [],
  130. rules: {
  131. categoryId: [
  132. { required: true, message: '请选择档案门类', trigger: 'change' }
  133. ]
  134. },
  135. fiedOption: [],
  136. fiedType: null,
  137. selectStatus: [],
  138. selectOptions: [],
  139. targetData: [],
  140. leftLoading: false,
  141. rightLoading: false
  142. }
  143. },
  144. created() {
  145. this.getInitFieldMateList()
  146. this.getCategoryDataTree()
  147. this.getDocumentDataTree()
  148. },
  149. mounted() {
  150. },
  151. methods: {
  152. // 对应规则
  153. getInitFieldMateList() {
  154. FetchInitFieldMateList().then(res => {
  155. this.rulesOptions = res.content.map(item => {
  156. const json = {}
  157. json.label = item.rule_name
  158. json.value = item.id
  159. return json
  160. })
  161. })
  162. },
  163. getInitDetail(id) {
  164. FetchInitFieldMate({ 'id': id }).then((res) => {
  165. console.log(res)
  166. this.form.documentName = res.documentName
  167. this.selectedCategoryName = res.categoryName
  168. this.form.categoryId = res.fieldMateDetails[0].pid.categoryId.pid
  169. }).catch(err => {
  170. console.log(err)
  171. })
  172. },
  173. selectRules(val) {
  174. this.getInitDetail(val)
  175. this.selectStatus = []
  176. this.targetData = fieldData
  177. // this.targetData.forEach((item, index) => {
  178. // this.selectStatus.push({ mode: true, value: '' })
  179. // })
  180. },
  181. filterData(data) {
  182. return data.filter(node => {
  183. if (node.children && node.children.length > 0) {
  184. node.children = this.filterData(node.children) // 递归处理子节点
  185. }
  186. return node.isType !== 3 // 过滤掉isType为3的节点
  187. })
  188. },
  189. // 目标门类
  190. getCategoryDataTree() {
  191. FetchCategoryMenu().then(res => {
  192. this.categoryTree = this.filterData(res)
  193. })
  194. },
  195. getDocumentDataTree() {
  196. FetchDocumentMenu().then(res => {
  197. this.documentTree = this.filterData(res)
  198. })
  199. },
  200. handleSelectCategory(val) {
  201. this.selectedCategoryName = val.cnName
  202. },
  203. // 归档范围选择
  204. selectScope() {
  205. this.$refs.scopeModule.scopeVisible = true
  206. },
  207. hanleScopeSelect(val) {
  208. if (val.length !== 0) {
  209. this.form.scope = val[0].scopeName
  210. console.log('val', val)
  211. }
  212. },
  213. selectChange(index) {
  214. this.options.forEach((item) => {
  215. if (item.fieldCnName === this.selectStatus[index].value) {
  216. this.selectStatus.splice(index, 1, { mode: false, value: this.selectStatus[index].value, field: item, isDisplay: item.isDisplay })
  217. }
  218. })
  219. },
  220. textMode(index) {
  221. this.selectStatus.splice(index, 1, { mode: true, value: this.selectStatus[index].value, field: null, isDisplay: this.selectStatus[index].isDisplay })
  222. },
  223. handleClose(done) {
  224. this.batchVisible = false
  225. done()
  226. },
  227. normalizer(node) {
  228. if (node.children && !node.children.length) {
  229. delete node.children
  230. }
  231. return {
  232. id: node.id,
  233. label: node.cnName,
  234. children: node.children,
  235. isDisabled: node.isType !== 2
  236. }
  237. }
  238. }
  239. }
  240. </script>
  241. <style lang="scss" scoped>
  242. @import "~@/assets/styles/prearchive-library.scss";
  243. .batch-form{
  244. ::v-deep .el-dialog{
  245. width: 828px !important;
  246. }
  247. .corres-field-left{
  248. width: 146px;
  249. .corres-field-title{
  250. p{
  251. padding-top: 0 !important;
  252. line-height: 60px;
  253. }
  254. }
  255. .field-list{
  256. .field-item{
  257. width: 146px;
  258. ::v-deep .el-select{
  259. width: 145px !important;
  260. border-right: none;
  261. }
  262. }
  263. }
  264. }
  265. .corres-field-middle{
  266. .field-list{
  267. .field-item{
  268. width: 315px;
  269. ::v-deep .el-select{
  270. width: 314px !important;
  271. border-right: none;
  272. }
  273. }
  274. }
  275. }
  276. }
  277. .corres-field-main{
  278. position: relative;
  279. }
  280. .empty-data{
  281. position: absolute;
  282. top: 60px;
  283. left: 0;
  284. width: 100%;
  285. height: calc(100% - 60px);
  286. background: url('~@/assets/images/system/zwsj.png') no-repeat center center #fff;
  287. background-size: 282px 182px;
  288. }
  289. </style>