pengjun 2 years ago
parent
commit
404619e430
  1. 33
      src/api/request.js
  2. 332
      src/views/common-settings/ItemType.vue
  3. 6
      src/views/common-settings/SampleGroup.vue
  4. 4
      src/views/common-settings/medicalPackage.vue
  5. 2
      src/views/fee-settings/Asbitem.vue
  6. 6
      src/views/fee-settings/DiagnosisTemplate.vue
  7. 2
      src/views/fee-settings/Item.vue
  8. 6
      src/views/fee-settings/ItemTemplate.vue

33
src/api/request.js

@ -13,9 +13,9 @@ const instance = axios.create({
withCredentials: true, // 允许跨域
});
let loading = null
//请求拦截
instance.interceptors.request.use(
async function(config) {
let needLoadingRequestCount = 0
function startLoading() {
loading = Loading.service({
lock: true,
text: "正在加载中,请稍后",
@ -23,10 +23,31 @@ instance.interceptors.request.use(
background: "rgba(0, 0, 0, 0)",
customClass: "boxStyle"
});
}
function endLoading() {
loading.close()
}
export function showFullScreenLoading() {
if (needLoadingRequestCount === 0) {
startLoading()
}
needLoadingRequestCount++
}
export function tryHideFullScreenLoading() {
if (needLoadingRequestCount <= 0) return
needLoadingRequestCount--
if (needLoadingRequestCount === 0) {
endLoading()
}
}
//请求拦截
instance.interceptors.request.use(
async function(config) {
//console.log('old token:',window.sessionStorage.getItem("token"))
//console.log('old expires_in',window.sessionStorage.getItem("expires_in"))
await yztoken();
showFullScreenLoading()
let token = window.sessionStorage.getItem("token");
let tokentype = window.sessionStorage.getItem("tokentype");
@ -43,7 +64,7 @@ instance.interceptors.request.use(
//响应拦截
instance.interceptors.response.use(
(res) => {
loading.close();
tryHideFullScreenLoading()
// console.log(res);
if (res.data.code < 0) {
Message.error({ showClose: true, message: res.data.message });
@ -60,7 +81,7 @@ instance.interceptors.response.use(
// console.log('token失效返回登录');
// }
// console.log(err);
loading.close();
tryHideFullScreenLoading()
return Promise.reject(err);
}
// function (response) {

332
src/views/common-settings/ItemType.vue

@ -9,12 +9,14 @@
<div style="background-color: #fff; border-radius: 8px; padding: 15px">
<el-table
:data="tableData"
:height="
window.pageHeight < 600 ? 450 : window.pageHeight - 130
"
:height="window.pageHeight < 600 ? 450 : window.pageHeight - 130"
row-key="id"
:key="tableKey"
default-expand-all
:tree-props="{children: 'treeChildren', hasChildren: 'hasChildren'}"
:tree-props="{
children: 'treeChildren',
hasChildren: 'hasChildren',
}"
highlight-current-row
@row-click="treeclick"
ref="tableData"
@ -28,14 +30,25 @@
class="el-icon-document-remove"
v-if="data.parentId == null"
></i> -->
<img style="width:20px;height:20px;vertical-align: sub;" src="@/assets/images/order.png"
v-if="scope.row.parentId == null" />
<img
style="width: 20px; height: 20px; vertical-align: sub"
src="@/assets/images/order.png"
v-if="scope.row.parentId == null"
/>
</span>
<span :class="scope.row.parentId == null ? 'maxtitle' : 'mintitle'">{{ scope.row.displayName }}</span>
<span
:class="
scope.row.parentId == null ? 'maxtitle' : 'mintitle'
"
>{{ scope.row.displayName }}</span
>
</span>
</template>
</el-table-column>
<el-table-column prop="simpleCode" label="拼音简码"></el-table-column>
<el-table-column
prop="simpleCode"
label="拼音简码"
></el-table-column>
<el-table-column label="操作" width="" align="center">
<template>
<el-tag
@ -58,62 +71,148 @@
</div>
</div>
<!-- 按钮区域 -->
<div style="margin-left: 10px;margin-top: 3%;position: absolute;top: 0;right: 0;">
<div
style="
margin-left: 10px;
margin-top: 3%;
position: absolute;
top: 0;
right: 0;
"
>
<!-- <el-button type="" @click="addll" class="commonbutton">新增</el-button> -->
<div v-if="tableData.length == '0' ? true : false" style="margin-bottom: 10px">
<el-button type="" class="commonbutton" @click="append">新增项目类别</el-button>
<div
v-if="tableData.length == '0' ? true : false"
style="margin-bottom: 10px"
>
<el-button type="" class="commonbutton" @click="append"
>新增项目类别</el-button
>
</div>
<div>
<el-button type="" @click="addll" :disabled="isshow" class="commonbutton">新增同级</el-button>
<el-button
type=""
@click="addll"
:disabled="isshow"
class="commonbutton"
>新增同级</el-button
>
</div>
<div style="margin-top: 10px">
<el-button type="" @click="append" :disabled="isshow" class="commonbutton">新增子级</el-button>
<el-button
type=""
@click="append"
:disabled="isshow"
class="commonbutton"
>新增子级</el-button
>
</div>
<div style="margin-top: 10px">
<el-button type="" @click="rena" :disabled="isshow" class="commonbutton">编辑</el-button>
<el-button
type=""
@click="rena"
:disabled="isshow"
class="commonbutton"
>编辑</el-button
>
</div>
<div style="margin-top: 10px">
<el-button type="" @click="deleates" :disabled="isshow" class="deleteButton">删除</el-button>
<el-button
type=""
@click="deleates"
:disabled="isshow"
class="deleteButton"
>删除</el-button
>
</div>
</div>
</div>
<el-dialog :title="title == 1 ? '新增' : '修改'" :visible.sync="dialogVisible" width="40%" :close-on-click-modal="false">
<el-dialog
:title="title == 1 ? '新增' : '修改'"
:visible.sync="dialogVisible"
width="40%"
:close-on-click-modal="false"
>
<span v-if="title == 2 ? true : false">上级部门</span>
<el-cascader v-if="title == 2" ref="depref" @change="cascaderchang" :show-all-levels="false"
v-model="departmentname" style="margin-left: 10px" :options="itemtypedata" :props="{
<el-cascader
v-if="title == 2"
ref="depref"
@change="cascaderchang"
:show-all-levels="false"
v-model="departmentname"
style="margin-left: 10px"
:options="itemtypedata"
:props="{
checkStrictly: true,
children: 'treeChildren',
label: 'displayName',
value: 'id',
}" clearable size="small"></el-cascader>
}"
clearable
size="small"
></el-cascader>
<el-form :model="form" label-width="80px" :rules="rules" ref="ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="名称" prop="displayName">
<el-input v-model="form.displayName" ref="refinput" size="small"></el-input>
<el-input
v-model="form.displayName"
ref="refinput"
size="small"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="指引类别" prop="guidTypeId">
<el-select v-model="form.guidTypeId" placeholder="请选择" style="width: 100%" size="small">
<el-option v-for="item in guideoptions" :key="item.id" :label="item.displayName" :value="item.id">
<el-select
v-model="form.guidTypeId"
placeholder="请选择"
style="width: 100%"
size="small"
>
<el-option
v-for="item in guideoptions"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检查类别" prop="checkTypeFlag">
<el-select v-model="form.checkTypeFlag" placeholder="请选择" style="width: 100%" size="small">
<el-option v-for="item in checkTypeFlag" :key="item.value" :label="item.label" :value="item.value">
<el-select
v-model="form.checkTypeFlag"
placeholder="请选择"
style="width: 100%"
size="small"
>
<el-option
v-for="item in checkTypeFlag"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="体检报告" prop="medicalReportTypeId">
<el-select style="width: 100%" v-model="form.medicalReportTypeId" placeholder="请选择" size="small">
<el-option v-for="item in medicalReportType" :key="item.id" :label="item.displayName" :value="item.id">
<el-select
style="width: 100%"
v-model="form.medicalReportTypeId"
placeholder="请选择"
size="small"
>
<el-option
v-for="item in medicalReportType"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
@ -124,19 +223,35 @@
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select> -->
<el-checkbox v-model="form.isMergeAsbitem" true-label="Y" false-label="N" />
<el-checkbox
v-model="form.isMergeAsbitem"
true-label="Y"
false-label="N"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结果是否换行" prop="isWrap" label-width="100px">
<el-checkbox v-model="form.isWrap" true-label="Y" false-label="N" />
<el-form-item
label="结果是否换行"
prop="isWrap"
label-width="100px"
>
<el-checkbox
v-model="form.isWrap"
true-label="Y"
false-label="N"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false" class="difference"> </el-button>
<el-button type="" @click="addoredit" class="commonbutton"> </el-button>
<el-button @click="dialogVisible = false" class="difference"
> </el-button
>
<el-button type="" @click="addoredit" class="commonbutton"
> </el-button
>
</span>
</el-dialog>
</div>
@ -220,14 +335,14 @@ export default {
tableHeight: window.innerHeight - 180, //
screenHeight: window.innerHeight, //
form: {
id:'',
id: "",
displayName: "",
parentId: "",
isMergeAsbitem: "N",
checkTypeFlag: "",
guidTypeId: "",
medicalReportTypeId: "",
isWrap: 'N', //
isWrap: "N", //
lineModeFlagBox: false, // box
},
value: "", //
@ -236,7 +351,8 @@ export default {
row: {},
isshow: true,
activeRows: [],
message:true
message: true,
tableKey:''
};
},
created() {
@ -249,42 +365,56 @@ export default {
...mapState(["window"]),
},
methods: {
cascaderchang(v) {
this.departmentname = v[v.length - 1];
},
treeToTable (tree, arr = []){
treeToTable(tree, level, arr = []) {
tree.map((item, index) => {
this.$set(item, "level", level);
arr.push(item);
if (item.treeChildren && item.treeChildren != []) {
arr.push(...this.treeToTable(item.treeChildren));
arr.push(...this.treeToTable(item.treeChildren, level + 1));
}
});
//
return arr;
},
flatToTree(flatData, idProp, parentIdProp) {
const treeData = []
const idMap = {}
const treeData = [];
const idMap = {};
// idMap 便
for (const node of flatData) {
idMap[node[idProp]] = node
node.treeChildren = []
idMap[node[idProp]] = node;
node.treeChildren = [];
}
//
for (const node of flatData) {
const parent = idMap[node[parentIdProp]]
const parent = idMap[node[parentIdProp]];
if (parent) {
parent.treeChildren.push(node)
parent.treeChildren.push(node);
} else {
treeData.push(node)
treeData.push(node);
}
}
return treeData
return treeData;
},
screenData(tree,row,increase,arr = []){
if(increase){
arr.push(row)
}
tree.map((item,index)=>{
if(item.parentId===row.id){
arr.push(item)
if(item.treeChildren && item.treeChildren != []){
arr.push(...this.screenData(item.treeChildren,item));
}
}
})
return arr;
},
//
rowDrop() {
@ -298,37 +428,74 @@ flatToTree(flatData, idProp, parentIdProp) {
// _this.activeRows = _this.treeToTable(_this.tableData) //
// },
onMove({ dragged, related }) {
const oldRow = _this.activeRows[dragged.rowIndex]
const newRow = _this.activeRows[related.rowIndex]
if (oldRow.parentId !== newRow.parentId) {
// if(dragged.rowIndex<related.rowIndex){
// if (_this.message) {
// _this.$message.warning("");
// _this.message = false;
// }
// return false;
// }
const oldRow = _this.activeRows[dragged.rowIndex];
const newRow = _this.activeRows[related.rowIndex];
if (
oldRow.level !== newRow.level ||
oldRow.parentId !== newRow.parentId
) {
if (_this.message) {
_this.$message.warning("不允许跨父级拖拽")
_this.message=false
_this.$message.warning("不允许跨级拖拽");
_this.message = false;
}
return false
return false;
}
},
// onChoose({oldIndex}){
onChoose({ oldIndex }) {
// _this.$nextTick(() => {
// _this.$refs['tableData'].setCurrentRow(_this.activeRows[oldIndex]);
// _this.treeclick(_this.activeRows[oldIndex])
// },
// // _this.treeclick(_this.activeRows[oldIndex])
// })
},
onEnd({ newIndex, oldIndex }) {
_this.message = true;
const oldRow = _this.activeRows[oldIndex] //
const newRow = _this.activeRows[newIndex] //
if (oldIndex === newIndex || oldRow.parentId !== newRow.parentId || oldRow.level != newRow.level) return
if (oldIndex !== newIndex || oldRow.level === newRow.level || oldRow.parentId === newRow.parentId) {
let oldRowSuffixData=_this.screenData(_this.activeRows,oldRow,true)
let newRowSuffixData=_this.screenData(_this.activeRows,newRow,true)
const targetRows = _this.activeRows.splice(oldIndex, oldRowSuffixData.length)
if (oldIndex > newIndex) {
_this.activeRows.splice(newIndex, 0, ...targetRows)
} else if (oldIndex < newIndex) {
_this.activeRows.splice(newIndex + newRowSuffixData.length - oldRowSuffixData.length, 0, ...targetRows)
}
let data = _this.flatToTree(
_this.activeRows,
"id",
"parentId"
);
_this.$set(_this,'tableData',data)
_this.isshow = false;
_this.message=true
const currRow = _this.activeRows.splice(oldIndex, 1)[0];
_this.activeRows.splice(newIndex, 0, currRow);
_this.tableData=_this.flatToTree(_this.activeRows,'id','parentId')
let beforeScrollTop = _this.$refs.tableData.$el.querySelector('div.el-table__body-wrapper').scrollTop
_this.tableKey = new Date().getTime()
_this.$nextTick(() => {
_this.$refs['tableData'].setCurrentRow(_this.activeRows[newIndex]);
_this.treeclick(_this.activeRows[newIndex])
})
},
_this.$refs.tableData.doLayout()
_this.$refs["tableData"].setCurrentRow(
oldRow
);
_this.treeclick(oldRow);
setTimeout(() => {
_this.$refs.tableData.$el.querySelector('div.el-table__body-wrapper').scrollTop = beforeScrollTop
}, 0)
_this.rowDrop()
});
}
}
})
});
},
//
rena() {
let id = this.row.id
let id = this.row.id;
let a = this.row.parentId;
this.departmentname = a;
this.title = 2;
@ -348,7 +515,7 @@ flatToTree(flatData, idProp, parentIdProp) {
});
projecttype(id).then((res) => {
if (res.code != -1) {
objCopy(res.data,this.form)
objCopy(res.data, this.form);
}
});
// getapi(`/api/app/item/in-item-type/${data.id}`).then((res) => {
@ -366,26 +533,27 @@ flatToTree(flatData, idProp, parentIdProp) {
},
//
deleates() {
let id = this.row.id
let id = this.row.id;
this.$confirm("是否删除, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
cancelButtonClass: "difference",
confirmButtonClass: "commonbutton"
}).then(() => {
confirmButtonClass: "commonbutton",
})
.then(() => {
projecteditid(id).then((res) => {
if (res.code != -1) {
this.$message.success("删除成功");
this.row=this.$options.data().row
this.row = this.$options.data().row;
this.getlist();
this.isshow = true
this.isshow = true;
}
});
})
.catch(() => {
this.$message("取消成功");
})
});
},
append() {
// this.form = {};
@ -393,7 +561,7 @@ flatToTree(flatData, idProp, parentIdProp) {
// this.form.parentId = data.id;
// }
// Object.assign(this.$data.form, this.$options.data().form);
this.form=this.$options.data().form
this.form = this.$options.data().form;
this.form.parentId = this.row.id;
this.dialogVisible = true;
if (this.$refs.ruleForm !== undefined) {
@ -418,8 +586,8 @@ flatToTree(flatData, idProp, parentIdProp) {
// this.form = {};
// this.form.parentId = data.parentId;
// Object.assign(this.$data.form, this.$options.data().form);
this.form=this.$options.data().form
this.form.parentId = this.row.parentId
this.form = this.$options.data().form;
this.form.parentId = this.row.parentId;
this.dialogVisible = true;
this.title = 1;
if (this.$refs.ruleForm !== undefined) {
@ -451,13 +619,13 @@ flatToTree(flatData, idProp, parentIdProp) {
checkTypeFlag: this.form.checkTypeFlag,
guidTypeId: this.form.guidTypeId,
medicalReportTypeId: this.form.medicalReportTypeId,
isWrap: this.form.isWrap
isWrap: this.form.isWrap,
}).then((res) => {
if (res.code != -1) {
this.$message.success("新增成功");
this.getlist();
this.dialogVisible = false;
this.isshow = true
this.isshow = true;
}
});
} else {
@ -468,13 +636,13 @@ flatToTree(flatData, idProp, parentIdProp) {
checkTypeFlag: this.form.checkTypeFlag,
guidTypeId: this.form.guidTypeId,
medicalReportTypeId: this.form.medicalReportTypeId,
isWrap: this.form.isWrap
isWrap: this.form.isWrap,
}).then((res) => {
if (res.code != -1) {
this.$message.success("新增成功");
this.getlist();
this.dialogVisible = false;
this.isshow = true
this.isshow = true;
}
});
}
@ -488,13 +656,13 @@ flatToTree(flatData, idProp, parentIdProp) {
checkTypeFlag: this.form.checkTypeFlag,
guidTypeId: this.form.guidTypeId,
medicalReportTypeId: this.form.medicalReportTypeId,
isWrap: this.form.isWrap
isWrap: this.form.isWrap,
}).then((res) => {
if (res.code != -1) {
this.$message.success("修改成功");
this.getlist();
this.dialogVisible = false;
this.isshow = true
this.isshow = true;
}
});
}
@ -503,14 +671,14 @@ flatToTree(flatData, idProp, parentIdProp) {
},
//
treeclick(row) {
this.row = {...row}
this.isshow = false
this.row = { ...row };
this.isshow = false;
},
getlist() {
projectlist(this.pages).then((res) => {
if (res.code != -1) {
this.tableData = [...res.data];
this.activeRows=this.treeToTable(this.tableData)
this.activeRows = this.treeToTable(this.tableData, 1);
}
});
},

6
src/views/common-settings/SampleGroup.vue

@ -799,13 +799,13 @@ export default {
// draggable: ".module-manager .el-table__row",
onChoose({ oldIndex }) {
_this.$refs["info"].setCurrentRow(_this.tableData[oldIndex]);
_this.rowick(_this.tableData[oldIndex],false);
},
onEnd({ newIndex, oldIndex }) {
// console.log(arr);
_this.isshow = false;
const currRow = _this.tableData.splice(oldIndex, 1)[0];
_this.tableData.splice(newIndex, 0, currRow);
_this.rowick(_this.tableData[newIndex]);
_this.tableData.map((item, index) => {
if (index == newIndex && index == oldIndex) {
// console.log(item, "");
@ -981,7 +981,7 @@ export default {
},
//
rowick(row,el) {
rowick(row) {
this.curRow = deepCopy(row)
this.form = deepCopy(row)
@ -991,14 +991,12 @@ export default {
// this.form = res.data;
// });
if(el){
getapi(`/api/app/sample-group-detail/sample-group-in-asbitem?SampleGroupId=${row.id}`).then( res =>{
if(res.code != -1){
this.sampleGroupAsbitems = res.data
this.getAsbItemByItemType()
}
})
}
},
getSummaries(param){

4
src/views/common-settings/medicalPackage.vue

@ -255,11 +255,15 @@ export default {
Sortable.create(el, {
handle: ".move",
animation: 300,
onChoose({ oldIndex }) {
that.$refs["medicalPackages"].setCurrentRow(that.medicalPackages[oldIndex]);
},
//
onEnd({ newIndex, oldIndex }) {
that.isDrag = true;
const currRow = that.medicalPackages.splice(oldIndex, 1)[0];
that.medicalPackages.splice(newIndex, 0, currRow);
that.rowClick(that.medicalPackages[newIndex]);
},
});
});

2
src/views/fee-settings/Asbitem.vue

@ -1949,12 +1949,12 @@ export default {
animation: 300,
onChoose({ oldIndex }) {
_this.$refs["tableData"].setCurrentRow(_this.tableData[oldIndex]);
_this.rowick(_this.tableData[oldIndex]);
},
onEnd({ newIndex, oldIndex }) {
_this.isshow = false;
const currRow = _this.tableData.splice(oldIndex, 1)[0];
_this.tableData.splice(newIndex, 0, currRow);
_this.rowick(_this.tableData[newIndex]);
_this.tableData.map((item, index) => {
if (index == newIndex && index == oldIndex) {
} else if (index == oldIndex) {

6
src/views/fee-settings/DiagnosisTemplate.vue

@ -801,7 +801,6 @@ export default {
animation: 300,
onChoose({ oldIndex }) {
_this.$refs["info"].setCurrentRow(_this.tableData[oldIndex]);
_this.rowick(_this.tableData[oldIndex],false);
},
//
// draggable: ".module-manager .el-table__row",
@ -810,6 +809,7 @@ export default {
_this.isshow = false;
const currRow = _this.tableData.splice(oldIndex, 1)[0];
_this.tableData.splice(newIndex, 0, currRow);
_this.rowick(_this.tableData[newIndex]);
_this.tableData.map((item, index) => {
if (index == newIndex && index == oldIndex) {
// console.log(item, "");
@ -985,7 +985,7 @@ export default {
},
//
rowick(row,el) {
rowick(row) {
this.curRow = deepCopy(row);
this.form = deepCopy(row);
@ -994,7 +994,6 @@ export default {
// this.form = res.data;
// });
if(el){
postapi(
"/api/app/diagnosistemplatedetail/getdiagnosistemplateindiagnosis",
{
@ -1006,7 +1005,6 @@ export default {
this.getAsbItemByItemType();
}
});
}
},
getSummaries(param){
const { columns, data } = param;

2
src/views/fee-settings/Item.vue

@ -2621,8 +2621,6 @@ export default {
} else if (index == newIndex) {
}
});
console.log(_this.tableData.map((item) => item.displayOrder));
console.log(_this.initTableData.map((item) => item.displayOrder));
},
});
});

6
src/views/fee-settings/ItemTemplate.vue

@ -806,7 +806,6 @@ export default {
animation: 300,
onChoose({ oldIndex }) {
_this.$refs["info"].setCurrentRow(_this.tableData[oldIndex]);
_this.rowick(_this.tableData[oldIndex],false);
},
//
// draggable: ".module-manager .el-table__row",
@ -815,6 +814,7 @@ export default {
_this.isshow = false;
const currRow = _this.tableData.splice(oldIndex, 1)[0];
_this.tableData.splice(newIndex, 0, currRow);
_this.rowick(_this.tableData[newIndex]);
_this.tableData.map((item, index) => {
if (index == newIndex && index == oldIndex) {
// console.log(item, "");
@ -987,7 +987,7 @@ export default {
},
//
rowick(row,el) {
rowick(row) {
this.curRow = deepCopy(row);
this.form = deepCopy(row);
@ -996,7 +996,6 @@ export default {
// this.form = res.data;
// });
if(el){
postapi("/api/app/itemtemplatedetail/getitemtemplateinitem", {
ItemTemplateId: this.form.id,
}).then((res) => {
@ -1005,7 +1004,6 @@ export default {
this.getAsbItemByItemType();
}
});
}
},
getSummaries(param){
const { columns, data } = param;

Loading…
Cancel
Save