|
@@ -21,6 +21,19 @@
|
|
|
<el-form-item label="质控类型:" prop="name">
|
|
|
<el-input type="text" placeholder="请输入质控类型" v-model="form.name"></el-input>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="默认标准类型:" class="formItem widthLarge">
|
|
|
+ <el-switch
|
|
|
+ v-model="form.defaultModule"
|
|
|
+ :active-value="1"
|
|
|
+ :inactive-value="0"
|
|
|
+ active-color="#4BC4D7"
|
|
|
+ inactive-color="#BBBBBB"
|
|
|
+ @change="handleTemChange($event,form.defaultModule)"
|
|
|
+ ></el-switch>
|
|
|
+ <span class="showInfo">{{showInfo}}</span>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="质控条目:" prop="qcItem">
|
|
|
<el-collapse>
|
|
|
<el-collapse-item v-for="(item,i) in qcItemList" :title="i" :name="i">
|
|
@@ -77,7 +90,8 @@
|
|
|
id:'',
|
|
|
hospitalId:"",
|
|
|
name:'',
|
|
|
- qcTypeCasesEntryVOList:[]
|
|
|
+ qcTypeCasesEntryVOList:[],
|
|
|
+ defaultModule: 0
|
|
|
},
|
|
|
rules:{
|
|
|
hospitalId:{ required: true, message: '请选择所属医院', trigger: ['blur', 'change']},
|
|
@@ -92,6 +106,7 @@
|
|
|
}, trigger: 'blur'
|
|
|
}],
|
|
|
},
|
|
|
+ showInfo: '否',
|
|
|
copy:null,
|
|
|
saveDisable: false, //保存按钮禁止点击
|
|
|
qcItemList:{},
|
|
@@ -109,7 +124,8 @@
|
|
|
id:isCopy?"":infoCopy.id,
|
|
|
hospitalId:infoCopy.hospitalId,
|
|
|
name:infoCopy.name,
|
|
|
- qcTypeCasesEntryVOList:[]
|
|
|
+ qcTypeCasesEntryVOList:[],
|
|
|
+ defaultModule:+infoCopy.defaultModule
|
|
|
};
|
|
|
//this.getQcTypeItem({hospitalId:info.hospitalId});
|
|
|
}else{
|
|
@@ -135,6 +151,7 @@
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
+ handleTemChange() {},
|
|
|
changeHospital(val){
|
|
|
localStorage.setItem("qcSelectHospital",val);
|
|
|
this.getQcTypeItem({hospitalId:val});
|
|
@@ -148,7 +165,7 @@
|
|
|
api.getQcTypeItem(param).then((res)=>{
|
|
|
if(res.data.code==="0") {
|
|
|
const data = res.data.data;
|
|
|
- this.qcItemList = data;console.log(this.qcItemList)
|
|
|
+ this.qcItemList = data;
|
|
|
}else{
|
|
|
this.warning("获取缺陷条目失败");
|
|
|
}
|
|
@@ -175,11 +192,39 @@
|
|
|
this.$refs[form].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if(this.form.id){//修改
|
|
|
- const param = Object.assign({},this.form);
|
|
|
+ let param = Object.assign({},this.form);
|
|
|
param.name=param.name.trim();
|
|
|
this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
|
|
|
api.addQcType(param).then((res)=>{
|
|
|
- if(res.data.code==0){
|
|
|
+ if (res.data.code === '-1') {
|
|
|
+ // 默认标准类型存在,是否替换
|
|
|
+ this.$alert('默认标准类型已存在,是否替换?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ param = { ...param, defineType: 1 };
|
|
|
+ api.addQcType(param).then(res => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '修改成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ //返回带搜索条件的首页
|
|
|
+ this.$router.push({
|
|
|
+ name: 'QCTypeMang',
|
|
|
+ params: Object.assign({}, this.$route.params, {currentPage: 1})
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.data.msg,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ } else if(res.data.code==0){
|
|
|
this.$message({
|
|
|
message:"修改成功",
|
|
|
type:'success'
|
|
@@ -198,11 +243,39 @@
|
|
|
this.saveDisable = false
|
|
|
})
|
|
|
}else{//添加
|
|
|
- const params = Object.assign({},this.form);
|
|
|
+ let params = Object.assign({},this.form);
|
|
|
params.name=params.name.trim();
|
|
|
this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
|
|
|
api.addQcType(params).then((res)=>{
|
|
|
- if(res.data.code==0){
|
|
|
+ if (res.data.code === '-1') {
|
|
|
+ // 默认标准类型存在,是否替换
|
|
|
+ this.$alert('默认标准类型已存在,是否替换?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ params = { ...params, defineType: 1 };
|
|
|
+ api.addQcType(params).then(res => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '修改成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ //返回带搜索条件的首页
|
|
|
+ this.$router.push({
|
|
|
+ name: 'QCTypeMang',
|
|
|
+ params: Object.assign({}, this.$route.params, {currentPage: 1})
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.data.msg,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ } else if(res.data.code==0){
|
|
|
this.$message({
|
|
|
message:"添加成功",
|
|
|
type:'success'
|
|
@@ -259,4 +332,7 @@
|
|
|
.el-select.big-select{
|
|
|
width: 360px;
|
|
|
}
|
|
|
+ .showInfo {
|
|
|
+ margin-left: 16px;
|
|
|
+ }
|
|
|
</style>
|