Browse Source

room

master
pengjun 1 year ago
parent
commit
47859cf4fc
  1. 60
      src/components/patientRegister/PatientRegisterList.vue
  2. 5
      src/components/report/BtnReport.vue
  3. 7
      src/components/report/PatientRegisterListNobtn.vue
  4. 762
      src/components/room/RoomAsbitem.vue
  5. 168
      src/components/room/RoomEdit.vue
  6. 233
      src/components/room/room.vue

60
src/components/patientRegister/PatientRegisterList.vue

@ -141,7 +141,10 @@
<el-button type="success" class="commonbutton" @click="btnAdd">人员登记</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '批量正式登记')" class="listBtn">
<el-button type="success" class="commonbutton" @click="btnAddBatch">批量正式登记</el-button>
<el-button type="success" class="commonbutton" @click="btnAddBatch('1')">批量正式登记</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '批量转预登记')" class="listBtn">
<el-button type="success" class="commonbutton" @click="btnAddBatch('0')">批量转预登记</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '编辑')" class="listBtn">
<el-button type="primary" class="commonbutton" @click="btnEdit">编辑</el-button>
@ -618,10 +621,11 @@ export default {
if (isPreview) {
this.$peisAPI.printPre(JSON.stringify(toOutShell))
.then(res => {
if (JSON.parse(res).code < 0) {
resolve(JSON.parse(res))
let lres = JSON.parse(res)
if (lres.code > -1) {
resolve(lres)
} else {
reject(JSON.parse(res).message)
reject(lres.message)
}
})
.catch((err) => {
@ -630,10 +634,11 @@ export default {
} else {
this.$peisAPI.print(JSON.stringify(toOutShell))
.then(res => {
if (JSON.parse(res).code > -1) {
let lres = JSON.parse(res)
if (lres.code > -1) {
return postapi("/api/app/patientregister/updatepatientregisterguideprinttimesmany", [row.id]);
} else {
reject(JSON.parse(res).message)
reject(lres.message)
}
})
.then(res => {
@ -662,10 +667,10 @@ export default {
return new Promise((resolve, reject) => {
this.guidePrintPromise("0008", false, row)
.then(res => {
return this.lisPrint(row,"0002",false)
return this.lisPrint(row, "0002", false)
})
.then(res => {
return this.pacsPrint(row,"0004",false)
return this.pacsPrint(row, "0004", false)
})
.then(res => {
resolve(res)
@ -677,7 +682,7 @@ export default {
},
async printPromise() {
async printPromise() {
if (this.multipleSelection.length < 1) {
this.$message.info({ showClose: true, message: "请勾选要打印人员检验检查条码的记录!" });
@ -829,7 +834,7 @@ export default {
},
//
btnAddBatch() {
btnAddBatch(completeFlag) {
let patientRegisterIds = []
// start
// this.multipleSelection = [];
@ -843,14 +848,25 @@ export default {
if (this.multipleSelection.length < 1) {
this.$message.info({ showClose: true, message: "请选择状态为预登记的记录!" });
this.$message.info({ showClose: true, message: "请勾选要操作的记录!" });
return;
}
this.multipleSelection.forEach(e => {
patientRegisterIds.push(e.id)
switch (completeFlag) {
case '0':
if(e.completeFlag == '1') patientRegisterIds.push(e.id)
break;
case '1':
if(e.completeFlag == '0') patientRegisterIds.push(e.id)
break;
}
});
let completeFlag = '1'
if(patientRegisterIds.length == 0){
this.$message.info({ showClose: true, message: "没有可操作的数据!" });
return;
}
let body = { completeFlag, patientRegisterIds }
postapi('/api/app/patientregister/updatepatientregistercompleteflagormedicalstartdate', body)
.then(res => {
@ -1036,7 +1052,7 @@ export default {
body.patientName = this.patientRegister.query.patientName;
if (this.patientRegister.query.medicalTypeIds && this.patientRegister.query.medicalTypeIds.length > 0)
body.medicalTypeIds = this.patientRegister.query.medicalTypeIds;
body.medicalTypeIds = this.patientRegister.query.medicalTypeIds;
if (this.patientRegister.query.completeFlags && this.patientRegister.query.completeFlags.length > 0)
body.completeFlags = this.patientRegister.query.completeFlags;
@ -1063,14 +1079,24 @@ export default {
body.phone = this.patientRegister.query.phone;
if (this.patientRegister.query.idCardNo)
body = { idNo: this.patientRegister.query.idCardNo };
body = {
idNo: this.patientRegister.query.idCardNo,
skipCount: this.loadOpts.skipCount,
maxResultCount: this.loadOpts.maxResultCount
};
if (this.patientRegister.query.patientNo)
body = { patientNo: this.patientRegister.query.patientNo };
body = {
patientNo: this.patientRegister.query.patientNo,
skipCount: this.loadOpts.skipCount,
maxResultCount: this.loadOpts.maxResultCount
};
if (this.patientRegister.query.patientRegisterNo)
body = {
patientRegisterNo: this.patientRegister.query.patientRegisterNo,
skipCount: this.loadOpts.skipCount,
maxResultCount: this.loadOpts.maxResultCount
};
// console.log("/api/app/patientregister/getlistinfilter", body);
@ -1382,7 +1408,7 @@ export default {
],
BusinessCode: row.id
};
console.log('this.$peisAPI.toOutShell',toOutShell)
console.log('this.$peisAPI.toOutShell', toOutShell)
if (isPreview) {
this.$peisAPI.printPre(JSON.stringify(toOutShell))
.then(res => {

5
src/components/report/BtnReport.vue

@ -162,13 +162,16 @@ export default {
} else {
//
e.isUpload = 'Y'
console.log('btnUpReport success', JSON.parse(res))
// console.log('btnUpReport success', JSON.parse(res))
}
} else {
let patientRegisterId = e.patientRegisterId
let res2 = await postapi('/api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId', { patientRegisterId })
if (res2.code == -1) {
console.log('TransToWebPeis err', res2)
}else{
//
e.isUploadAppoint = 'Y'
}
}

7
src/components/report/PatientRegisterListNobtn.vue

@ -16,7 +16,12 @@
<i class="el-icon-printer" v-if="scope.row.isReportPrint == 'Y'" style="font-size: 24px;color: green;"></i>
</template>
</el-table-column>
<el-table-column prop="isUpload" label="是否上传" align="center">
<el-table-column prop="isUploadAppoint" label="预约备单" align="center">
<template slot-scope="scope">
<div style="font-family: 'Microsoft YaHei';">{{ scope.row.isUploadAppoint == "Y" ? "√" : "" }}</div>
</template>
</el-table-column>
<el-table-column prop="isUpload" label="报告上传" align="center">
<template slot-scope="scope">
<div style="font-family: 'Microsoft YaHei';">{{ scope.row.isUpload == "Y" ? "√" : "" }}</div>
</template>

762
src/components/room/RoomAsbitem.vue
File diff suppressed because it is too large
View File

168
src/components/room/RoomEdit.vue

@ -18,7 +18,7 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="体检中心">
<el-form-item prop="medicalCenterId" label="体检中心">
<el-select v-model="form.medicalCenterId" placeholder="请选择" size="small" style="width:310px;">
<el-option v-for="item in dict.medicalCenter" :key="item.id" :label="item.displayName" :value="item.id">
</el-option>
@ -26,11 +26,10 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目类别">
<el-form-item prop="itemTypeId" label="项目类别">
<el-cascader :options="dict.itemTypeTree" v-model="form.itemTypeId" popper-class="example"
style="width:310px;"
:props="{ checkStrictly: true, expandTrigger: 'hover', label: 'displayName', value: 'id', id: 'id', children: 'treeChildren'}" clearable filterable
size="small">
style="width:310px;" filterable size="small"
:props="{ checkStrictly: true, expandTrigger: 'hover', label: 'displayName', value: 'id', id: 'id', children: 'treeChildren' }">
</el-cascader>
</el-form-item>
</el-col>
@ -59,7 +58,7 @@
<div style="display: flex;margin-top: 5px;justify-content:space-between;">
<div></div>
<div style="display: flex;">
<el-button class="commonbutton" @click="dialogWin.RommEdit = false">关闭</el-button>
<el-button class="commonbutton" @click="dialogWin.RoomEdit = false">关闭</el-button>
<!--
<el-button type="success" @click="computePrice">同比折算组合项目价格</el-button>
-->
@ -78,13 +77,13 @@ import {
deepCopy,
objCopy,
arrayExistObj,
tcdate
} from "../../utlis/proFunc";
import CustomerOrgGroupAsbitem from "../../components/customerOrg/customerOrgGroupAsbitem.vue";
export default {
components: {
CustomerOrgGroupAsbitem,
},
props: ["params"],
data() {
@ -124,14 +123,19 @@ export default {
moment, dddw, deepCopy,
//
dictInit() {
//
getapi("/api/app/customer-org/parent-all").then((res) => {
dictInit() {
//
getapi("/api/app/organization-units/by-code-all").then((res) => {
if (res.code > -1) {
this.dict.medicalCenter = res.data;
}
});
//
getapi("/api/app/item-type/by-code-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);
this.dict.itemTypeTree = res.data;
tcdate(this.dict.itemTypeTree);
}
});
@ -144,11 +148,11 @@ export default {
},
//
getFormData(id) {
if (id) {
getapi(`/api/app/customer-org-group/${id}`)
getFormData(roomId) {
if (roomId) {
postapi('/api/app/Room/Get', { roomId })
.then(res => {
if (res.code != -1) {
if (res.code > -1) {
this.form = deepCopy(res.data)
}
})
@ -169,143 +173,43 @@ export default {
let body = deepCopy(this.form);
body.roomId = body.id
if(Array.isArray(this.form.itemTypeId) && this.form.itemTypeId.length > 0){
if (Array.isArray(this.form.itemTypeId) && this.form.itemTypeId.length > 0) {
body.itemTypeId = this.form.itemTypeId[this.form.itemTypeId.length - 1]
}else{
} else {
body.itemTypeId = this.form.itemTypeId
}
if(!body.itemTypeId){
if (!body.itemTypeId) {
this.$message.warning("必须选择项目类别");
return false;
}
let url = "/api/app/Room/Create"
if (this.form.id) {
url = "/api/app/Room/Update"
}
postapi(url,body).then(res => {
if(res.code > -1){
this.dialogWin.RommEdit = false
this.dataTransOpts.refresh.room_detail.M++
}
})
});
},
//
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) {
if(!this.form.id){
this.form.id = res.data.id
}
this.dataTransOpts.tableS.room.id = this.form.id
this.dialogWin.RommEdit = 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: {
//
// "customerOrgGroup.id"(newVal, oldVal) {
// console.log("customerOrgGroup.id ",newVal,oldVal);
// if (newVal != oldVal) {
// this.getCustomerOrgGroupAsbitems(newVal);
// }
// },
watch: {
// ID
"dataTransOpts.refresh.room.S": {
// immediate: true,
handler(newVal, oldVal) {
console.log(`watch 体检分组 newVal:${newVal} oldVal:${oldVal} customerOrgGroupId: ${this.dataTransOpts.tableS.room.id}`);
this.getFormData(this.dataTransOpts.tableS.room.id);
if (newVal != oldVal) this.getFormData(this.dataTransOpts.tableS.room.id);
}
},
},

233
src/components/room/room.vue

@ -10,9 +10,8 @@
<div style="display: flex">
<div>
<span>体检中心</span>
<el-select v-model="medicalCenterId" placeholder="请选择体检中心"
default-first-option clearable filterable style="margin-left: 10px" @change="changeMedicalCenter"
size="small">
<el-select v-model="medicalCenterId" placeholder="请选择体检中心" default-first-option clearable filterable
style="margin-left: 10px" @change="changeMedicalCenter" size="small">
<el-option v-for="item in dict.medicalCenter" :key="item.id" :label="item.displayName" :value="item.id">
{{ item.displayName }}
</el-option>
@ -25,7 +24,7 @@
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column label="id" prop="id" min-width="200" align="center" />
<el-table-column prop="displayName" label="名称" min-width="150" />
<el-table-column v-if="!medicalCenterId" prop="medicalCenterId" label="体检中心" min-width="150">
<el-table-column v-show="!medicalCenterId" prop="medicalCenterId" label="体检中心" min-width="150">
<template slot-scope="scope">
{{ dddw(dict.medicalCenter, "id", scope.row.medicalCenterId, "displayName") }}
</template>
@ -46,7 +45,7 @@
</template>
</el-table-column>
<el-table-column prop="queueTime" label="候诊时间" min-width="80" align="center" />
<el-table-column prop="isActive" label="是否启用" min-width="80" align="center">
<el-table-column prop="isActive" label="启用" min-width="40" align="center">
<template slot-scope="scope">
<div style="font-family: 'Microsoft YaHei';">{{ scope.row.isActive == 'Y' ? '√' : '' }}</div>
</template>
@ -83,10 +82,10 @@
<el-button class="deleteButton" @click="btnDel">删除</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '置顶')" style="margin-top: 5px">
<el-button class="commonbutton" @click="btnSetTop">置顶</el-button>
<el-button class="commonbutton" @click="btnSetBottomOrTop(1)">置顶</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '置底')" style="margin-top: 5px">
<el-button class="commonbutton" @click="btnSetBottom">置底</el-button>
<el-button class="commonbutton" @click="btnSetBottomOrTop(2)">置底</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '保存排序')" style="margin-top: 5px">
<el-button class="commonbutton" @click="btnSort" :disabled="!isDrag">保存排序</el-button>
@ -96,12 +95,12 @@
<!--分组项目信息 -->
<div>
<RoomAsbitem :customerOrgGroup="curCustomerOrgGroup" :refreshMoney="refreshMoney" />
<RoomAsbitem :room="curRoom" />
</div>
</div>
<!-- 新增或者编辑弹框 -->
<el-dialog :title="dataTransOpts.tableS.customer_org_group.id ? '编辑' : '新增'" :close-on-click-modal="false"
<el-dialog :title="dataTransOpts.tableS.room.id ? '编辑' : '新增'" :close-on-click-modal="false"
:visible.sync="dialogWin.RoomEdit" width="800px" @close="close_dialogWinRoomEdit">
<RoomEdit :params="RoomEditParams" />
</el-dialog>
@ -138,38 +137,22 @@ export default {
},
tableData: [], //
customerOrgId: "", //id
customerOrgRegisterList: [], //
customerOrgRegister: {}, //
curCustomerOrgGroup: {}, //
RoomEditParams: {}, //
curRoom: {}, //
RoomEditParams: {}, //
medicalCenterId: "", //
isDrag: false,
form: {
//
customerOrgId: "", //()
isComplete: "N", //
id: "",
medicalCenterId: null, //
displayName: "",
price: 0,
itemTypeId: "",
medicalCenterId: "",
forSexId: "A",
maritalStatusId: "A",
ageLowerLimit: 0,
ageUpperLimit: 200,
jobPost: "",
jobTitle: "",
remark: "",
isMaxMedicalTimes: "N",
roomTypeFlag: "0",
queueTime: 0,
isActive: "Y"
},
formOri: {}, //
formInit: {}, //
rules: {
displayName: [{ required: true, message: "请填写分组名称", trigger: "blur" }],
},
};
},
computed: {
@ -211,7 +194,7 @@ export default {
this.tableData.forEach((item, index) => {
result.push({ id: item.id, displayOrder: index });
});
putapi("/api/app/customerorggroup/updatesortmany", {
postapi("/api/app/Room/updatesortmany", {
itemList: result,
}).then((res) => {
console.log("操作成功");
@ -221,26 +204,6 @@ export default {
//Sortable
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.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.tableData.map((item) => item.displayOrder));
// },
// });
// });
this.$nextTick(() => {
const el = document.querySelector(".el-table__body-wrapper tbody");
@ -260,45 +223,36 @@ export default {
});
},
//
btnSetBottom() {
if (!this.dataTransOpts.tableS.customer_org_group.id) {
//
btnSetBottomOrTop(sortType) {
if (!this.dataTransOpts.tableS.room.id) {
this.$message.warning("请选择操作的数据");
return;
}
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.tableData.splice(lfind, 1)[0]; //
this.tableData.push(currentRow);
this.$refs["tableData"].setCurrentRow(currentRow);
});
},
//
btnSetTop() {
if (!this.dataTransOpts.tableS.customer_org_group.id) {
this.$message.warning("请选择操作的数据");
return;
let body = {
roomId: this.dataTransOpts.tableS.room.id,
sortType
}
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.tableData.splice(lfind, 1)[0];
this.tableData.unshift(currentRow);
this.$refs["tableData"].setCurrentRow(currentRow);
});
postapi('/api/app/Room/UpdateManySort', body)
.then((res) => {
if (res.code > -1) {
console.log("操作成功");
let lfind = arrayExistObj(this.tableData, "id", body.roomId);
if (lfind > -1) {
let currentRow = {};
currentRow = this.tableData.splice(lfind, 1)[0]; //
if (sortType == 2) {
this.tableData.push(currentRow);
} else {
this.tableData.unshift(currentRow);
}
this.$refs["tableData"].setCurrentRow(currentRow);
}
}
});
},
//
handleRowClassName({ row, rowIndex }) {
// highLightBg 'selected'
@ -339,6 +293,8 @@ export default {
//
getRoom(medicalCenterId) {
this.dataTransOpts.tableS.room.id = ""
this.curRoom = {}
this.isDrag = false;
objCopy(this.formInit, this.form);
this.form.medicalCenterId = medicalCenterId;
@ -352,7 +308,7 @@ export default {
});
},
//
//
changeMedicalCenter(v) {
// console.log('changeMedicalCenter', v)
this.getRoom(v)
@ -360,21 +316,18 @@ export default {
//
rowClick(row) {
this.dataTransOpts.tableS.customer_org_group.id = row.id
this.curCustomerOrgGroup = deepCopy(row);
this.curCustomerOrgGroup.isComplete = this.customerOrgRegister.isComplete;
setTimeout(() => {
this.dataTransOpts.refresh.customer_org_group_detail.M++;
}, 20);
this.curRoom = row
this.dataTransOpts.tableS.room.id = row.id
this.dataTransOpts.refresh.room_detail.M++;
},
// (id)
btnAdd(id) {
if (!id) this.dataTransOpts.tableS.room.id = ''
this.dataTransOpts.refresh.room.S++
if (!id) this.dataTransOpts.refresh.room_detail.M++; //
this.RoomEditParams = {
medicalCenterId: this.medicalCenterId
}
@ -383,23 +336,19 @@ export default {
//
btnEdit() {
if (!this.dataTransOpts.tableS.customer_org_group.id) {
this.$message.warning("请先选择体检分组");
if (!this.dataTransOpts.tableS.room.id) {
this.$message.warning("请先选择分诊叫号房间");
return;
}
this.btnAdd(this.dataTransOpts.tableS.customer_org_group.id)
this.btnAdd(this.dataTransOpts.tableS.room.id)
},
//
btnDel() {
if (!this.dataTransOpts.tableS.customer_org_group.id) {
if (!this.dataTransOpts.tableS.room.id) {
this.$message.warning("请选择需要操作的数据");
return;
}
if (this.customerOrgRegister.isComplete.toUpperCase() == "Y") {
this.$message.warning("该单位体检次数已完成,不允许删除分组");
return;
}
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "是",
@ -407,17 +356,15 @@ export default {
type: "warning",
})
.then(() => {
return deletapi(`/api/app/customer-org-group/${this.dataTransOpts.tableS.customer_org_group.id}`);
return postapi('/api/app/Room/Delete', { roomId: this.dataTransOpts.tableS.room.id });
})
.then((res) => {
if (res.code != -1) {
console.log("删除成功");
let lfind = arrayExistObj(this.tableData, "id", this.dataTransOpts.tableS.customer_org_group.id);
let lfind = arrayExistObj(this.tableData, "id", this.dataTransOpts.tableS.room.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++
}, 20);
this.dataTransOpts.tableS.room.id = ''
this.dataTransOpts.refresh.room_detail.M++
}
})
.catch((err) => {
@ -428,66 +375,12 @@ 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); //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;
},
// /
close_dialogWinRoomEdit() {
let id = this.dataTransOpts.tableS.customer_org_group.id
let id = this.dataTransOpts.tableS.room.id
if (id) {
//
getapi(`/api/app/customer-org-group/${id}`)
postapi('/api/app/Room/Get', { roomId:id })
.then(res => {
if (res.code != -1) {
let lfind = -1
@ -504,16 +397,18 @@ export default {
this.$refs["tableData"].setCurrentRow(this.tableData[lfind]);
// customer_org_group_detail
this.curCustomerOrgGroup = deepCopy(res.data);
this.curCustomerOrgGroup.isComplete = this.customerOrgRegister.isComplete;
this.curRoom = deepCopy(res.data);
this.dataTransOpts.refresh.room_detail.M++;
}
})
} else {
//
this.dataTransOpts.tableS.customer_org_group.id = this.curCustomerOrgGroup.id || ''
this.dataTransOpts.tableS.room.id = this.curRoom.id || ''
this.dataTransOpts.refresh.room_detail.M++;
}
this.dataTransOpts.refresh.customer_org_group_detail.M++;
},
},
};

Loading…
Cancel
Save