| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <template>
- <div>
- <el-button :type="disabled?'':btnType" size="mini" :disabled="disabled" @click="open" :showClose="false">{{btnTitle}}</el-button>
- </div>
- </template>
- <script>
- export default {
- name: "confirmSelection",
- props:{
- btnTitle:String,
- btnType:String,
- content:String,
- confirmButtonText:String,
- cancelButtonText:String,
- paramId:String,
- idName:String,
- paramContent:Object,
- disabled:Boolean,
- statusData:String
- },
- data(){
- return {
- param:{
- "id": 20221010164602,
- "content": {
- "sa_customersids": [5791],
- "status": "暂缓"
- }
- }
- }
- },
- methods:{
- open() {
- this.$confirm(this.$t(this.content)+'?', this.$t('提示'), {
- confirmButtonText: this.$t(this.confirmButtonText),
- cancelButtonText: this.$t(this.cancelButtonText),
- type: 'warning'
- }).then(() => {
- this.onSubmit()
- }).catch(() => {
- this.$message({
- type: 'info',
- message: this.$t('已取消')
- });
- });
- },
- async onSubmit(){
- if (this.btnTitle == '暂缓' || this.btnTitle == '取消暂缓' || this.btnTitle == '终止' || this.btnTitle == '恢复'){
- this.param.id = this.paramId
- this.param.content = {
- sa_customersids: [this.$route.query.id],
- status: this.statusData
- }
- }else {
- this.param.id = this.paramId
- this.param.content = {
- [this.idName]:this.$route.query.id
- }
- }
- const res = await this.$api.requested(this.param)
- this.tool.showMessage(res,()=>{
- this.$emit('onSuccess')
- })
- }
- }
- }
- </script>
- <style scoped>
- </style>
|