Browse Source

lis import

master
pengjun 2 years ago
parent
commit
540210dc76
  1. 132
      src/components/commonTable/CommonTable.vue
  2. 94
      src/components/commonTable/CommonTableEdit.vue
  3. 190
      src/components/commonTable/CommonTableTypeEdit.vue
  4. 193
      src/components/commonTable/commonTableType.vue
  5. 1
      src/store/index.js
  6. 15
      src/views/doctorCheck/lisResultImport.vue

132
src/components/commonTable/CommonTable.vue

@ -7,12 +7,12 @@
<!--公共表分类信息--> <!--公共表分类信息-->
<div style="display: flex; font-size: 14px"> <div style="display: flex; font-size: 14px">
<div :style="'display: block;width:' + (window.pageWidth - window.pageMarginWidth - 110 - 5) + 'px;'"> <div :style="'display: block;width:' + (window.pageWidth - window.pageMarginWidth - 110 - 5) + 'px;'">
<el-table :data="commonTables" ref="commonTable" row-key="id" border :height="`${tableHeight }px`" size="small"
highlight-current-row :row-class-name="handleRowClassName" @row-click="rowClick">
<el-table id="commonTables" :data="commonTables" ref="commonTables" row-key="id" border :height="`${tableHeight}px`"
size="small" highlight-current-row :row-class-name="handleRowClassName" @row-click="rowClick">
<el-table-column type="index" label="序号" width="50" align="center" /> <el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column label="编号" prop="id" min-width="200" align="center" /> <el-table-column label="编号" prop="id" min-width="200" align="center" />
<el-table-column prop="dataCode" label="dataCode" min-width="100" /> <el-table-column prop="dataCode" label="dataCode" min-width="100" />
<el-table-column prop="displayName" label="名称" min-width="150" />
<el-table-column prop="displayName" label="项目名称" min-width="150" />
<el-table-column prop="commonTableTypeId" label="分类" min-width="150" /> <el-table-column prop="commonTableTypeId" label="分类" min-width="150" />
<el-table-column prop="simpleCode" label="简码" min-width="60" /> <el-table-column prop="simpleCode" label="简码" min-width="60" />
<el-table-column prop="creatorName" label="创建者" min-width="80" align="center" /> <el-table-column prop="creatorName" label="创建者" min-width="80" align="center" />
@ -21,11 +21,11 @@
{{ scope.row.creationTime ? moment(scope.row.creationTime).format("yyyy-MM-DD HH:mm:ss") : "" }} {{ scope.row.creationTime ? moment(scope.row.creationTime).format("yyyy-MM-DD HH:mm:ss") : "" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="lastModificationName" label="修改者" min-width="80" align="center" />
<el-table-column prop="lastModifierName" label="修改者" min-width="80" align="center" />
<el-table-column label="修改时间" min-width="150" align="center"> <el-table-column label="修改时间" min-width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.lastModificationTime ? moment(scope.row.lastModificationTime).format("yyyy-MM-DD HH:mm:ss") {{ scope.row.lastModificationTime ? moment(scope.row.lastModificationTime).format("yyyy-MM-DD HH:mm:ss")
: "" }}
: "" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
@ -53,10 +53,10 @@
<el-button class="deleteButton" @click="btnDel">删除</el-button> <el-button class="deleteButton" @click="btnDel">删除</el-button>
</div> </div>
<div style="margin-top: 5px"> <div style="margin-top: 5px">
<el-button class="commonbutton" @click="btnSetTop">置顶</el-button>
<el-button class="commonbutton" @click="btnSetTopOrBottom(1)">置顶</el-button>
</div> </div>
<div style="margin-top: 5px"> <div style="margin-top: 5px">
<el-button class="commonbutton" @click="btnSetBottom">置底</el-button>
<el-button class="commonbutton" @click="btnSetTopOrBottom(2)">置底</el-button>
</div> </div>
<div style="margin-top: 5px"> <div style="margin-top: 5px">
<el-button class="commonbutton" @click="btnSort" :disabled="!isDrag">保存排序</el-button> <el-button class="commonbutton" @click="btnSort" :disabled="!isDrag">保存排序</el-button>
@ -111,8 +111,8 @@ export default {
computed: { computed: {
...mapState(["personnelUnit", "window", "dict", "dialogWin", "dataTransOpts"]), ...mapState(["personnelUnit", "window", "dict", "dialogWin", "dataTransOpts"]),
tableHeight(){
let h = this.window.pageHeight < 600 ? 600:this.window.pageHeight
tableHeight() {
let h = this.window.pageHeight < 600 ? 600 : this.window.pageHeight
return h - this.window.pageHeaderHeight - this.window.cardHeaderHeight - this.window.pageMarginHeight - 260 return h - this.window.pageHeaderHeight - this.window.cardHeaderHeight - this.window.pageMarginHeight - 260
}, },
}, },
@ -140,13 +140,29 @@ export default {
dddw, dddw,
deepCopy, deepCopy,
getList(body) {
// body = {
// "commonTableTypeId": "string",
// "keyWord": "string"
// }
this.commonTables = []
if(!body.commonTableTypeId) return
postapi('/api/app/CommonTable/GetList', body).then(res => {
if (res.code > -1) {
this.commonTables = res.data
this.rowDrop()
}
})
},
// //
btnSort() { btnSort() {
const result = [];
let result = [];
this.commonTables.forEach((item, index) => { this.commonTables.forEach((item, index) => {
result.push({ id: item.id, displayOrder: index }); result.push({ id: item.id, displayOrder: index });
}); });
putapi("/api/app/customerorggroup/updatesortmany", {
postapi("/api/app/CommonTable/UpdateSortMany", {
itemList: result, itemList: result,
}).then((res) => { }).then((res) => {
console.log("操作成功"); console.log("操作成功");
@ -156,47 +172,27 @@ export default {
//Sortable //Sortable
rowDrop() { rowDrop() {
// this.$nextTick(() => {
// const tbody = document.querySelector(".el-table__body-wrapper tbody");
// const _this = this;
// Sortable.create(tbody, {
// handle: ".move",
// animation: 300,
// onEnd({ newIndex, oldIndex }) {
// _this.isDrag = false;
// const currRow = _this.commonTables.splice(oldIndex, 1)[0];
// _this.commonTables.splice(newIndex, 0, currRow);
// _this.commonTables.map((item, index) => {
// if (index == newIndex && index == oldIndex) {
// } else if (index == oldIndex) {
// } else if (index == newIndex) {
// }
// });
// console.log(_this.commonTables.map((item) => item.displayOrder));
// },
// });
// });
// console.log('rowDrop detail')
this.$nextTick(() => { this.$nextTick(() => {
const el = document.querySelector(".el-table__body-wrapper tbody");
//console.log('el0',el)
const that = this;
let el = document.querySelector("#commonTables tbody");
// console.log('el0',el)
let that = this;
Sortable.create(el, { Sortable.create(el, {
handle: ".move", handle: ".move",
animation: 300, animation: 300,
// //
onEnd({ newIndex, oldIndex }) { onEnd({ newIndex, oldIndex }) {
that.isDrag = true; that.isDrag = true;
const currRow = that.commonTables.splice(oldIndex, 1)[0];
let currRow = that.commonTables.splice(oldIndex, 1)[0];
that.commonTables.splice(newIndex, 0, currRow); that.commonTables.splice(newIndex, 0, currRow);
console.log("el", el);
// console.log("el", el);
}, },
}); });
}); });
}, },
//
btnSetBottom() {
//
btnSetTopOrBottom(sortType) {
if (!this.dataTransOpts.tableS.common_table.id) { if (!this.dataTransOpts.tableS.common_table.id) {
this.$message.warning("请选择操作的数据"); this.$message.warning("请选择操作的数据");
return; return;
@ -204,32 +200,16 @@ export default {
let lfind = arrayExistObj(this.commonTables, "id", this.dataTransOpts.tableS.common_table.id); let lfind = arrayExistObj(this.commonTables, "id", this.dataTransOpts.tableS.common_table.id);
let currentRow = {}; let currentRow = {};
putapi(
`/api/app/customerorggroup/updatemanysort?id=${this.dataTransOpts.tableS.common_table.id}&SortType=2`
postapi('/api/app/CommonTable/UpdateManySort', { commonTableId: this.dataTransOpts.tableS.common_table.id, sortType }
).then((res) => { ).then((res) => {
console.log("操作成功"); console.log("操作成功");
currentRow = this.commonTables.splice(lfind, 1)[0]; // currentRow = this.commonTables.splice(lfind, 1)[0]; //
this.commonTables.push(currentRow);
this.$refs["commonTables"].setCurrentRow(currentRow);
});
},
//
btnSetTop() {
if (!this.dataTransOpts.tableS.common_table.id) {
this.$message.warning("请选择操作的数据");
return;
}
let lfind = arrayExistObj(this.commonTables, "id", this.dataTransOpts.tableS.common_table.id);
let currentRow = {};
if (sortType == 2) {
this.commonTables.push(currentRow);
} else {
this.commonTables.unshift(currentRow);
}
putapi(
`/api/app/customerorggroup/updatemanysort?id=${this.dataTransOpts.tableS.common_table.id}&SortType=1`
).then((res) => {
console.log("操作成功");
currentRow = this.commonTables.splice(lfind, 1)[0];
this.commonTables.unshift(currentRow);
this.$refs["commonTables"].setCurrentRow(currentRow); this.$refs["commonTables"].setCurrentRow(currentRow);
}); });
}, },
@ -248,15 +228,6 @@ export default {
// //
dictInit() { dictInit() {
//
getapi("/api/app/customer-org/parent-all").then((res) => {
if (res.code != -1) {
this.customerOrgAll = res.data;
let lfind = arrayExistObj(this.customerOrgAll, "id", this.dict.personOrgId);
if (lfind > -1) this.customerOrgAll.splice(lfind, 1);
this.customerOrg = deepCopy(this.customerOrgAll);
}
});
}, },
@ -271,13 +242,13 @@ export default {
btnAdd(id) { btnAdd(id) {
if (!id) this.dataTransOpts.tableS.common_table.id = '' if (!id) this.dataTransOpts.tableS.common_table.id = ''
this.CommonTableEditParams = { this.CommonTableEditParams = {
id, id,
commonTableTypeId: this.dataTransOpts.tableS.common_table_type.id, commonTableTypeId: this.dataTransOpts.tableS.common_table_type.id,
} }
this.dataTransOpts.refresh.common_table.S++
this.dialogWin.CommonTableEdit = true; this.dialogWin.CommonTableEdit = true;
}, },
// //
@ -295,10 +266,6 @@ export default {
this.$message.warning("请选择需要操作的数据"); this.$message.warning("请选择需要操作的数据");
return; return;
} }
if (this.customerOrgRegister.isComplete.toUpperCase() == "Y") {
this.$message.warning("该单位体检次数已完成,不允许删除分组");
return;
}
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "是", confirmButtonText: "是",
@ -306,17 +273,13 @@ export default {
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
return deletapi(`/api/app/customer-org-group/${this.dataTransOpts.tableS.common_table.id}`);
return postapi('/api/app/CommonTable/Delete', {commonTableId:this.dataTransOpts.tableS.common_table.id});
}) })
.then((res) => { .then((res) => {
if (res.code != -1) { if (res.code != -1) {
console.log("删除成功"); console.log("删除成功");
let lfind = arrayExistObj(this.commonTables, "id", this.dataTransOpts.tableS.common_table.id); let lfind = arrayExistObj(this.commonTables, "id", this.dataTransOpts.tableS.common_table.id);
if (lfind > -1) this.commonTables.splice(lfind, 1); if (lfind > -1) this.commonTables.splice(lfind, 1);
this.dataTransOpts.tableS.common_table.id = ''
setTimeout(() => {
this.dataTransOpts.refresh.common_table_detail.M++
}, 20);
} }
}) })
.catch((err) => { .catch((err) => {
@ -332,7 +295,7 @@ export default {
let id = this.dataTransOpts.tableS.common_table.id let id = this.dataTransOpts.tableS.common_table.id
if (id) { if (id) {
// //
getapi(`/api/app/customer-org-group/${id}`)
postapi('/api/app/CommonTable/Get', { commonTableId: id })
.then(res => { .then(res => {
if (res.code != -1) { if (res.code != -1) {
let lfind = -1 let lfind = -1
@ -350,7 +313,6 @@ export default {
// common_table_detail // common_table_detail
this.curCommonTable = deepCopy(res.data); this.curCommonTable = deepCopy(res.data);
this.curCommonTable.isComplete = this.customerOrgRegister.isComplete;
} }
}) })
} else { } else {
@ -363,11 +325,11 @@ export default {
// //
watch: { watch: {
// //
"dataTransOpts.refresh.common_table.M":{
"dataTransOpts.refresh.common_table.M": {
// immediate:true, // immediate:true,
handler(newVal, oldVal) { handler(newVal, oldVal) {
console.log(`watch 公共表分类 newVal:${newVal} oldVal:${oldVal} commonTableTypeId: ${this.dataTransOpts.tableS.common_table_type.id}`); console.log(`watch 公共表分类 newVal:${newVal} oldVal:${oldVal} commonTableTypeId: ${this.dataTransOpts.tableS.common_table_type.id}`);
if(newVal != oldVal) this.close_dialogWinCommonTableEdit();
if (newVal != oldVal) this.getList({ commonTableTypeId: this.dataTransOpts.tableS.common_table_type.id });
} }
}, },
}, },

94
src/components/commonTable/CommonTableEdit.vue

@ -5,7 +5,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="commonTableTypeId" label="分类"> <el-form-item prop="commonTableTypeId" label="分类">
<el-select v-model="form.commonTableTypeId" placeholder="请选择" size="small"> <el-select v-model="form.commonTableTypeId" placeholder="请选择" size="small">
<el-option v-for="item in dict.commonTableType" :key="item.id" :label="item.displayName" :value="item.id">
<el-option v-for="item in commonTableTypes" :key="item.id" :label="item.displayName" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -20,7 +20,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="displayName" label="分组名称">
<el-form-item prop="displayName" label="项目名称">
<el-input v-model="form.displayName" size="small" /> <el-input v-model="form.displayName" size="small" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -50,11 +50,10 @@ import {
arrayExistObj, arrayExistObj,
} from "../../utlis/proFunc"; } from "../../utlis/proFunc";
import CustomerOrgGroupAsbitem from "../../components/customerOrg/customerOrgGroupAsbitem.vue";
export default { export default {
components: { components: {
CustomerOrgGroupAsbitem,
}, },
props: ["params"], props: ["params"],
data() { data() {
@ -65,6 +64,8 @@ export default {
displayName: "", displayName: "",
dataCode: "" dataCode: ""
}, },
editType: 'insert',
commonTableTypes: [], //
formInit: {}, // formInit: {}, //
rules: { rules: {
commonTableTypeId: [{ required: true, message: "请填写分类名称", trigger: "blur" }], commonTableTypeId: [{ required: true, message: "请填写分类名称", trigger: "blur" }],
@ -83,27 +84,17 @@ export default {
mounted() { mounted() {
// //
this.dictInit(); this.dictInit();
this.getFormData(this.dataTransOpts.tableS.customer_org_group.id);
this.getFormData(this.params.id);
}, },
methods: { methods: {
moment, dddw, deepCopy, moment, dddw, deepCopy,
// //
dictInit() { dictInit() {
//
getapi("/api/app/customer-org/parent-all").then((res) => {
if (res.code != -1) {
this.customerOrgAll = res.data;
let lfind = arrayExistObj(this.customerOrgAll, "id", this.dict.personOrgId);
if (lfind > -1) this.customerOrgAll.splice(lfind, 1);
this.customerOrg = deepCopy(this.customerOrgAll);
}
});
// //
getapi("/api/app/for-sex").then((res) => {
postapi("/api/app/CommonTableType/GetList").then((res) => {
if (res.code != -1) { if (res.code != -1) {
this.dict.forSex = res.data;
this.commonTableTypes = res.data;
} }
}); });
}, },
@ -111,17 +102,17 @@ export default {
// //
getFormData(id) { getFormData(id) {
if (id) { if (id) {
getapi(`/api/app/customer-org-group/${id}`)
postapi('/api/app/CommonTable/Get', { commonTableId: id })
.then(res => { .then(res => {
if (res.code != -1) { if (res.code != -1) {
this.form = deepCopy(res.data) this.form = deepCopy(res.data)
} }
}) })
this.editType = 'update'
} else { } else {
console.log('this.formInit',this.formInit)
this.form = deepCopy(this.formInit)
this.form.id = this.params.id
this.form.commonTableTypeId = this.params.commonTableTypeId
console.log('this.formInit', this.formInit)
this.form = Object.assign({}, this.formInit, { commonTableTypeId: this.params.commonTableTypeId })
this.editType = 'insert'
} }
}, },
@ -133,41 +124,24 @@ export default {
return false; return false;
} }
if (!this.form.id && !this.form.customerOrgRegisterId) {
this.$message.warning("请选择单位体检次数!");
return false;
}
let url = '/api/app/CommonTable/Create'
let body = deepCopy(this.form); let body = deepCopy(this.form);
delete body.id;
delete body.customerOrgId;
delete body.isComplete;
if (this.form.id) {
let customerOrgGroupId = this.form.id;
body.commonTableId = body.id
if (this.editType == 'update') {
url = '/api/app/CommonTable/Update'
}
//
putapi(`/api/app/customer-org-group/${this.form.id}`, body)
.then((res) => {
// console.log(res)
if (res.code != -1) {
console.log("保存分组成功!");
this.dataTransOpts.refresh.customer_org_group_detail.M
}
})
//
postapi(url, body)
.then(res => {
if (res.code != -1) {
console.log("操作成功!");
if(this.editType == 'insert') this.dataTransOpts.tableS.common_table.id = res.data.id
this.dialogWin.CommonTableEdit = false;
}
});
} else {
//
postapi("/api/customerorggroup/createcustomerorggroupincustomerorgregister", body)
.then(res => {
if (res.code != -1) {
console.log("操作成功!");
this.dataTransOpts.tableS.customer_org_group.id = res.data.id
this.dialogWin.CommonTableEdit = false;
}
});
}
}); });
}, },
@ -270,20 +244,12 @@ export default {
}, },
// //
watch: { watch: {
//
// "customerOrgGroup.id"(newVal, oldVal) {
// console.log("customerOrgGroup.id ",newVal,oldVal);
// if (newVal != oldVal) {
// this.getCustomerOrgGroupAsbitems(newVal);
// }
// },
// ID // ID
"dataTransOpts.refresh.customer_org_group.S": {
"dataTransOpts.refresh.common_table.S": {
// immediate: true, // immediate: true,
handler(newVal, oldVal) { handler(newVal, oldVal) {
console.log(`watch 体检分组 newVal:${newVal} oldVal:${oldVal} customerOrgGroupId: ${this.dataTransOpts.tableS.customer_org_group.id}`);
this.getFormData(this.dataTransOpts.tableS.customer_org_group.id);
console.log(`watch 体检分组 newVal:${newVal} oldVal:${oldVal} common_table.id: ${this.params.id}`);
if (newVal != oldVal) this.getFormData(this.params.id);
} }
}, },
}, },

190
src/components/commonTable/CommonTableTypeEdit.vue

@ -4,7 +4,7 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="id" label="编号"> <el-form-item prop="id" label="编号">
<el-input v-model="form.id" size="small" />
<el-input v-model="form.id" size="small" :disabled="editType == 'update'" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -40,11 +40,11 @@ import {
arrayExistObj, arrayExistObj,
} from "../../utlis/proFunc"; } from "../../utlis/proFunc";
import CustomerOrgGroupAsbitem from "../../components/customerOrg/customerOrgGroupAsbitem.vue";
export default { export default {
components: { components: {
CustomerOrgGroupAsbitem,
}, },
props: ["params"], props: ["params"],
data() { data() {
@ -53,6 +53,7 @@ export default {
id: "", id: "",
displayName: "", displayName: "",
}, },
editType: 'insert', // update
formOri: {}, // formOri: {}, //
formInit: {}, // formInit: {}, //
rules: { rules: {
@ -66,52 +67,40 @@ export default {
}, },
created() { created() {
this.formInit = deepCopy(this.form); this.formInit = deepCopy(this.form);
this.form.customerOrgId = this.params.customerOrgId
this.form.customerOrgRegisterId = this.params.customerOrgRegisterId
}, },
mounted() { mounted() {
// //
this.dictInit(); this.dictInit();
this.getFormData(this.dataTransOpts.tableS.customer_org_group.id);
this.getFormData(this.params.id);
}, },
methods: { methods: {
moment, dddw, deepCopy, moment, dddw, deepCopy,
// //
dictInit() { dictInit() {
//
getapi("/api/app/customer-org/parent-all").then((res) => {
if (res.code != -1) {
this.customerOrgAll = res.data;
let lfind = arrayExistObj(this.customerOrgAll, "id", this.dict.personOrgId);
if (lfind > -1) this.customerOrgAll.splice(lfind, 1);
this.customerOrg = deepCopy(this.customerOrgAll);
}
});
// //
getapi("/api/app/for-sex").then((res) => {
if (res.code != -1) {
this.dict.forSex = res.data;
}
});
// getapi("/api/app/for-sex").then((res) => {
// if (res.code != -1) {
// this.dict.forSex = res.data;
// }
// });
}, },
// //
getFormData(id) { getFormData(id) {
if (id) { if (id) {
getapi(`/api/app/customer-org-group/${id}`)
postapi('/api/app/CommonTableType/Get', { commonTableTypeId: id })
.then(res => { .then(res => {
if (res.code != -1) { if (res.code != -1) {
this.formOri = deepCopy(res.data) this.formOri = deepCopy(res.data)
this.form = deepCopy(res.data) this.form = deepCopy(res.data)
} }
}) })
this.editType = 'update'
} else { } else {
console.log('this.formInit',this.formInit)
console.log('this.formInit', this.formInit)
this.form = deepCopy(this.formInit) this.form = deepCopy(this.formInit)
this.form.customerOrgId = this.params.customerOrgId
this.form.customerOrgRegisterId = this.params.customerOrgRegisterId
this.editType = 'insert'
} }
}, },
@ -123,157 +112,38 @@ export default {
return false; return false;
} }
if (!this.form.id && !this.form.customerOrgRegisterId) {
this.$message.warning("请选择单位体检次数!");
return false;
}
let url = '/api/app/CommonTableType/Create'
let body = deepCopy(this.form); let body = deepCopy(this.form);
delete body.id;
delete body.customerOrgId;
delete body.isComplete;
if (this.form.id) {
let customerOrgGroupId = this.form.id;
let customerOrgGroupAsbitems = []; //
//
putapi(`/api/app/customer-org-group/${this.form.id}`, body)
.then((res) => {
// console.log(res)
if (res.code != -1) {
console.log("保存分组成功!");
this.dataTransOpts.refresh.customer_org_group_detail.M
}
})
body.commonTableTypeId = body.id
} else {
//
postapi("/api/customerorggroup/createcustomerorggroupincustomerorgregister", body)
.then(res => {
if (res.code != -1) {
console.log("操作成功!");
this.dataTransOpts.tableS.customer_org_group.id = res.data.id
this.dialogWin.CommonTableTypeEdit = false;
}
});
if (this.editType == 'update') {
url = '/api/app/CommonTableType/Update'
} }
});
},
//
computePrice() {
if (!this.form.id) {
this.$message.warning("尚未保存信息,不可执行此操作!");
return;
}
let customerOrgGroupId = this.form.id;
let customerOrgGroupAsbitems = []; //
getapi(`/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${customerOrgGroupId}`)
.then((res) => {
if (res.code != -1) {
customerOrgGroupAsbitems = res.data;
if (customerOrgGroupAsbitems.length < 1) {
this.$message.warning("当前分组尚未设置组合项目,不可执行此操作!");
} else {
let body = {
customerOrgGroupId,
details: this.madeNewGroupAsbitems(
customerOrgGroupAsbitems,
this.form.price
),
};
console.log("body", body);
return postapi("/api/app/customerorggroupdetail/createcustomerorggroupdetailmany", body);
//
postapi(url, body)
.then(res => {
if (res.code != -1) {
console.log("操作成功!");
this.dataTransOpts.tableS.common_table_type.id = body.id
this.dialogWin.CommonTableTypeEdit = false;
} }
}
})
.then((res) => {
if (res.code != -1) {
//console.log("");
//
this.form.id = "";
//
setTimeout(() => {
this.form.id = customerOrgGroupId;
this.onSubmit("form");
}, 100);
}
});
},
madeNewGroupAsbitems(oldGroupAsbitems, newTotal) {
newTotal = Math.round(Number(newTotal) * 100) / 100;
let newGroupAsbitems = [];
let oldTotal = Number(0);
oldGroupAsbitems.forEach((e) => {
oldTotal += Number(e.asbitemMoney); //customerOrgGroupDetailMoney
});
oldTotal = Math.round(Number(oldTotal) * 100) / 100;
let discount = 0;
if (oldTotal != 0) discount = Math.round((newTotal * 10000) / oldTotal) / 100;
oldTotal = Number(0);
oldGroupAsbitems.forEach((e) => {
e.customerOrgGroupDetailPrice = Math.round(e.price * discount) / 100;
e.customerOrgGroupDetailMoney =
Math.round(
e.customerOrgGroupDetailPrice * e.customerOrgGroupDetailAmount * 100
) / 100;
oldTotal += Number(e.customerOrgGroupDetailMoney);
});
oldTotal = Math.round(Number(oldTotal) * 100) / 100;
//console.log('discount,oldTotal',discount,oldTotal)
let didTotal = Math.round(Number(newTotal - oldTotal) * 100) / 100;
if (didTotal != 0) {
for (let i = 0; i < oldGroupAsbitems.length; i++) {
if (oldGroupAsbitems[i].customerOrgGroupDetailAmount == 1) {
oldGroupAsbitems[i].customerOrgGroupDetailPrice =
Math.round(
(Number(oldGroupAsbitems[i].customerOrgGroupDetailPrice) +
Number(didTotal)) *
100
) / 100;
break;
}
}
}
});
oldGroupAsbitems.forEach((e) => {
newGroupAsbitems.push({
customerOrgGroupId: e.customerOrgGroupId,
asbitemId: e.asbitemId,
price: e.customerOrgGroupDetailPrice,
amount: e.customerOrgGroupDetailAmount,
});
}); });
return newGroupAsbitems;
}, },
}, },
// //
watch: { watch: {
//
// "customerOrgGroup.id"(newVal, oldVal) {
// console.log("customerOrgGroup.id ",newVal,oldVal);
// if (newVal != oldVal) {
// this.getCustomerOrgGroupAsbitems(newVal);
// }
// },
// ID // ID
"dataTransOpts.refresh.customer_org_group.S": {
"dataTransOpts.refresh.common_table_type.S": {
// immediate: true, // immediate: true,
handler(newVal, oldVal) { handler(newVal, oldVal) {
console.log(`watch 体检分组 newVal:${newVal} oldVal:${oldVal} customerOrgGroupId: ${this.dataTransOpts.tableS.customer_org_group.id}`);
this.getFormData(this.dataTransOpts.tableS.customer_org_group.id);
console.log(`watch 体检分组 newVal:${newVal} oldVal:${oldVal} this.params.id: ${this.params.id}`);
if(newVal != oldVal) this.getFormData(this.params.id);
} }
}, },
}, },

193
src/components/commonTable/commonTableType.vue

@ -7,9 +7,8 @@
<!--公共表分类信息--> <!--公共表分类信息-->
<div style="display: flex; font-size: 14px"> <div style="display: flex; font-size: 14px">
<div :style="'display: block;width:' + (window.pageWidth - window.pageMarginWidth - 110 - 5) + 'px;'"> <div :style="'display: block;width:' + (window.pageWidth - window.pageMarginWidth - 110 - 5) + 'px;'">
<el-table :data="commonTableTypes" ref="commonTableType" row-key="id" border
height="240px" size="small" highlight-current-row :row-class-name="handleRowClassName"
@row-click="rowClick">
<el-table :data="commonTableTypes" ref="commonTableTypes" row-key="id" border height="240px" size="small"
highlight-current-row :row-class-name="handleRowClassName" @row-click="rowClick">
<el-table-column type="index" label="序号" width="50" align="center" /> <el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column label="编号" prop="id" min-width="200" align="center" /> <el-table-column label="编号" prop="id" min-width="200" align="center" />
<el-table-column prop="displayName" label="分类名称" min-width="150" /> <el-table-column prop="displayName" label="分类名称" min-width="150" />
@ -19,10 +18,11 @@
{{ scope.row.creationTime ? moment(scope.row.creationTime).format("yyyy-MM-DD HH:mm:ss") : "" }} {{ scope.row.creationTime ? moment(scope.row.creationTime).format("yyyy-MM-DD HH:mm:ss") : "" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="lastModificationName" label="修改者" min-width="80" align="center" />
<el-table-column prop="lastModifierName" label="修改者" min-width="80" align="center" />
<el-table-column label="修改时间" min-width="150" align="center"> <el-table-column label="修改时间" min-width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.lastModificationTime ? moment(scope.row.lastModificationTime).format("yyyy-MM-DD HH:mm:ss") : "" }}
{{ scope.row.lastModificationTime ? moment(scope.row.lastModificationTime).format("yyyy-MM-DD HH:mm:ss")
: "" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
@ -50,10 +50,10 @@
<el-button class="deleteButton" @click="btnDel">删除</el-button> <el-button class="deleteButton" @click="btnDel">删除</el-button>
</div> </div>
<div style="margin-top: 5px"> <div style="margin-top: 5px">
<el-button class="commonbutton" @click="btnSetTop">置顶</el-button>
<el-button class="commonbutton" @click="btnSetTopOrBottom(1)">置顶</el-button>
</div> </div>
<div style="margin-top: 5px"> <div style="margin-top: 5px">
<el-button class="commonbutton" @click="btnSetBottom">置底</el-button>
<el-button class="commonbutton" @click="btnSetTopOrBottom(2)">置底</el-button>
</div> </div>
<div style="margin-top: 5px"> <div style="margin-top: 5px">
<el-button class="commonbutton" @click="btnSort" :disabled="!isDrag">保存排序</el-button> <el-button class="commonbutton" @click="btnSort" :disabled="!isDrag">保存排序</el-button>
@ -139,30 +139,13 @@ export default {
dddw, dddw,
deepCopy, deepCopy,
//
btnCopyPreGroup() {
if (!this.customerOrgRegister.id) {
this.$message.warning("请选择体检次数");
return;
}
postapi('/api/app/CustomerOrgGroup/CopyLastGrouping', { customerOrgRegisterId: this.customerOrgRegister.id })
.then(res => {
if (res.code > -1) {
//
this.getCustomerOrgGroup(this.customerOrgRegister.id);
}
})
},
// //
btnSort() { btnSort() {
const result = [];
let result = [];
this.commonTableTypes.forEach((item, index) => { this.commonTableTypes.forEach((item, index) => {
result.push({ id: item.id, displayOrder: index }); result.push({ id: item.id, displayOrder: index });
}); });
putapi("/api/app/customerorggroup/updatesortmany", {
postapi("/api/app/CommonTableType/UpdateSortMany", {
itemList: result, itemList: result,
}).then((res) => { }).then((res) => {
console.log("操作成功"); console.log("操作成功");
@ -172,27 +155,6 @@ export default {
//Sortable //Sortable
rowDrop() { rowDrop() {
// this.$nextTick(() => {
// const tbody = document.querySelector(".el-table__body-wrapper tbody");
// const _this = this;
// Sortable.create(tbody, {
// handle: ".move",
// animation: 300,
// onEnd({ newIndex, oldIndex }) {
// _this.isDrag = false;
// const currRow = _this.commonTableTypes.splice(oldIndex, 1)[0];
// _this.commonTableTypes.splice(newIndex, 0, currRow);
// _this.commonTableTypes.map((item, index) => {
// if (index == newIndex && index == oldIndex) {
// } else if (index == oldIndex) {
// } else if (index == newIndex) {
// }
// });
// console.log(_this.commonTableTypes.map((item) => item.displayOrder));
// },
// });
// });
this.$nextTick(() => { this.$nextTick(() => {
const el = document.querySelector(".el-table__body-wrapper tbody"); const el = document.querySelector(".el-table__body-wrapper tbody");
//console.log('el0',el) //console.log('el0',el)
@ -211,8 +173,8 @@ export default {
}); });
}, },
//
btnSetBottom() {
//
btnSetTopOrBottom(sortType) {
if (!this.dataTransOpts.tableS.common_table_type.id) { if (!this.dataTransOpts.tableS.common_table_type.id) {
this.$message.warning("请选择操作的数据"); this.$message.warning("请选择操作的数据");
return; return;
@ -220,32 +182,18 @@ export default {
let lfind = arrayExistObj(this.commonTableTypes, "id", this.dataTransOpts.tableS.common_table_type.id); let lfind = arrayExistObj(this.commonTableTypes, "id", this.dataTransOpts.tableS.common_table_type.id);
let currentRow = {}; let currentRow = {};
putapi(
`/api/app/customerorggroup/updatemanysort?id=${this.dataTransOpts.tableS.common_table_type.id}&SortType=2`
// ?id=${this.dataTransOpts.tableS.common_table_type.id}&SortType=2`
postapi('/api/app/CommonTableType/UpdateManySort', { commonTableTypeId: this.dataTransOpts.tableS.common_table_type.id, sortType }
).then((res) => { ).then((res) => {
console.log("操作成功"); console.log("操作成功");
currentRow = this.commonTableTypes.splice(lfind, 1)[0]; // currentRow = this.commonTableTypes.splice(lfind, 1)[0]; //
this.commonTableTypes.push(currentRow);
this.$refs["commonTableTypes"].setCurrentRow(currentRow);
});
},
//
btnSetTop() {
if (!this.dataTransOpts.tableS.common_table_type.id) {
this.$message.warning("请选择操作的数据");
return;
}
let lfind = arrayExistObj(this.commonTableTypes, "id", this.dataTransOpts.tableS.common_table_type.id);
let currentRow = {};
if (sortType == 2) {
this.commonTableTypes.push(currentRow);
} else {
this.commonTableTypes.unshift(currentRow);
}
putapi(
`/api/app/customerorggroup/updatemanysort?id=${this.dataTransOpts.tableS.common_table_type.id}&SortType=1`
).then((res) => {
console.log("操作成功");
currentRow = this.commonTableTypes.splice(lfind, 1)[0];
this.commonTableTypes.unshift(currentRow);
this.$refs["commonTableTypes"].setCurrentRow(currentRow); this.$refs["commonTableTypes"].setCurrentRow(currentRow);
}); });
}, },
@ -264,27 +212,11 @@ export default {
// //
dictInit() { dictInit() {
//
getapi("/api/app/customer-org/parent-all").then((res) => {
if (res.code != -1) {
this.customerOrgAll = res.data;
let lfind = arrayExistObj(this.customerOrgAll, "id", this.dict.personOrgId);
if (lfind > -1) this.customerOrgAll.splice(lfind, 1);
this.customerOrg = deepCopy(this.customerOrgAll);
}
});
//
getapi("/api/app/for-sex").then((res) => {
if (res.code != -1) {
this.dict.forSex = res.data;
}
});
// //
postapi("/api/app/MaritalStatus/GetForMaritalStatusList").then((res) => {
postapi("/api/app/CommonTableType/GetList").then((res) => {
if (res.code != -1) { if (res.code != -1) {
this.dict.forMaritalStatus = res.data;
this.commonTableTypes = res.data;
} }
}); });
}, },
@ -293,29 +225,25 @@ export default {
// //
rowClick(row) { rowClick(row) {
this.dataTransOpts.tableS.common_table_type.id = row.id this.dataTransOpts.tableS.common_table_type.id = row.id
this.curCommonTableType = deepCopy(row);
this.curCommonTableType.isComplete = this.customerOrgRegister.isComplete;
setTimeout(() => {
this.dataTransOpts.refresh.common_table.M++;
}, 20);
this.curCommonTableType = row;
this.dataTransOpts.refresh.common_table.M++;
}, },
// (id) // (id)
btnAdd(id) { btnAdd(id) {
if (!id) this.dataTransOpts.tableS.common_table_type.id = '' if (!id) this.dataTransOpts.tableS.common_table_type.id = ''
if (!id) this.dataTransOpts.refresh.common_table.M++; // if (!id) this.dataTransOpts.refresh.common_table.M++; //
this.CommonTableTypeEditParams = { this.CommonTableTypeEditParams = {
id id
} }
this.dataTransOpts.refresh.common_table_type.S++
this.dialogWin.CommonTableTypeEdit = true; this.dialogWin.CommonTableTypeEdit = true;
}, },
// //
btnEdit() { btnEdit() {
if (!this.dataTransOpts.tableS.common_table_type.id) { if (!this.dataTransOpts.tableS.common_table_type.id) {
this.$message.warning("请先选择体检分组");
this.$message.warning("请先选择分类记录");
return; return;
} }
this.btnAdd(this.dataTransOpts.tableS.common_table_type.id) this.btnAdd(this.dataTransOpts.tableS.common_table_type.id)
@ -327,10 +255,6 @@ export default {
this.$message.warning("请选择需要操作的数据"); this.$message.warning("请选择需要操作的数据");
return; return;
} }
if (this.customerOrgRegister.isComplete.toUpperCase() == "Y") {
this.$message.warning("该单位体检次数已完成,不允许删除分组");
return;
}
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "是", confirmButtonText: "是",
@ -338,7 +262,7 @@ export default {
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
return deletapi(`/api/app/customer-org-group/${this.dataTransOpts.tableS.common_table_type.id}`);
return postapi('/api/app/CommonTableType/Delete', { commonTableTypeId: this.dataTransOpts.tableS.common_table_type.id });
}) })
.then((res) => { .then((res) => {
if (res.code != -1) { if (res.code != -1) {
@ -346,9 +270,7 @@ export default {
let lfind = arrayExistObj(this.commonTableTypes, "id", this.dataTransOpts.tableS.common_table_type.id); let lfind = arrayExistObj(this.commonTableTypes, "id", this.dataTransOpts.tableS.common_table_type.id);
if (lfind > -1) this.commonTableTypes.splice(lfind, 1); if (lfind > -1) this.commonTableTypes.splice(lfind, 1);
this.dataTransOpts.tableS.common_table_type.id = '' this.dataTransOpts.tableS.common_table_type.id = ''
setTimeout(() => {
this.dataTransOpts.refresh.common_table.M++
}, 20);
this.dataTransOpts.refresh.common_table.M++
} }
}) })
.catch((err) => { .catch((err) => {
@ -360,69 +282,15 @@ export default {
}, },
madeNewGroupAsbitems(oldGroupAsbitems, newTotal) {
newTotal = Math.round(Number(newTotal) * 100) / 100;
let newGroupAsbitems = [];
let oldTotal = Number(0);
oldGroupAsbitems.forEach((e) => {
oldTotal += Number(e.asbitemMoney); //commonTableTypeDetailMoney
});
oldTotal = Math.round(Number(oldTotal) * 100) / 100;
let discount = 0;
if (oldTotal != 0) discount = Math.round((newTotal * 10000) / oldTotal) / 100;
oldTotal = Number(0);
oldGroupAsbitems.forEach((e) => {
e.commonTableTypeDetailPrice = Math.round(e.price * discount) / 100;
e.commonTableTypeDetailMoney =
Math.round(
e.commonTableTypeDetailPrice * e.commonTableTypeDetailAmount * 100
) / 100;
oldTotal += Number(e.commonTableTypeDetailMoney);
});
oldTotal = Math.round(Number(oldTotal) * 100) / 100;
//console.log('discount,oldTotal',discount,oldTotal)
let didTotal = Math.round(Number(newTotal - oldTotal) * 100) / 100;
if (didTotal != 0) {
for (let i = 0; i < oldGroupAsbitems.length; i++) {
if (oldGroupAsbitems[i].commonTableTypeDetailAmount == 1) {
oldGroupAsbitems[i].commonTableTypeDetailPrice =
Math.round(
(Number(oldGroupAsbitems[i].commonTableTypeDetailPrice) +
Number(didTotal)) *
100
) / 100;
break;
}
}
}
oldGroupAsbitems.forEach((e) => {
newGroupAsbitems.push({
commonTableTypeId: e.commonTableTypeId,
asbitemId: e.asbitemId,
price: e.commonTableTypeDetailPrice,
amount: e.commonTableTypeDetailAmount,
});
});
return newGroupAsbitems;
},
// / // /
close_dialogWinCommonTableTypeEdit() { close_dialogWinCommonTableTypeEdit() {
let id = this.dataTransOpts.tableS.common_table_type.id let id = this.dataTransOpts.tableS.common_table_type.id
if (id) { if (id) {
// //
getapi(`/api/app/customer-org-group/${id}`)
postapi('/api/app/CommonTableType/Get', { commonTableTypeId: id })
.then(res => { .then(res => {
if (res.code != -1) {
let lfind = -1
lfind = arrayExistObj(this.commonTableTypes, 'id', id)
if (res.code > -1) {
let lfind = arrayExistObj(this.commonTableTypes, 'id', id)
if (lfind > -1) { if (lfind > -1) {
objCopy(res.data, this.commonTableTypes[lfind]) objCopy(res.data, this.commonTableTypes[lfind])
} else { } else {
@ -436,7 +304,6 @@ export default {
// common_table // common_table
this.curCommonTableType = deepCopy(res.data); this.curCommonTableType = deepCopy(res.data);
this.curCommonTableType.isComplete = this.customerOrgRegister.isComplete;
} }
}) })
} else { } else {

1
src/store/index.js

@ -358,6 +358,7 @@ export default new Vuex.Store({
room: { S: 0, M: 0 }, // 房间 room: { S: 0, M: 0 }, // 房间
room_detail: { S: 0, M: 0 }, // 房间关联的组合项目 room_detail: { S: 0, M: 0 }, // 房间关联的组合项目
common_table: { S: 0, M: 0 }, // 公共表 common_table: { S: 0, M: 0 }, // 公共表
common_table_type: { S: 0, M: 0 }, // 公共表
}, },
//表当前数据(单条记录 S--single) //表当前数据(单条记录 S--single)

15
src/views/doctorCheck/lisResultImport.vue

@ -196,6 +196,7 @@ export default {
{ dispLabel: '标本号', val: 'sampleNo' }, { dispLabel: '标本号', val: 'sampleNo' },
{ dispLabel: '仪器通道', val: 'deviceChannel' }, { dispLabel: '仪器通道', val: 'deviceChannel' },
{ dispLabel: '检查时间', val: 'checkDate' }, { dispLabel: '检查时间', val: 'checkDate' },
{ dispLabel: '检查医生', val: 'checkDoctorName' },
{ dispLabel: '项目', val: 'itemName' }, { dispLabel: '项目', val: 'itemName' },
{ dispLabel: '结果', val: 'itemResult' } { dispLabel: '结果', val: 'itemResult' }
], ],
@ -747,13 +748,12 @@ export default {
((i + 1) * 100) / this.choosedData.length ((i + 1) * 100) / this.choosedData.length
); );
let res = await postapi('/api/app/patientregister/CreatePatientRegisterFromExcel', this.toApiBodys[i])
let res = await postapi('/api/app/ImportLisResult/ImportResultExcelByLisRequestNo', this.toApiBodys[i])
if (res.code >= 0) { if (res.code >= 0) {
this.tableData.push(Object.assign({ importState: '导入成功' }, this.toApiBodys[i])) this.tableData.push(Object.assign({ importState: '导入成功' }, this.toApiBodys[i]))
} else { } else {
this.tableData.push(Object.assign({ importState: '导入失败', importDes: res.message }, this.toApiBodys[i])) this.tableData.push(Object.assign({ importState: '导入失败', importDes: res.message }, this.toApiBodys[i]))
} }
} }
// //
@ -816,10 +816,12 @@ export default {
if (body.sampleNo == undefined) delete body.sampleNo if (body.sampleNo == undefined) delete body.sampleNo
let lfind = arrayExistObj(this.toApiBodys,'barcode',body.barcode) let lfind = arrayExistObj(this.toApiBodys,'barcode',body.barcode)
let detail = { itemName: body.itemName, itemResult: body.itemResult, checkDate: body.checkDate }
if(body.checkDoctorName) detail.checkDoctorName = body.checkDoctorName
if(lfind == -1){ if(lfind == -1){
this.toApiBodys.push(Object.assign({},body,{details:[{ itemName: body.itemName, itemResult: body.itemResult, checkDate: body.checkDate }]}))
this.toApiBodys.push(Object.assign({},body,{details:[detail]}))
}else{ }else{
this.toApiBodys[this.toApiBodys.length - 1].details.push({ itemName: body.itemName, itemResult: body.itemResult, checkDate: body.checkDate })
this.toApiBodys[this.toApiBodys.length - 1].details.push(detail)
} }
} else { } else {
// //
@ -831,6 +833,7 @@ export default {
sampleNo: ExcelData['标本号'], sampleNo: ExcelData['标本号'],
deviceChannel: ExcelData['仪器通道'], deviceChannel: ExcelData['仪器通道'],
checkDate: ExcelData['检查时间'], checkDate: ExcelData['检查时间'],
checkDoctorName: ExcelData['检查医生'],
details: [] details: []
} }
@ -862,7 +865,9 @@ export default {
// ] // ]
this.excelCols.forEach(e => { this.excelCols.forEach(e => {
if (!e.dataLabel && !e.val) { if (!e.dataLabel && !e.val) {
body.details.push({ itemName: e.dispLabel, itemResult: ExcelData[e.dispLabel], checkDate: body.checkDate })
let detail = { itemName: e.dispLabel, itemResult: ExcelData[e.dispLabel], checkDate: body.checkDate }
if(body.checkDoctorName) detail.checkDoctorName = body.checkDoctorName
body.details.push(detail)
} }
}) })
this.toApiBodys.push(body) this.toApiBodys.push(body)

Loading…
Cancel
Save