Browse Source

病历目录

yuwandanmian 1 year ago
parent
commit
6cfd6bdf95

+ 139 - 0
src/views/dict/blml/components/CreateDialog.vue

@@ -0,0 +1,139 @@
+<template>
+  <el-dialog
+    :title="titleStr"
+    :visible.sync="data.bSwitch"
+    width="30%"
+  >
+    <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px" class="demo-ruleForm">
+      <el-form-item label="手术2.0代码" prop="ssbm">
+        <el-input v-model="ruleForm.ssbm" placeholder="请输入" />
+      </el-form-item>
+      <el-form-item label="手术2.0名称" prop="ssmc">
+        <el-input v-model="ruleForm.ssmc" placeholder="请输入" />
+      </el-form-item>
+      <el-form-item label="手术3.0代码" prop="ssysbm">
+        <el-input v-model="ruleForm.ssysbm" placeholder="请输入" />
+      </el-form-item>
+      <el-form-item label="手术3.0名称" prop="ssysmc">
+        <el-input v-model="ruleForm.ssysmc" placeholder="请输入" />
+      </el-form-item>
+      <el-form-item label="手术内码" prop="ssnm">
+        <el-input v-model="ruleForm.ssnm" placeholder="请输入" />
+      </el-form-item>
+      <el-form-item label="操作类型" prop="sslb">
+        <el-select v-model="ruleForm.sslb" filterable clearable placeholder="请选择">
+          <el-option label="介入治疗" value="介入治疗" />
+          <el-option label="手术" value="手术" />
+          <el-option label="治疗性操作" value="治疗性操作" />
+          <el-option label="诊断性操作" value="诊断性操作" />
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="data.bSwitch = false">取 消</el-button>
+      <el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { ssczysAdd, ssczysSave } from '@/api/dict'
+export default {
+  props: {
+    data: {
+      type: Object,
+      default() {
+        return {
+          bSwitch: false,
+          row: {}
+        }
+      }
+    }
+  },
+  data() {
+    return {
+      ruleForm: {
+        ssbm: '',
+        ssmc: '',
+        ssysbm: '',
+        ssysmc: '',
+        sslb: '',
+        ssnm: ''
+      },
+      rules: {
+        ssbm: [
+          { required: true, message: '请输入', trigger: 'blur' }
+        ],
+        ssmc: [
+          { required: true, message: '请输入', trigger: 'blur' }
+        ],
+        ssysbm: [
+          { required: true, message: '请输入', trigger: 'blur' }
+        ],
+        ssysmc: [
+          { required: true, message: '请输入', trigger: 'blur' }
+        ],
+        sslb: [
+          { required: true, message: '请选择', trigger: 'blur' }
+        ],
+        ssnm: [
+          { required: true, message: '请输入', trigger: 'blur' }
+        ]
+      }
+    }
+  },
+  computed: {
+    titleStr() {
+      return this.data.row.id ? '编辑' : '新增'
+    }
+  },
+  created() {
+    if (this.data.row.id) {
+      const {
+        SSBM,
+        SSMC,
+        SSYSBM,
+        SSYSMC,
+        SSLB,
+        SSNM,
+        id } = this.data.row
+      this.ruleForm.ssbm = SSBM
+      this.ruleForm.ssmc = SSMC
+      this.ruleForm.ssysbm = SSYSBM
+      this.ruleForm.id = id
+      this.ruleForm.ssysmc = SSYSMC
+      this.ruleForm.sslb = SSLB
+      this.ruleForm.ssnm = SSNM
+    }
+  },
+  methods: {
+    submitForm(formName) {
+      this.$refs[formName].validate(async(valid) => {
+        if (valid) {
+          if (this.ruleForm.id) {
+            ssczysSave(this.ruleForm).then(res => {
+              this.data.bSwitch = false
+              this.$emit('refresh')
+              this.$message.success(res.m || '操作成功')
+            })
+          } else {
+            ssczysAdd(this.ruleForm).then(res => {
+              this.data.bSwitch = false
+              this.$emit('refresh')
+              this.$message.success(res.m || '操作成功')
+            })
+          }
+        } else {
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.demo-ruleForm {
+  width: 80%;
+}
+</style>

+ 46 - 0
src/views/dict/blml/components/SearchBox.vue

@@ -0,0 +1,46 @@
+<template>
+  <div class="app-container">
+    <el-form :inline="true" :model="data" class="demo-form-inline">
+      <el-form-item label="">
+        <el-select v-model="data.sslb" filterable clearable placeholder="操作类型">
+          <el-option label="介入治疗" value="介入治疗" />
+          <el-option label="手术" value="手术" />
+          <el-option label="治疗性操作" value="治疗性操作" />
+          <el-option label="诊断性操作" value="诊断性操作" />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" @click="onSubmit">查询</el-button>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    data: {
+      type: Object,
+      default() {
+        return {
+          ssbm: '',
+          ssmc: '',
+          ssysbm: '',
+          ssysmc: '',
+          sslb: '',
+          ssnm: ''
+        }
+      }
+    }
+  },
+  methods: {
+    onSubmit() {
+      this.$emit('search')
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 123 - 0
src/views/dict/blml/components/TableBox.vue

@@ -0,0 +1,123 @@
+<template>
+  <div>
+    <div class="btn-box">
+      <el-button type="primary" icon="el-icon-plus" @click="onCreate">新增</el-button>
+    </div>
+    <el-table
+      v-loading="loading"
+      :data="data"
+      border
+      style="width: 100%"
+    >
+      <el-table-column
+        type="index"
+        label="序号"
+        width="80"
+        fixed="left"
+        align="center"
+      />
+      <el-table-column
+        prop=""
+        label="数据库表"
+        align="center"
+      />
+      <el-table-column
+        prop="SSNM"
+        label="数据库表名称"
+        align="center"
+      />
+      <el-table-column
+        prop="SSLB"
+        label="数据字段"
+        align="center"
+      />
+      <el-table-column
+        prop="SSLB"
+        label="字段含义"
+        align="center"
+      />
+      <el-table-column
+        prop="SSLB"
+        label="数据字典"
+        align="center"
+      />
+      <el-table-column
+        prop="SSLB"
+        label="状态"
+        align="center"
+      />
+      <el-table-column
+        prop="SSLB"
+        label="备注"
+        align="center"
+      />
+      <el-table-column
+        prop=""
+        label="操作"
+        align="center"
+        fixed="right"
+      >
+        <template slot-scope="scope">
+          <el-button type="text" @click="onEdit(scope.row)">修改</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 新增、编辑 -->
+    <CreateDialog v-if="createData.bSwitch" :data="createData" @refresh="handleRefresh" />
+  </div>
+</template>
+
+<script>
+import CreateDialog from './CreateDialog.vue'
+
+export default {
+  components: {
+    CreateDialog
+  },
+  props: {
+    data: {
+      type: Array,
+      default() {
+        return []
+      }
+    },
+    loading: {
+      type: Boolean,
+      default() {
+        return false
+      }
+    }
+  },
+  data() {
+    return {
+      createData: {
+        bSwitch: false,
+        row: {}
+      }
+    }
+  },
+  methods: {
+    onCreate() {
+      this.createData.row = {}
+      this.createData.bSwitch = true
+    },
+    onEdit(row) {
+      this.createData.row = row
+      this.createData.bSwitch = true
+    },
+    handleRefresh() {
+      this.$emit('refresh')
+    },
+    onExport() {
+      this.$emit('export')
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.btn-box {
+  text-align: right;
+  margin-bottom: 15px;
+}
+</style>

+ 79 - 4
src/views/dict/blml/index.vue

@@ -1,15 +1,90 @@
 <template>
-  <div>
-    病历目录
+  <div class="app-container">
+    <SearchBoxVue :data="searchData" @search="handleSearch" />
+    <TableBoxVue :loading="loading" :data="tableData" style="margin-top: -40px;" @refresh="handleRefresh" />
+    <pagination
+      :auto-scroll="false"
+      :total="paginationData.total"
+      :page="paginationData.page"
+      :limit="paginationData.limit"
+      @pagination="handlePagination"
+    />
   </div>
 </template>
 
 <script>
-export default {
+import SearchBoxVue from './components/SearchBox.vue'
+import TableBoxVue from './components/TableBox.vue'
+import { getSsczysList } from '@/api/dict'
 
+export default {
+  components: {
+    SearchBoxVue,
+    TableBoxVue
+  },
+  data() {
+    return {
+      loading: false,
+      searchData: {
+        ssbm: '',
+        ssmc: '',
+        ssysbm: '',
+        ssysmc: '',
+        sslb: '',
+        ssnm: ''
+      },
+      tableData: [],
+      paginationData: {
+        total: 0,
+        page: 1,
+        limit: 10
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    handleRefresh() {
+      this.getList()
+    },
+    async getList() {
+      const { ssbm, ssmc, ssysbm, ssysmc, sslb, ssnm } = this.searchData
+      const { page, limit } = this.paginationData
+      const params = {
+        ssbm,
+        ssmc,
+        ssysbm,
+        ssysmc,
+        sslb,
+        ssnm,
+        page,
+        page_size: limit
+      }
+      this.loading = true
+      getSsczysList(params).then(res => {
+        const { p } = res
+        this.paginationData.total = p.count
+        this.tableData = p.list
+      }).catch(error => {
+        console.log(error)
+      }).finally(() => {
+        this.loading = false
+      })
+    },
+    handlePagination(param) {
+      this.paginationData.page = param.page
+      this.paginationData.limit = param.limit
+      this.getList()
+    },
+    handleSearch() {
+      this.paginationData.page = 1
+      this.getList()
+    }
+  }
 }
 </script>
 
-<style lang="sass" scoped>
+<style lang="scss" scoped>
 
 </style>