qinxianzhangyao
2023-12-07 7f95ba9ac493c69d7bf913d7b925c087fb3a0490
src/views/hosp/history/index.vue
@@ -255,12 +255,12 @@
                      <el-input size="mini" v-model="scope.row.workType" placeholder="请输入工种" />
                    </template>
                  </el-table-column>
                  <el-table-column label="有害因素" prop="workLogs">
                  <el-table-column label="有害因素" prop="harmTypeLogs">
                    <template slot-scope="scope">
                      <!-- <el-input v-model="scope.row.isOk" placeholder="请输入是否痊愈" /> -->
                      <el-select filterable size="mini" v-model="scope.row.workLogs" placeholder="请选择有害因素" clearable>
                        <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label"
                          :value="dict.value" />
                      <el-select filterable size="mini" v-model="scope.row.harmTypeLogs" multiple placeholder="请选择有害因素" clearable>
                        <el-option v-for="dict in harmTypeList" :key="dict.aid" :label="dict.harmtype"
                          :value="dict.aid" />
                      </el-select>
                    </template>
                  </el-table-column>
@@ -293,13 +293,16 @@
} from "@/api/hosp/history";
import { Message } from "element-ui";
import { getOrderList } from "@/api/hosp/order";
import {
  listHarmType,
} from "@/api/hosp/harmType";
export default {
  name: "History",
  dicts: ["tj_smoking_pinlv", "sys_yes_no", "tj_work_status", "tj_work", "dict_ageunit", "dict_job"],
  data() {
    return {
      selectList: [],
      dataList:[],
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now();
@@ -362,6 +365,7 @@
        pageSize: 20,
        cusName: null,
      },
      harmTypeList:[],
      // 表单参数
      form: {},
      chageall: [],
@@ -401,6 +405,10 @@
    /** 查询体检记录列表 */
    getList() {
      this.loading = true;
      listHarmType().then(response => {
        this.harmTypeList = response.rows;
        this.loading = false;
      });
      getOrderList(this.queryParams).then((response) => {
        this.orderList = response.data.list;
        if (this.orderList) {
@@ -417,7 +425,9 @@
                  this.orderList[0],
                  true
                );
              });
              this.dataList =  this.orderList[0]
            } else {
              this.$refs.multipleTable.clearSelection();
            }
@@ -480,6 +490,7 @@
    },
    // 单选框选中数据
    handleSelectionChange(selection) {
      this.dataList = []
      this.selectList = selection;
      // this.ids = selection.map((item) => item.askId);
      // this.single = selection.length !== 1;
@@ -501,8 +512,8 @@
          this.sex = false;
        }
      })
      let userId = selection.map((item) => item.userId);
      getInfoById(userId).then((response) => {
      let tjNumber = selection.map((item) => item.tjNumber);
      getInfoById(tjNumber).then((response) => {
        this.form = response.data;
        if (this.form.xiyan == null) {
          this.form.xiyan = "1"
@@ -570,18 +581,18 @@
    },
    delemembers() {
      this.form.tjAskHistorysList.forEach((item, index) => {
        this.bingshiall.forEach((item1, index1) => {
          if (item.id == item1.id) {
            if (this.bingshiall.length == 1) {
              this.form.tjAskHistorysList.splice(index, 1)
            } else {
              this.form.tjAskHistorysList.splice(index, index1)
      let that = this
      if (that.form.tjAskHistorysList.length == that.bingshiall.length) {
        that.form.tjAskHistorysList = []
      } else {
        that.bingshiall.forEach((item1, index1) => {
          that.form.tjAskHistorysList.forEach((item, index) => {
            if (item == item1) {
              that.form.tjAskHistorysList.splice(index, 1)
            }
          }
          })
        })
      })
      }
    },
@@ -590,30 +601,29 @@
        if (!this.form.workLogs) {
          this.form.workLogs = [];
          this.form.workLogs.push({
            id: parseInt(this.form.workLogs.length + 1),
            id: parseInt(length),
            beginTime: "",
            endTime: "",
            workCompany: "",
            workDept: "",
            workType: "",
            workLogs: "",
            harmTypeLogs: "",
            fangHu: "",
            Selection,
          });
        } else {
          this.form.workLogs.push({
            id: parseInt(this.form.workLogs.length + 1),
            id: parseInt(length),
            beginTime: "",
            endTime: "",
            workCompany: "",
            workDept: "",
            workType: "",
            workLogs: "",
            harmTypeLogs: "",
            fangHu: "",
            Selection,
          });
        }
        console.log(that.form.workLogs)
      } else {
        Message.warning("请先填写客户名");
      }
@@ -628,15 +638,12 @@
    delememberss() {
      let that = this
      console.log(that.chageall)
      if (that.form.workLogs.length == that.chageall.length) {
        that.form.workLogs = []
      } else {
        that.chageall.forEach((item1, index1) => {
          that.form.workLogs.forEach((item, index) => {
            if (item.id == item1.id) {
              console.log(111111)
            if (item == item1) {
              that.form.workLogs.splice(index, 1)
            }
          })
@@ -646,6 +653,7 @@
    },
    /** 提交按钮 */
    submitForm() {
      this.form.tjNum = this.dataList[0].tjNumber
      updateHistory(this.form).then((response) => {
        this.$modal.msgSuccess("修改成功");
      });