yz3456
2024-07-31 cd5df9d3ae0ad22cd658ad6472926f4c67346004
解决了家庭小医生的分享
4个文件已修改
108 ■■■■ 已修改文件
ruoyi-ui/src/api/marry/index.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/doctor/doctorInfo.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/doctor/index.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/marry/index.vue 90 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/api/marry/index.js
@@ -19,10 +19,11 @@
}
// 删除资产信息
export function delMarryOld(id) {
export function delMarryOld(query) {
  return request({
    url: '/marryUser/' + id,
    method: 'delete'
    url: '/marryUser',
    method: 'delete',
    params: query
  })
}
//修改前任信息
ruoyi-ui/src/views/doctor/doctorInfo.vue
@@ -37,12 +37,12 @@
        </el-input>
      </el-form-item>
      <el-form-item label="中医处方" prop="cmedical" label-width="68px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
        <el-input v-model="formData.cmedical" placeholder="请输入中医处方"  clearable :style="{width: '100%'}" :disabled="dsb" >
        <el-input v-model="formData.cmedical" placeholder="请输入中医处方"  clearable :style="{width: '100%'}" :disabled="dsb" type="textarea">
        </el-input>
      </el-form-item>
      <el-form-item label="西医处方" prop="wmedical" label-width="68px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
          <el-input v-if="!dsb" v-model="formData.wmedical" placeholder="请输入西医处方" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
          <el-input v-if="dsb" v-model="formData.wmedical" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
          <el-input v-if="!dsb" v-model="formData.wmedical" placeholder="请输入西医处方" clearable :style="{width: '100%'}" :disabled="dsb" type="textarea"></el-input>
          <el-input v-if="dsb" v-model="formData.wmedical" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb" type="textarea"></el-input>
      </el-form-item>
      <el-form-item label="备注" prop="remark" label-width="45px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">
        <el-input v-if="!dsb" v-model="formData.remark" placeholder="请输入备注" clearable :style="{width: '100%'}" :disabled="dsb" type="textarea"></el-input>
ruoyi-ui/src/views/doctor/index.vue
@@ -626,10 +626,6 @@
      queryParams1: {
        pageNum: 1,
        pageSize: 10,
        identity:undefined,
        nickName:undefined,
        sex:undefined,
        birth:undefined,
      },
      queryParams2: {
        pageNo: 1,
@@ -796,6 +792,7 @@
    // 关闭弹窗后
    handleClose(){
      this.user = ''
      this.queryParams2.pageNo = 1
    },
    handleClose2(){
      this.$refs.table1.clearSelection()
ruoyi-ui/src/views/marry/index.vue
@@ -295,8 +295,8 @@
              <template slot-scope="scope">
                <template v-if="!scope.row.isEdit">{{ scope.row.sex }}</template>
                <template v-else><el-select v-model="scope.row.sex" placeholder="请选择">
                  <el-option label="女" value="0"></el-option>
                  <el-option label="男" value="1"></el-option>
                 <el-option label="女" value='女'></el-option>
                  <el-option label="男" value='男'></el-option>
                </el-select></template>
              </template>
            </el-table-column>
@@ -340,11 +340,9 @@
                  <span v-if="scope.row.marryStatus== 1">初婚</span>
                  <span v-if="scope.row.marryStatus== 2">离婚</span>
                  <span v-if="scope.row.marryStatus== 3">再婚</span></template>
                <template v-else>  <el-select v-model="qianren" placeholder="请选择">
                  <el-option label="未婚" value="0"></el-option>
                  <el-option label="初婚" value="1"></el-option>
                  <el-option label="离婚" value="2"></el-option>
                  <el-option label="再婚" value="3"></el-option>
                <template v-else>  <el-select v-model="qianren" placeholder="请选择" @change="getMarryStatus">
                  <el-option v-for="item in qianrenOptions"
                    :key="item.value" :label="item.label" :value="item.value"/>
                </el-select></template>
              </template>
            </el-table-column>
@@ -546,6 +544,7 @@
  dicts: ['sys_normal_disable'],
  data() {
    return {
      qianren:undefined,
userId: undefined,
      showOldSpouse:false,//显示前任信息
      // 遮罩层
@@ -726,6 +725,27 @@
          value: '3',
          label: '再婚',
        },],
        qianrenOptions:[
          {
            value: '0',
            label: '未婚',
          },
            {
              value: '1',
              label: '初婚',
            },
            {
              value: '2',
              label: '离婚',
            },
            {
              value: '3',
              label: '再婚',
            }
        ],
    };
  },
  created() {
@@ -956,11 +976,12 @@
    },
    editRow(row) {
      if(this.oldSpouseList.marryStatus == 0)
      if(row.marryStatus == '0')
        this.qianren = '未婚'
      else if(this.oldSpouseList.marryStatus == 1)
      else if(row.marryStatus == '1')
        this.qianren = '初婚'
      else if(this.oldSpouseList.marryStatus == 2)
      else if(row.marryStatus == '2')
        this.qianren = '离婚'
      else
        this.qianren = '再婚'// this.isEdit=false
@@ -1012,21 +1033,47 @@
      // 刷新页面
      // window.location.reload();
    },
    getMarryStatus(value){
      // alert(value)
      if(value == '0')
        this.qianren = '未婚'
      else if(value == '1')
        this.qianren = '初婚'
      else if(value == '2')
        this.qianren = '离婚'
      else
        this.qianren = '再婚'// this.isEdit=false
    },
    //前任修改
    saveRowmarryList(row) {
      this.$refs['elForm'].validate(valid => {
        console.log(this.oldSpouseList)
        console.log(this.oldSpouseList,'oldSpouseListoldSpouseListoldSpouseListoldSpouseList')
        if (valid) {
          if(this.qianren == '未婚')
            row.marryStatus = 0
          else if(this.qianren == '初婚')
            row.marryStatus = 1
          else if(this.qianren == '离婚')
            row.marryStatus = 2
          else
            row.marryStatus = 3
          this.marryList.oldSpouseList =  this.oldSpouseList
          const foundIndex = this.oldSpouseList.findIndex(item => item.id === row.id);
          if (foundIndex !== -1) {
            this.marryList.oldSpouseList[foundIndex].marryStatus = Number(this.marryList.oldSpouseList[foundIndex].marryStatus)
            // alert(this.marryList.oldSpouseList[foundIndex].marryStatus)
            const updatedData = Object.assign({}, this.marryList.oldSpouseList[foundIndex], row);
            updateMarryOld(updatedData).then(response => {
              this.oldSpouseList = this.marryList.oldSpouseList
              this.$modal.msgSuccess("修改成功");
              console.log(updatedData)
              console.log(updatedData,'updatedDataupdatedDataupdatedData')
              console.log(response,'responseresponseresponseresponse')
              this.getList();
              // console.log(this.oldSpouseList)
            }).catch(error => {
@@ -1052,24 +1099,25 @@
    },
    /** 删除前任 */
    handleDelete(row) {
      console.log(this.oldSpouseList)
      // console.log(this.oldSpouseList,'123123123123')
      const id = row.id || this.oldSpouseList.id
      console.log(id)
      this.$modal.confirm('是否确认删除所选数据项?').then(function() {
        return delMarryOld({id});
      }).then(() => {
        this.oldSpouseList = this.oldSpouseList.filter(item => item.id !== id);
        this.marryList.oldSpouseList=this.oldSpouseList
        console.log(this.marryList.oldSpouseList)
        return delMarryOld(id);
      }).then((res) => {
        console.log(res)
        // this.oldSpouseList = this.oldSpouseList.filter(item => item.id !== id);
        // this.marryList.oldSpouseList=this.oldSpouseList
        // console.log(this.marryList.oldSpouseList,'oldSpouseListoldSpouseListoldSpouseList1')
        console.log(this.oldSpouseList)
        // console.log(this.oldSpouseList,'oldSpouseListoldSpouseListoldSpouseList2')
        this.$modal.msgSuccess("删除成功");
        this.getList();
        console.log(this.marryList.oldSpouseList,'oldSpouseListoldSpouseListoldSpouseList1')
        // window.location.reload();
      }).catch(() => {});
    },
    /** 导出按钮操作 */