diff --git a/src/components/room/RoomEdit.vue b/src/components/room/RoomEdit.vue index 8ff039d..fe976df 100644 --- a/src/components/room/RoomEdit.vue +++ b/src/components/room/RoomEdit.vue @@ -2,19 +2,14 @@
- - + + - - - - - - + - + @@ -22,46 +17,41 @@ - - - - + + + + - - - - - - - - + + + + - - + + + + + - - + + - - - - - - - - - + + @@ -69,7 +59,7 @@
- 关闭 + 关闭 @@ -100,27 +90,20 @@ export default { data() { return { form: { - //体检单位分组 - customerOrgId: "", //复制分组时用到(预留查历次分组) - isComplete: "N", //体检次数是否完成,如完成不允许调整分组项目 id: "", - customerOrgRegisterId: null, //所属体检次数 displayName: "", - price: 0, + itemTypeId: "", + medicalCenterId: "", forSexId: "A", - maritalStatusId: "A", - ageLowerLimit: 0, - ageUpperLimit: 200, - canAddMoney:0, - jobPost: "", - jobTitle: "", - remark: "", - isMaxMedicalTimes: "N", + roomTypeFlag: "0", + queueTime: 0, + isActive: "Y" }, - formOri: {}, //用于对比分析哪些信息更改了(主要是价格) formInit: {}, //表单初始值 rules: { - displayName: [{ required: true, message: "请填写分组名称", trigger: "blur" }], + displayName: [{ required: true, message: "请填写房间名称", trigger: "blur" }], + itemTypeId: [{ required: true, message: "请填写项目类别", trigger: "blur" }], + medicalCenterId: [{ required: true, message: "请填写体检中心", trigger: "blur" }], }, }; }, @@ -135,7 +118,7 @@ export default { mounted() { // 获取初始数据(单位、适用性别) this.dictInit(); - this.getFormData(this.dataTransOpts.tableS.customer_org_group.id); + this.getFormData(this.dataTransOpts.tableS.room.id); }, methods: { moment, dddw, deepCopy, @@ -166,15 +149,12 @@ export default { getapi(`/api/app/customer-org-group/${id}`) .then(res => { if (res.code != -1) { - this.formOri = deepCopy(res.data) this.form = deepCopy(res.data) } }) } else { - console.log('this.formInit',this.formInit) this.form = deepCopy(this.formInit) - this.form.customerOrgId = this.params.customerOrgId - this.form.customerOrgRegisterId = this.params.customerOrgRegisterId + this.form.medicalCenterId = this.params.medicalCenterId } }, @@ -186,84 +166,30 @@ export default { return false; } - if (!this.form.id && !this.form.customerOrgRegisterId) { - this.$message.warning("请选择单位体检次数!"); - return false; - } - let body = deepCopy(this.form); - delete body.id; - delete body.customerOrgId; - delete body.isComplete; + body.roomId = body.id + if(Array.isArray(this.form.itemTypeId) && this.form.itemTypeId.length > 0){ + body.itemTypeId = this.form.itemTypeId[this.form.itemTypeId.length - 1] + }else{ + body.itemTypeId = this.form.itemTypeId + } + if(!body.itemTypeId){ + this.$message.warning("必须选择项目类别"); + return false; + } + + let url = "/api/app/Room/Create" 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("保存分组成功!"); - // 价格是否有调整 - if (this.formOri.price != this.form.price) { - return getapi(`/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${customerOrgGroupId}`); - } else { - this.dialogWin.CustomerOrgGroupEdit = false; - } - } - }) - .then((res) => { - if (res && res.code != -1) { - customerOrgGroupAsbitems = res.data; - if (customerOrgGroupAsbitems.length < 1) { - console.log("该分组暂没有组合项目!"); - this.dialogWin.CustomerOrgGroupEdit = false; - } else { - let detailsBody = { - customerOrgGroupId, - details: this.madeNewGroupAsbitems(customerOrgGroupAsbitems, this.form.price), - }; - return postapi("/api/app/customerorggroupdetail/createcustomerorggroupdetailmany", detailsBody); - } - } - }) - .then((res) => { - if (res && res.code != -1) { - console.log("操作成功!并自动按总价同比折算组合项目价格!"); - this.dialogWin.CustomerOrgGroupEdit = false; - // 刷新明细 - let id = this.form.id; - this.form.id = ""; - setTimeout(() => { - this.form.id = id; - }, 100); - } - }); - */ - // 合并事务更新明细金额 - 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 - } - }) - - } 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.CustomerOrgGroupEdit = false; - } - }); + url = "/api/app/Room/Update" } + + postapi(url,body).then(res => { + if(res.code > -1){ + this.dialogWin.RommEdit = false + this.dataTransOpts.refresh.room_detail.M++ + } + }) }); }, @@ -375,11 +301,11 @@ export default { // }, // 体检分组ID未切换换时 也可以强制刷新数据 - "dataTransOpts.refresh.customer_org_group.S": { + "dataTransOpts.refresh.room.S": { // immediate: true, 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} customerOrgGroupId: ${this.dataTransOpts.tableS.room.id}`); + this.getFormData(this.dataTransOpts.tableS.room.id); } }, }, diff --git a/src/components/room/room.vue b/src/components/room/room.vue index 70cea37..693a643 100644 --- a/src/components/room/room.vue +++ b/src/components/room/room.vue @@ -10,54 +10,54 @@
体检中心: - + {{ item.displayName }} -
+
- + - - - + + + + + + - + - + - - - + + + - + - - number($double) - - - string - +