Преглед изворни кода

销售端-手写初诊单,手写信息采集增删改页面

cgp пре 3 недеља
родитељ
комит
3226e26979

+ 44 - 0
src/api/member/handwriteCollection/handwriteCollection.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询列表
+export function listCollection(query) {
+  return request({
+    url: '/handwrite/collection/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询详细
+export function getCollection(id) {
+  return request({
+    url: '/handwrite/collection/' + id,
+    method: 'get'
+  })
+}
+
+// 新增
+export function addCollection(data) {
+  return request({
+    url: '/handwrite/collection',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改
+export function updateCollection(data) {
+  return request({
+    url: '/handwrite/collection',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除
+export function delCollection(ids) {
+  return request({
+    url: '/handwrite/collection/' + ids,
+    method: 'delete'
+  })
+}

+ 44 - 0
src/api/member/handwritePatientForm/handwritePatientForm.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询列表
+export function listPatientForm(query) {
+  return request({
+    url: '/handwrite/patientForm/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询详细
+export function getPatientForm(id) {
+  return request({
+    url: '/handwrite/patientForm/' + id,
+    method: 'get'
+  })
+}
+
+// 新增
+export function addPatientForm(data) {
+  return request({
+    url: '/handwrite/patientForm',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改
+export function updatePatientForm(data) {
+  return request({
+    url: '/handwrite/patientForm',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除
+export function delPatientForm(ids) {
+  return request({
+    url: '/handwrite/patientForm/' + ids,
+    method: 'delete'
+  })
+}

+ 218 - 0
src/views/member/handwriteCollection/index.vue

@@ -0,0 +1,218 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
+      <el-form-item label="患者姓名" prop="patientName">
+        <el-input v-model="queryParams.patientName" placeholder="请输入患者姓名" clearable size="small" @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="患者电话" prop="patientPhone">
+        <el-input v-model="queryParams.patientPhone" placeholder="请输入患者电话" clearable size="small" @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="订单号" prop="orderCode">
+        <el-input v-model="queryParams.orderCode" placeholder="请输入订单号" clearable size="small" @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate">修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
+    </el-row>
+
+    <el-table v-loading="loading" :data="collectionList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="患者姓名" align="center" prop="patientName" />
+      <el-table-column label="患者电话" align="center" prop="patientPhone" />
+      <el-table-column label="手写信息采集表" align="center" prop="billImgUrl" width="120">
+        <template slot-scope="scope">
+          <image-preview v-if="scope.row.billImgUrl" :src="scope.row.billImgUrl" width="50" height="50" />
+          <span v-else>暂无图片</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="订单号" align="center" prop="orderCode" />
+      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
+          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
+
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="订单号" prop="orderCode">
+          <el-input v-model="form.orderCode" placeholder="请输入订单号" />
+        </el-form-item>
+        <el-form-item label="患者姓名" prop="patientName">
+          <el-input v-model="form.patientName" placeholder="请输入患者姓名" />
+        </el-form-item>
+        <el-form-item label="患者电话" prop="patientPhone">
+          <el-input v-model="form.patientPhone" placeholder="请输入患者电话" />
+        </el-form-item>
+        <el-form-item label="手写信息采集表" prop="billImgUrl">
+          <image-upload v-model="form.billImgUrl" :limit="1" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listCollection, getCollection, addCollection, updateCollection, delCollection } from "@/api/member/handwriteCollection/handwriteCollection";
+import ImageUpload from "@/components/ImageUpload";
+
+export default {
+  name: "HandwriteCollection",
+  components: { ImageUpload },
+  data() {
+    return {
+      loading: true,
+      showSearch: true,
+      total: 0,
+      collectionList: [],
+      title: "",
+      open: false,
+      ids: [],
+      single: true,
+      multiple: true,
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        patientName: null,
+        patientPhone: null,
+        orderCode: null
+      },
+      form: {},
+      rules: {
+        patientName: [
+          { required: true, message: "患者姓名不能为空", trigger: "blur" }
+        ],
+        patientPhone: [
+          { required: true, message: "患者电话不能为空", trigger: "blur" },
+          { pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号码", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    getList() {
+      this.loading = true;
+      listCollection(this.queryParams).then(response => {
+        this.collectionList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    resetQuery() {
+      this.$refs.queryForm.resetFields();
+      this.handleQuery();
+    },
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加手写信息采集表";
+    },
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids[0];
+      getCollection(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改手写信息采集表";
+      });
+    },
+    submitForm() {
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateCollection(this.form).then(() => {
+              this.$message.success("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addCollection(this.form).then(() => {
+              this.$message.success("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    handleDelete(row) {
+      const ids = row.id || this.ids.join(",");
+      this.$confirm('是否确认删除选中的数据项?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        return delCollection(ids);
+      }).then(() => {
+        this.getList();
+        this.$message.success("删除成功");
+      }).catch(() => {});
+    },
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
+    reset() {
+      this.form = {
+        id: null,
+        patientName: null,
+        patientPhone: null,
+        billImgUrl: null,
+        orderCode: null
+      };
+      if (this.$refs.form) {
+        this.$refs.form.resetFields();
+      }
+    },
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    parseTime(time) {
+      if (!time) return '';
+      const date = new Date(time);
+      const year = date.getFullYear();
+      const month = (date.getMonth() + 1).toString().padStart(2, '0');
+      const day = date.getDate().toString().padStart(2, '0');
+      const hour = date.getHours().toString().padStart(2, '0');
+      const minute = date.getMinutes().toString().padStart(2, '0');
+      const second = date.getSeconds().toString().padStart(2, '0');
+      return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
+    }
+  }
+};
+</script>

+ 210 - 0
src/views/member/handwritePatientForm/index.vue

@@ -0,0 +1,210 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
+      <el-form-item label="患者姓名" prop="patientName">
+        <el-input v-model="queryParams.patientName" placeholder="请输入患者姓名" clearable size="small" @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="患者电话" prop="patientPhone">
+        <el-input v-model="queryParams.patientPhone" placeholder="请输入患者电话" clearable size="small" @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate">修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
+    </el-row>
+
+    <el-table v-loading="loading" :data="patientFormList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="患者姓名" align="center" prop="patientName" />
+      <el-table-column label="患者电话" align="center" prop="patientPhone" />
+      <el-table-column label="初诊单" align="center" prop="billImgUrl" width="120">
+        <template slot-scope="scope">
+          <image-preview v-if="scope.row.billImgUrl" :src="scope.row.billImgUrl" width="50" height="50" />
+          <span v-else>暂无图片</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
+          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
+
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="患者姓名" prop="patientName">
+          <el-input v-model="form.patientName" placeholder="请输入患者姓名" />
+        </el-form-item>
+        <el-form-item label="患者电话" prop="patientPhone">
+          <el-input v-model="form.patientPhone" placeholder="请输入患者电话" />
+        </el-form-item>
+        <el-form-item label="初诊单" prop="billImgUrl">
+          <image-upload v-model="form.billImgUrl" :limit="1" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listPatientForm, getPatientForm, addPatientForm, updatePatientForm, delPatientForm } from "@/api/member/handwritePatientForm/handwritePatientForm";
+import ImageUpload from "@/components/ImageUpload";
+
+export default {
+  name: "HandwritePatientForm",
+  components: {ImageUpload},
+  data() {
+    return {
+      loading: true,
+      showSearch: true,
+      total: 0,
+      patientFormList: [],
+      title: "",
+      open: false,
+      ids: [],
+      single: true,
+      multiple: true,
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        patientName: null,
+        patientPhone: null
+      },
+      form: {},
+      rules: {
+        patientName: [
+          { required: true, message: "患者姓名不能为空", trigger: "blur" }
+        ],
+        patientPhone: [
+          { required: true, message: "患者电话不能为空", trigger: "blur" },
+          { pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号码", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    getList() {
+      this.loading = true;
+      listPatientForm(this.queryParams).then(response => {
+        this.patientFormList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    resetQuery() {
+      this.$refs.queryForm.resetFields();
+      this.handleQuery();
+    },
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加手写初诊单";
+    },
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids[0];
+      getPatientForm(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改手写初诊单";
+      });
+    },
+    submitForm() {
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updatePatientForm(this.form).then(() => {
+              this.$message.success("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addPatientForm(this.form).then(() => {
+              this.$message.success("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    handleDelete(row) {
+      const ids = row.id || this.ids.join(",");
+      this.$confirm('是否确认删除选中的数据项?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        return delPatientForm(ids);
+      }).then(() => {
+        this.getList();
+        this.$message.success("删除成功");
+      }).catch(() => {
+      });
+    },
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
+    reset() {
+      this.form = {
+        id: null,
+        patientName: null,
+        patientPhone: null,
+        billImgUrl: null
+      };
+      if (this.$refs.form) {
+        this.$refs.form.resetFields();
+      }
+    },
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    parseTime(time) {
+      if (!time) return '';
+      const date = new Date(time);
+      const year = date.getFullYear();
+      const month = (date.getMonth() + 1).toString().padStart(2, '0');
+      const day = date.getDate().toString().padStart(2, '0');
+      const hour = date.getHours().toString().padStart(2, '0');
+      const minute = date.getMinutes().toString().padStart(2, '0');
+      const second = date.getSeconds().toString().padStart(2, '0');
+      return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
+    }
+  }
+};
+</script>