qa-prevention-gwj-vue/src/views/xgf/flow/components/sendUtil.vue

73 lines
1.7 KiB
Vue
Raw Normal View History

2023-12-18 20:24:01 +08:00
<template>
<div>
2023-12-23 10:27:03 +08:00
<el-dialog :visible.sync="visible" :append-to-body="appendToBody" :before-close="beforeClose" title="审批" width="370px" destroy-on-close>
2023-12-18 20:24:01 +08:00
<el-form>
2023-12-19 15:01:43 +08:00
<el-form-item prop="TERRITORIALITY" label="是否通过 ">
<el-select v-model="value" placeholder="请选择">
<el-option label="是" value="1"/>
<el-option label="否" value="0"/>
</el-select>
2023-12-18 20:24:01 +08:00
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
2023-12-19 15:01:43 +08:00
<el-button type="primary" @click="sendMessage()"> </el-button>
2023-12-18 20:24:01 +08:00
</div>
</el-dialog>
</div>
</template>
<script>
import vueQr from 'vue-qr'
import Treeselect from '@riophae/vue-treeselect'
import { requestFN } from '@/utils/request'
export default {
components: { Treeselect, vueQr },
props: {
appendToBody: {
type: Boolean,
default: false
}
},
data() {
return {
visible: false,
loading: false,
2023-12-19 15:01:43 +08:00
value: null,
2023-12-18 20:24:01 +08:00
heirloom: {}
}
},
methods: {
init(e) {
this.visible = true
this.heirloom = JSON.stringify(e)
},
beforeClose() {
2023-12-27 15:13:47 +08:00
this.visible = false
2023-12-18 20:24:01 +08:00
},
sendMessage(row) {
2023-12-23 10:27:03 +08:00
if (!this.value || this.value === '') {
2023-12-22 17:07:44 +08:00
this.$message.error('请选择是否通过')
return
}
2023-12-18 20:24:01 +08:00
requestFN(
2023-12-19 15:01:43 +08:00
'/xgf/user/approve',
2023-12-18 20:24:01 +08:00
{
list: this.heirloom,
2023-12-19 15:01:43 +08:00
STATUS: this.value,
2023-12-18 20:24:01 +08:00
tm: new Date().getTime()
}
).then((data) => {
this.$message.success('推送成功')
this.visible = false
this.$emit('refresh', '')
})
}
}
}
</script>
<style lang="scss" scoped>
</style>