| | |
| | | * @Author: lzhe lzhe@example.com |
| | | * @Date: 2024-03-26 10:28:33 |
| | | * @LastEditors: lzhe lzhe@example.com |
| | | * @LastEditTime: 2024-05-13 11:39:54 |
| | | * @LastEditTime: 2024-05-29 15:24:20 |
| | | * @FilePath: /smart-web/src/views/master/person/main/index.vue |
| | | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |
| | | --> |
| | | <template> |
| | | <div class="aposcope-main"> |
| | | <div class="title">计划字段</div> |
| | | <div class="title">{{$route.query.type == 1?"计划":"产品"}}字段</div> |
| | | <el-button type="primary" @click="addField" style="margin: 4px 0px 10px;">添加自定义字段</el-button> |
| | | <div class="field-table"> |
| | | <el-table ref="multipleTableRef" :data="tableData" border style="width: 100%" class="multipleTableRef"> |
| | |
| | | <el-table-column fixed="right" label="操作"> |
| | | <template #default="scope"> |
| | | <el-button type="text" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button> |
| | | <el-button text type="primary" size="small" @click="table_del(scope.row, scope.$index)">删除</el-button> |
| | | <el-button text type="primary" :disabled="scope.row.systemFieldLabel == '是'?true: false" size="small" @click="table_del(scope.row, scope.$index)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | }, |
| | | methods: { |
| | | addFieldSuccess() { |
| | | |
| | | this.getTableData(); |
| | | }, |
| | | addField() { |
| | | this.dialog.save = true |
| | | this.dialog.save = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.saveDialog.open() |
| | | }) |
| | | }, |
| | | table_edit() { |
| | | |
| | | table_edit(row) { |
| | | this.dialog.save = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.saveDialog.open('edit').setData(row); |
| | | }) |
| | | }, |
| | | table_del() { |
| | | |
| | | table_del(row) { |
| | | this.$HTTP.delete(`/api/blade-system/custom-template-field/remove`,[row.id]).then(res=> { |
| | | if(res.code == 200) { |
| | | this.$message.success("操作成功"); |
| | | this.getTableData(); |
| | | } |
| | | }) |
| | | }, |
| | | getTableData() { |
| | | this.$HTTP.get(`/api/blade-system/custom-template-field/list?businessType=1`).then(res=> { |
| | | this.$HTTP.get(`/api/blade-system/custom-template-field/list?businessType=${this.$route.query.type}`).then(res=> { |
| | | if(res.code == 200) { |
| | | this.tableData = res.data; |
| | | } |