|
@@ -8,7 +8,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="质控类型:">
|
|
|
- <el-input size="mini" v-model="filter.name" placeholder="请输入质控类型"></el-input>
|
|
|
+ <el-input size="mini" v-model="filter.name" placeholder="请输入质控类型" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button size="mini" @click="filterDatas">确认</el-button>
|
|
@@ -56,11 +56,11 @@
|
|
|
<el-table-column
|
|
|
label="操作" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text" size="small" @click="toEditField(scope.row, 'modify')">修改</el-button>
|
|
|
+ <el-button type="text" size="small" @click="ifUnbindDialog(scope.row, 'modify')">修改</el-button>
|
|
|
<span style="margin:0 3px;">|</span>
|
|
|
<el-button type="text" size="small" @click="toEditField(scope.row, 'copy')">复制</el-button>
|
|
|
<span style="margin:0 3px;">|</span>
|
|
|
- <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row.id)">删除</el-button>
|
|
|
+ <el-button type="text" size="small" class="delete" @click="ifUnbindDialog(scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -160,16 +160,16 @@
|
|
|
return field[0]?field[0].name:'';
|
|
|
},
|
|
|
getAllTypes(){
|
|
|
- if(localStorage.getItem("qcHospitalTypes")){
|
|
|
+ /*if(localStorage.getItem("qcHospitalTypes")){
|
|
|
this.hisTypes = JSON.parse(localStorage.getItem("qcHospitalTypes"));
|
|
|
this.getDataList();
|
|
|
return ;
|
|
|
- }
|
|
|
+ }*/
|
|
|
//获取枚举信息
|
|
|
api.getQcTypes().then((res)=>{
|
|
|
if(res.data.code==="0"){
|
|
|
const data = res.data.data;
|
|
|
- localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
|
|
|
+ //localStorage.setItem("qcHospitalTypes",JSON.stringify(data[13]));
|
|
|
this.hisTypes =data[13];
|
|
|
this.getDataList();
|
|
|
}else{
|
|
@@ -250,17 +250,52 @@
|
|
|
type:type||'warning'
|
|
|
})
|
|
|
},
|
|
|
- showConfirmDialog(msg,resolve){
|
|
|
- this.$alert(msg, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
+ showConfirmDialog(msg,resolve,okText){
|
|
|
+ this.$confirm(msg, '提示', {
|
|
|
+ confirmButtonText: okText||'确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
resolve();
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
- showDelDialog(id){
|
|
|
+ ifUnbindDialog(data,type){
|
|
|
+ api.ifNeedUnbind({id:data.id,hospitalId:data.hospitalId,cancel:null,oper:type==='modify'?'0':'1'}).then((res)=>{
|
|
|
+ const {code,msg} = res.data;
|
|
|
+ if(code==='00000005'){
|
|
|
+ this.showConfirmDialog(msg,()=>{
|
|
|
+ this.unbindQcType(data,type);
|
|
|
+ },'解绑');
|
|
|
+ }else{
|
|
|
+ if(type==='modify'){
|
|
|
+ this.toEditField(data,type); //编辑
|
|
|
+ }else{
|
|
|
+ this.showDelDialog(data); //删除
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch((error)=>{
|
|
|
+ this.warning(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ unbindQcType(data,type){
|
|
|
+ api.ifNeedUnbind({id:data.id,hospitalId:data.hospitalId,cancel:1}).then((res)=>{
|
|
|
+ if(res.data.code=='0'){
|
|
|
+ this.warning(res.data.msg||'解绑成功','success');
|
|
|
+ if(type==='modify'){
|
|
|
+ this.toEditField(data,type); //编辑
|
|
|
+ }else{
|
|
|
+ this.showDelDialog(data); //删除
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.warning(res.data.msg);
|
|
|
+ }
|
|
|
+ }).catch((error)=>{
|
|
|
+ this.warning(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showDelDialog(row){
|
|
|
this.showConfirmDialog('是否删除该质控类型?',()=>{
|
|
|
- api.delQcType({ids:[id]}).then((res)=>{
|
|
|
+ api.delQcType({ids:[row.id]}).then((res)=>{
|
|
|
if(res.data.code=='0'){
|
|
|
this.warning(res.data.msg||'操作成功','success');
|
|
|
this.getDataList();
|
|
@@ -281,4 +316,10 @@
|
|
|
.delete{
|
|
|
color: red !important;
|
|
|
}
|
|
|
+ .el-message-box__btns .el-button--default span{
|
|
|
+ color: @adminBase;
|
|
|
+ }
|
|
|
+ .el-message-box__btns .el-button--primary span{
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
</style>
|