| | |
| | | <el-table v-if="refreshTable" v-loading="loading" :data="projectList" ref="tableRef" border row-key="proId" |
| | | :expand-row-keys="ListId" :row-class-name="selectSingleRow" |
| | | :tree-props="{ children: 'tjProjectList', hasChildren: 'tjProjectList.length>0', }"> |
| | | <el-table-column label="项目名称" prop="proName" fixed="left" width="150px" :show-overflow-tooltip="true" /> |
| | | <!-- :show-overflow-tooltip="true" --> |
| | | <el-table-column label="项目名称" prop="proName" fixed="left" :width="flexColumnWidth('rwdtypeName')" /> |
| | | <el-table-column label="项目价格(单位/元)" align="center" prop="proPrice" width="75px" |
| | | :show-overflow-tooltip="true"></el-table-column> |
| | | <el-table-column label="科室名称" align="center" prop="deptName" width="110px" :show-overflow-tooltip="true" /> |
| | |
| | | <el-table-column label="临床意义" align="center" prop="proMeaning" width="350px" :show-overflow-tooltip="true" /> |
| | | <!-- <el-table-column label="检查方式" align="center" prop="proCheckMethod" :show-overflow-tooltip="true" |
| | | width="110px" /> --> |
| | | <el-table-column label="是否空腹" align="center" prop="proCheckMethod" :show-overflow-tooltip="true" |
| | | width="110px" > |
| | | <el-table-column label="是否空腹" align="center" prop="proCheckMethod" :show-overflow-tooltip="true" width="110px"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.proCheckMethod" /> |
| | | </template> |
| | |
| | | <el-table v-loading="loading" ref="tb" :data="sfxmList" @selection-change="handleSelectionChange" border |
| | | height="520px" style="width: 100%"> |
| | | <el-table-column type="selection" align="center" /> |
| | | <el-table-column label="序号" align="center" prop="newID" |
| | | /> |
| | | <el-table-column label="序号" align="center" prop="newID" /> |
| | | <el-table-column label="项目编码" align="center" prop="xmbm" /> |
| | | <el-table-column label="项目名称" align="center" prop="xmmc"/> |
| | | <el-table-column label="拼音码" align="center" prop="pym" /> |
| | |
| | | this.handleQuery(); |
| | | }, |
| | | |
| | | |
| | | |
| | | flexColumnWidth(column) { |
| | | if (!column) { |
| | | return; |
| | | } |
| | | let maxlength = 160;//在此处设置默认宽度 |
| | | if (column == 'rwdtypeName') { |
| | | //在此处为了保证表头不换行,可以根据表头名称长度设置默认宽度 |
| | | // column1 就是对应表格中的prop属性值,比如上面的 rwdtypeName |
| | | maxlength = 160; |
| | | } |
| | | for (let i = 0; i < this.projectList.length; i++) { |
| | | if (this.projectList[i][column]) { |
| | | let now_temp = this.projectList[i][column] + ''; |
| | | let flexWidth = 0; |
| | | for (const char of now_temp) { |
| | | if (char >= 'A' && char <= 'Z' || char >= 'a' && char <= 'z') { |
| | | //英文字母 8 像素 |
| | | flexWidth += 8; |
| | | } else if (char >= '\u4e00' && char <= '\u9fa5') { |
| | | console.log(22222) |
| | | //中文文字 15 像素 |
| | | flexWidth += 15; |
| | | } else { |
| | | //其他字符 10 像素 |
| | | flexWidth += 10; |
| | | } |
| | | } |
| | | if (flexWidth > maxlength) { |
| | | maxlength = flexWidth; |
| | | } |
| | | } |
| | | } |
| | | //el-table中 cell 有左右的 padding 个 10 像素 |
| | | return maxlength + 20 + 'px'; |
| | | }, |
| | | |
| | | // 多选框选中数据 |
| | | handleSelectionChange(selection) { |
| | | this.ChangeList = selection |