+
新增
@@ -123,6 +120,7 @@ import {
deepCopy,
objCopy,
arrayExistObj,
+ tcdate,
} from "../../utlis/proFunc";
import RoomAsbitem from "./RoomAsbitem.vue";
@@ -138,14 +136,15 @@ export default {
routeUrlorPageName: "customerOrgGroup", //当前页面归属路由或归属页面权限名称
privs: [], // 页面权限
},
- customerOrg: [], //体检单位
- customerOrgGroups: [], //体检单位分组
+
+ tableData: [], //体检单位分组
customerOrgId: "", //当前选中的体检单位id
customerOrgRegisterList: [], //体检次数列表
customerOrgRegister: {}, //体检次数
curCustomerOrgGroup: {}, // 当前选中分组
RoomEditParams: {}, //分组 新增时 用到参数
+ medicalCenterId: "", // 体检中心
isDrag: false,
form: {
@@ -153,7 +152,7 @@ export default {
customerOrgId: "", //复制分组时用到(预留查历次分组)
isComplete: "N", //体检次数是否完成,如完成不允许调整分组项目
id: "",
- customerOrgRegisterId: null, //所属体检次数
+ medicalCenterId: null, //所属体检次数
displayName: "",
price: 0,
forSexId: "A",
@@ -191,40 +190,25 @@ export default {
mounted() {
//获取初始数据(单位、适用性别)
this.dictInit();
+
+ this.getRoom()
},
methods: {
moment,
checkPagePriv,
dddw,
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);
- }
- })
- },
-
//刷新分组价格(供子组件调用)
refreshMoney(formData) {
//console.log('this is parent')
- let lfind = arrayExistObj(this.customerOrgGroups, "id", formData.id);
- if (lfind > -1) this.customerOrgGroups[lfind].price = formData.price;
+ let lfind = arrayExistObj(this.tableData, "id", formData.id);
+ if (lfind > -1) this.tableData[lfind].price = formData.price;
},
//确定排序
btnSort() {
const result = [];
- this.customerOrgGroups.forEach((item, index) => {
+ this.tableData.forEach((item, index) => {
result.push({ id: item.id, displayOrder: index });
});
putapi("/api/app/customerorggroup/updatesortmany", {
@@ -245,15 +229,15 @@ export default {
// animation: 300,
// onEnd({ newIndex, oldIndex }) {
// _this.isDrag = false;
- // const currRow = _this.customerOrgGroups.splice(oldIndex, 1)[0];
- // _this.customerOrgGroups.splice(newIndex, 0, currRow);
- // _this.customerOrgGroups.map((item, index) => {
+ // const currRow = _this.tableData.splice(oldIndex, 1)[0];
+ // _this.tableData.splice(newIndex, 0, currRow);
+ // _this.tableData.map((item, index) => {
// if (index == newIndex && index == oldIndex) {
// } else if (index == oldIndex) {
// } else if (index == newIndex) {
// }
// });
- // console.log(_this.customerOrgGroups.map((item) => item.displayOrder));
+ // console.log(_this.tableData.map((item) => item.displayOrder));
// },
// });
// });
@@ -268,8 +252,8 @@ export default {
//拖拽结束
onEnd({ newIndex, oldIndex }) {
that.isDrag = true;
- const currRow = that.customerOrgGroups.splice(oldIndex, 1)[0];
- that.customerOrgGroups.splice(newIndex, 0, currRow);
+ const currRow = that.tableData.splice(oldIndex, 1)[0];
+ that.tableData.splice(newIndex, 0, currRow);
console.log("el", el);
},
});
@@ -282,16 +266,16 @@ export default {
this.$message.warning("请选择操作的数据");
return;
}
- let lfind = arrayExistObj(this.customerOrgGroups, "id", this.dataTransOpts.tableS.customer_org_group.id);
+ let lfind = arrayExistObj(this.tableData, "id", this.dataTransOpts.tableS.customer_org_group.id);
let currentRow = {};
putapi(
`/api/app/customerorggroup/updatemanysort?id=${this.dataTransOpts.tableS.customer_org_group.id}&SortType=2`
).then((res) => {
console.log("操作成功");
- currentRow = this.customerOrgGroups.splice(lfind, 1)[0]; //删除并赋值
- this.customerOrgGroups.push(currentRow);
- this.$refs["customerOrgGroups"].setCurrentRow(currentRow);
+ currentRow = this.tableData.splice(lfind, 1)[0]; //删除并赋值
+ this.tableData.push(currentRow);
+ this.$refs["tableData"].setCurrentRow(currentRow);
});
},
@@ -302,16 +286,16 @@ export default {
return;
}
- let lfind = arrayExistObj(this.customerOrgGroups, "id", this.dataTransOpts.tableS.customer_org_group.id);
+ let lfind = arrayExistObj(this.tableData, "id", this.dataTransOpts.tableS.customer_org_group.id);
let currentRow = {};
putapi(
`/api/app/customerorggroup/updatemanysort?id=${this.dataTransOpts.tableS.customer_org_group.id}&SortType=1`
).then((res) => {
console.log("操作成功");
- currentRow = this.customerOrgGroups.splice(lfind, 1)[0];
- this.customerOrgGroups.unshift(currentRow);
- this.$refs["customerOrgGroups"].setCurrentRow(currentRow);
+ currentRow = this.tableData.splice(lfind, 1)[0];
+ this.tableData.unshift(currentRow);
+ this.$refs["tableData"].setCurrentRow(currentRow);
});
},
@@ -335,7 +319,7 @@ export default {
this.dict.medicalCenter = res.data;
}
});
-
+
// 项目类别 树结构
getapi("/api/app/item-type/by-code-all").then((res) => {
if (res.code != -1) {
@@ -350,55 +334,31 @@ export default {
this.dict.forSex = res.data;
}
});
-
+
},
- //获取体检次数下的分组
- getCustomerOrgGroup(customerOrgRegisterId) {
+ //获取房间列表
+ getRoom(medicalCenterId) {
this.isDrag = false;
objCopy(this.formInit, this.form);
- this.form.customerOrgRegisterId = customerOrgRegisterId;
- this.customerOrgGroups = [];
- getapi(
- `/api/app/customerorggroup/getlistinfilter?CustomerOrgRegisterId=${customerOrgRegisterId}`
- ).then((res) => {
- if (res.code != -1) {
- this.customerOrgGroups = res.data;
- this.customerOrgGroups.forEach((e) => {
- e.customerOrgRegisterId = customerOrgRegisterId;
+ this.form.medicalCenterId = medicalCenterId;
+ this.tableData = [];
+ postapi('/api/app/Room/GetList').then((res) => {
+ if (res.code > -1) {
+ this.tableData = res.data.filter(e => {
+ return medicalCenterId ? (e.medicalCenterId == medicalCenterId) : e
});
}
});
},
- filterMethod(keyWords) {
- if (keyWords) {
- this.customerOrg = [];
- this.customerOrgAll.forEach((item) => {
- if (
- item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > -1 ||
- item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > -1
- // || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
- ) {
- this.customerOrg.push(item);
- }
- });
- } else {
- this.customerOrg = deepCopy(this.customerOrgAll);
- }
- },
-
- //选择体检中心
+ //选择体检中心
changeMedicalCenter(v) {
- console.log('changeMedicalCenter',v)
+ // console.log('changeMedicalCenter', v)
+ this.getRoom(v)
},
- //选择体检次数
- changeTimes(v) {
- this.getCustomerOrgGroup(v.id);
- },
-
- //点击分组
+ //点击房间
rowClick(row) {
this.dataTransOpts.tableS.customer_org_group.id = row.id
this.curCustomerOrgGroup = deepCopy(row);
@@ -410,26 +370,14 @@ export default {
// 新增(编辑调用时,传入id值) 弹框
btnAdd(id) {
- if (!this.customerOrgRegister.id) {
- this.$message.warning("请选择体检次数");
- return;
- }
-
- if (this.customerOrgRegister.isComplete.toUpperCase() == "Y") {
- this.$message.warning(`该单位的该次体检次数已完成,不能再${id ? '编辑' : '新增'}分组!`);
- return;
- }
- if (!id) this.dataTransOpts.tableS.customer_org_group.id = ''
- setTimeout(() => {
- this.dataTransOpts.refresh.customer_org_group.S++
- if (!id) this.dataTransOpts.refresh.customer_org_group_detail.M++; //新增则清掉已选组合项目
- }, 20);
-
+ if (!id) this.dataTransOpts.tableS.room.id = ''
+
+ this.dataTransOpts.refresh.room.S++
+ if (!id) this.dataTransOpts.refresh.room_detail.M++; //新增则清掉已选组合项目
+
this.RoomEditParams = {
- customerOrgRegisterId: this.customerOrgRegister.id,
- customerOrgId: this.customerOrgId
+ medicalCenterId: this.medicalCenterId
}
-
this.dialogWin.RoomEdit = true;
},
@@ -464,8 +412,8 @@ export default {
.then((res) => {
if (res.code != -1) {
console.log("删除成功");
- let lfind = arrayExistObj(this.customerOrgGroups, "id", this.dataTransOpts.tableS.customer_org_group.id);
- if (lfind > -1) this.customerOrgGroups.splice(lfind, 1);
+ let lfind = arrayExistObj(this.tableData, "id", this.dataTransOpts.tableS.customer_org_group.id);
+ if (lfind > -1) this.tableData.splice(lfind, 1);
this.dataTransOpts.tableS.customer_org_group.id = ''
setTimeout(() => {
this.dataTransOpts.refresh.customer_org_group_detail.M++
@@ -480,52 +428,7 @@ export default {
});
},
- //计算总价
- computePrice() {
- if (!this.form.id) {
- this.$message.warning("尚未保存信息,不可执行此操作!");
- return;
- }
- let customerOrgGroupId = this.form.id;
- let RoomAsbitems = []; //分组包含的套餐
- getapi(`/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${customerOrgGroupId}
- `)
- .then((res) => {
- if (res.code != -1) {
- RoomAsbitems = res.data;
-
- if (RoomAsbitems.length < 1) {
- this.$message.warning("当前分组尚未设置组合项目,不可执行此操作!");
- } else {
- let body = {
- customerOrgGroupId,
- details: this.madeNewGroupAsbitems(
- RoomAsbitems,
- this.form.price
- ),
- };
- console.log("body", body);
- return postapi(
- "/api/app/customerorggroupdetail/createcustomerorggroupdetailmany",
- body
- );
- }
- }
- })
- .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;
@@ -588,17 +491,17 @@ export default {
.then(res => {
if (res.code != -1) {
let lfind = -1
- lfind = arrayExistObj(this.customerOrgGroups, 'id', id)
+ lfind = arrayExistObj(this.tableData, 'id', id)
if (lfind > -1) {
- objCopy(res.data, this.customerOrgGroups[lfind])
+ objCopy(res.data, this.tableData[lfind])
} else {
- lfind = this.customerOrgGroups.length
- this.customerOrgGroups.push(res.data)
+ lfind = this.tableData.length
+ this.tableData.push(res.data)
}
// 选中当前操作的列
- this.$refs["customerOrgGroups"].setCurrentRow(); //清除选择
- this.$refs["customerOrgGroups"].setCurrentRow(this.customerOrgGroups[lfind]);
+ this.$refs["tableData"].setCurrentRow(); //清除选择
+ this.$refs["tableData"].setCurrentRow(this.tableData[lfind]);
// 更新 customer_org_group_detail 参数
this.curCustomerOrgGroup = deepCopy(res.data);
diff --git a/src/store/index.js b/src/store/index.js
index ab9f73c..16adf8a 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -348,8 +348,11 @@ export default new Vuex.Store({
sum_diagnosis: { S: 0, M: 0 }, // 总检诊断
sumDoctor: { S: 0, M: 0 }, // 总检--综述 触发强制刷新 (sumDoctor.M 合并包含:综述、建议、对比、历史等,不包含总检诊断)
+ room: { S: 0, M: 0 }, // 房间
+ room_detail: { S: 0, M: 0 }, // 房间关联的组合项目
},
+
//表当前数据(单条记录 S--single)
tableS: {
adp_roles: { id: '' }, // 角色
@@ -383,6 +386,8 @@ export default new Vuex.Store({
isOccSummary: 'N', // 修改总检结论
},
appoint_patient_register: {}, // 预约登记数据
+ room: { id: '' }, // 房间
+ room_detail: { id: '' }, // 房间关联组合项目
},
//表当前数据(多条记录 M--more)
@@ -412,6 +417,8 @@ export default new Vuex.Store({
patient_past_medical_history: [], // 既往病史
patient_occupational_medical_history: [], // 职业病史
appoint_register_asbitem: [], // 预约所选组合项目
+ room: [], // 房间
+ room_detail: [], // 房间关联组合项目
},
plus: {
PatientRegisterEditQuery: 0, // 更新查询条件
@@ -443,6 +450,7 @@ export default new Vuex.Store({
Label: false, // 补打条码
WebBooking: false, // 网上预约
ImportOrgData: false, // 导入企业(青藏公司)数据
+ RoomEdit:false, //房间
}
},