Browse Source

增加关闭弹出框提示

canclder-fix-1212
zq 5 days ago
parent
commit
b71922624c
  1. 147
      src/views/HomeView.vue

147
src/views/HomeView.vue

@ -81,7 +81,7 @@
<el-table-column prop="create" label="时间" min-width="250"> </el-table-column> <el-table-column prop="create" label="时间" min-width="250"> </el-table-column>
<el-table-column prop="stock" fixed="right" min-width="110"> <el-table-column prop="stock" fixed="right" min-width="110">
<template slot-scope="scope"> <template slot-scope="scope">
<GuipSwitch :value="scope.row.status" active-value="1" inactive-value="0" @change="onSwitchChange1(scope.row)"></GuipSwitch> <GuipSwitch :value="scope.row.status" active-value="1" inactive-value="0" @change="onSwitchChange1(scope.row,item.departs)"></GuipSwitch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" min-width="120px"> <el-table-column label="操作" fixed="right" min-width="120px">
@ -96,6 +96,12 @@
</div> </div>
</el-form> </el-form>
</div> </div>
<GuipDialog :dialogVisible="dialogVisible" :title='`确认禁用"${curTitle}"`' :show-close-button="true" width="599px"
:show-cancel-button="true" @confirm="handleConfirm" @cancel="handleCancel" @close="handleClose"
confirmText="确认禁用">
<p class="diaDesc">1.该医院的出诊安排将被清空再次开启需重新设置</p>
<p class="diaDesc">2.该院在 12月30日1月8日4月20日共有8位已预约患者禁用后请务必做好线下协调</p>
</GuipDialog>
</div> </div>
</template> </template>
<script> <script>
@ -106,6 +112,7 @@ import GuipTable from '@/components/GuipTable.vue';
import GuipButton from '@/components/GuipButton.vue'; import GuipButton from '@/components/GuipButton.vue';
import GuipSwitch from '@/components/GuipSwitch.vue'; import GuipSwitch from '@/components/GuipSwitch.vue';
import GuipInput from '@/components/GuipInput.vue'; import GuipInput from '@/components/GuipInput.vue';
import GuipDialog from '@/components/GuipDialog.vue';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import PaymentMethod from '@/views/paymentMethod.vue'; import PaymentMethod from '@/views/paymentMethod.vue';
@ -113,6 +120,7 @@ export default {
props:['onlyHosFlag'], props:['onlyHosFlag'],
data() { data() {
return { return {
dialogVisible: false,//
list: { list: {
approver_phone: "", approver_phone: "",
code: "", code: "",
@ -148,12 +156,15 @@ export default {
pageShow:false, pageShow:false,
doctorIds:[], doctorIds:[],
payList:false, payList:false,
issuper:false issuper:false,
curStatusInfo:{},
curTitle:''
} }
}, },
components: { components: {
// GuipToolTip, // GuipToolTip,
// SvgIcon, // SvgIcon,
GuipDialog,
GuipInput, GuipInput,
GuipButton, GuipButton,
GuipSwitch, GuipSwitch,
@ -229,6 +240,74 @@ export default {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
//
handleConfirm() {
if (this.curStatusInfo) {
//
this.changeDepartStatus(
this.curStatusInfo.row,
this.curStatusInfo.departs,
this.curStatusInfo.originalStatus
);
this.dialogVisible = false;
}
},
//
handleCancel() {
if (this.curStatusInfo) {
//
this.curStatusInfo.row.status = this.curStatusInfo.originalStatus;
this.dialogVisible = false;
//
this.curStatusInfo = null;
}
},
//
handleClose() {
if (this.curStatusInfo) {
//
this.curStatusInfo.row.status = this.curStatusInfo.originalStatus;
this.dialogVisible = false;
//
this.curStatusInfo = null;
}
},
changeDepartStatus(row, departs, originalStatus) {
console.log(
row, departs, originalStatus
);
const targetStatus = originalStatus == '1' ? '0' : '1';
//
this.$http('POST', '/api/admin/depart_mutil_option', {
depart_index_ids: row.id,
status: targetStatus
}).then(response => {
if (response.code == 0) {
this.$message.success(response.msg);
//
row.status = targetStatus;
} else {
this.$message.error(response.msg);
//
row.status = originalStatus;
}
//
// this.getInitData();
}).catch(error => {
console.error(error, 'error');
this.$message.error('操作失败');
//
row.status = originalStatus;
});
//
this.curStatusInfo = null;
},
inputBlur(val) { inputBlur(val) {
console.log(val, ''); console.log(val, '');
this.getInitData() this.getInitData()
@ -308,26 +387,47 @@ export default {
item.removeAttribute('aria-hidden') item.removeAttribute('aria-hidden')
}) })
}, },
onSwitchChange1(row) { onSwitchChange1(row, departs) {
// console.log(row, '------flag'); this.curTitle = row.hispital_name
row.status = row.status == 0 ? 1 : 0; console.log(row.status, '------flag');
this.$http('POST', '/api/admin/depart_mutil_option', { const originalStatus = row.status;
depart_index_ids:row.id, // (1)(0)
status:row.status if (originalStatus == '1') {
}).then(response => { row.status = '0';
if (response.code == 0) { this.curStatusInfo = {
this.$message.success(response.msg); row: row,
departs: departs,
originalStatus: originalStatus,
targetStatus: '0'
};
this.dialogVisible = true;
} else { } else {
this.$message.error(response.msg); //
this.changeDepartStatus(row, departs, originalStatus);
} }
this.getInitData()
}).catch(error => {
console.error(error, 'error')
this.$message.error('操作失败');
})
this.$set(this.doctorList, row)
}, },
// onSwitchChange1(row) {
// this.dialogVisible = true;
// row.status = row.status == 0 ? 1 : 0;
// console.log(row, '------flag');
// this.curStatusInfo = row;
// // this.$http('POST', '/api/admin/depart_mutil_option', {
// // depart_index_ids:row.id,
// // status:row.status
// // }).then(response => {
// // if (response.code == 0) {
// // this.$message.success(response.msg);
// // }else{
// // this.$message.error(response.msg);
// // }
// // this.getInitData()
// // }).catch(error => {
// // console.error(error, 'error')
// // this.$message.error('');
// // })
// // this.$set(this.doctorList, row)
// },
batchOperate(status) { batchOperate(status) {
// console.log(this.tableSelections,'this.tableSelections----'); // console.log(this.tableSelections,'this.tableSelections----');
if(!this.tableSelections || this.tableSelections.length <= 0) { if(!this.tableSelections || this.tableSelections.length <= 0) {
@ -511,7 +611,14 @@ export default {
margin-left: 0 !important; margin-left: 0 !important;
transform: none !important; transform: none !important;
} }
.diaDesc{
margin-top: 12px;
font-size: 14px;
font-weight: normal;
line-height: normal;
letter-spacing: 0.08em;
color: #23242B;
}
.doctor-list-wrap { .doctor-list-wrap {
background: #fff; background: #fff;
padding: 32px 36px; padding: 32px 36px;

Loading…
Cancel
Save