123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <template>
- <div class="">
- <el-table
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- :data="dialysis_after_data"
- border
- fit
- highlight-current-row
- style="width: 100%;min-height:500px;"
- >
- <el-table-column align="center" label="字段名">
- <template slot-scope="scope">
- <span>{{ scope.row.filed_name_cn }}</span>
- </template>
- </el-table-column>
- <el-table-column align="center" label="字段">
- <template slot-scope="scope">
- <span>{{ scope.row.filed_name }}</span>
- </template>
- </el-table-column>
-
- <el-table-column align="center" label="是否显示">
- <template slot-scope="scope">
- <span v-if="scope.row.is_show == 1">是</span>
- <span v-if="scope.row.is_show == 2">否</span>
- </template>
- </el-table-column>
-
- <el-table-column align="center" label="是否必填">
- <template slot-scope="scope">
- <span v-if="scope.row.is_write!=undefined &&scope.row.is_write == 1">是</span>
- <span v-if="scope.row.is_write!=undefined &&scope.row.is_write == 0">否</span>
- </template>
- </el-table-column>
-
-
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.is_show == 1"
- size="small"
- type="danger"
- icon="el-icon-remove-outline"
- @click="handleHide(scope.$index, scope.row)"
- >
- </el-button>
-
- <el-button
- v-if="scope.row.is_show == 2"
- size="small"
- type="primary"
- icon="el-icon-view"
- @click="handleShow(scope.$index, scope.row)"
- >
- </el-button>
-
- <el-button
- v-if="scope.row.is_write!=undefined&&scope.row.is_write == 1"
- size="small"
- type="danger"
- icon="el-icon-remove-outline"
- @click="handleHideOne(scope.$index, scope.row)"
- >
- </el-button>
-
-
- <el-button
- v-if="scope.row.is_write!=undefined&&scope.row.is_write == 0"
- size="small"
- type="primary"
- icon="el-icon-view"
- @click="handleShowOne(scope.$index, scope.row)"
- >
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </template>
-
- <script>
- import { updateFieldIsShow } from "@/api/data";
- import store from "@/store";
-
- export default {
- name: "dialysisAfter",
-
- props: {
- dialysis_after_data: {
- type: Array
- }
- },
- methods: {
- handleHide: function(index, row) {
- this.$confirm("是否将该字段设为不可见?", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning"
- })
- .then(() => {
- updateFieldIsShow(row.id, 2,row.is_write).then(response => {
- if (response.data.state == 1) {
- let params = {
- id: response.data.data.id,
- is_show: response.data.data.is_show
- };
- store.dispatch("updateFiledConfigList", params).then(() => {});
- this.$emit("change", params);
- }
- });
- this.$message({
- type: "success",
- message: "设置成功!"
- });
- })
- .catch(() => {});
- },
- handleShow: function(index, row) {
- this.$confirm("是否将该字段设为可见?", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning"
- })
- .then(() => {
- updateFieldIsShow(row.id, 1,row.is_write).then(response => {
- if (response.data.state == 1) {
- let params = {
- id: response.data.data.id,
- is_show: response.data.data.is_show
- };
- store.dispatch("updateFiledConfigList", params).then(() => {});
- this.$emit("change", params);
- }
- });
- this.$message({
- type: "success",
- message: "设置成功!"
- });
- })
- .catch(() => {});
- },
-
- handleHideOne: function(index, row) {
- this.$confirm("是否将该字段设为不必填?", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning"
- }).then(() => {
- updateFieldIsShow(row.id,row.is_show,0).then(response => {
-
- if (response.data.state == 1) {
- this.is_write = response.data.data.is_write
- let params = {
- id: response.data.data.id,
- is_show: response.data.data.is_show,
- is_write:response.data.data.is_write,
- };
- store.dispatch("updateFiledConfigList", params).then(() => {});
- this.$emit("change", params);
- }
- });
- this.$message({
- type: "success",
- message: "设置成功!"
- });
- }).catch(() => {});
- },
-
- handleShowOne: function(index, row) {
- this.$confirm("是否将该字段设为必填?", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning"
- }).then(() => {
- updateFieldIsShow(row.id,row.is_show,1).then(response => {
- if (response.data.state == 1) {
- this.is_write = response.data.data.is_write
- let params = {
- id: response.data.data.id,
- is_show: response.data.data.is_show,
- is_write:response.data.data.is_write,
- };
- store.dispatch("updateFiledConfigList", params).then(() => {});
- this.$emit("change", params);
- }
- });
- this.$message({
- type: "success",
- message: "设置成功!"
- });
- }).catch(() => {});
- }
- }
- };
- </script>
-
- <style scoped></style>
- <style>
- .el-table td,
- .el-table th.is-leaf,
- .el-table--border,
- .el-table--group {
- border-color: #d0d3da;
- }
- .el-table--border::after,
- .el-table--group::after,
- .el-table::before {
- background-color: #d0d3da;
- }
- </style>
|