<!--驳回 -->
<template>
  <div>
    <el-dialog title="驳回原因" :model-value="bhshow" width="500px" :before-close="handleClose" :center="false">
      <div class="pq_content">
        <el-input type="textarea" placeholder="请输入内容" v-model="remark" class="lc_bz"
          style="max-height:300px;margin-bottom: 0 !important;" />
      </div>
      <div class="pq_content" style="justify-content: right;margin-top: 15px;">
        <div class="l-button pqbt" @click="handleClose">取消</div>
        <div class="l-button" style="margin-right: 0;margin-left: 15px;" @click="makeSure">确认</div>
      </div>
    </el-dialog>
  </div>
</template>
<script setup name= "LDialog">
import { ElMessage } from 'element-plus'
import { defineProps, defineEmits, getCurrentInstance, ref, useAttrs, watch } from 'vue'
/* 数据层 */
const { proxy } = getCurrentInstance()
const props = defineProps(['ids', 'bhshow', 'msg'])
const remark = ref(JSON.parse(JSON.stringify(props.msg)))
/* 初始化 */
/* 方法 */
const emits = defineEmits(['update:bhshow'])
const attrs = useAttrs()


// 确认
function makeSure () {
  if (props.ids) {
    proxy.$http.showLoading(false).post('project/task/reject', { id: props.ids, msg: remark.value }).then(res => {
      // 刷新爷组件详情数据接口
      if (res.errno == 200) {
        attrs.deppgetPageInfo()
        ElMessage({ type: 'success', message: '操作成功' })
      } else {
        ElMessage({
          type: 'error',
          message: res.errmsg
        })
      }
    })
  }
  emits('update:bhshow', false)
}
//关闭的点击事件
function handleClose () {
  emits('update:bhshow', false)
}
</script>
<style  scoped lang="scss">
@import '@/assets/style/lc.scss';

.pq_content {
  display: flex;
  flex-direction: row;
  margin-top: -18px;
  align-items: center;

  label {
    margin-right: 20px;
    font-size: 12px;
  }

  .pqbt {
    margin-right: 0;
    margin-left: 15px;
    color: #409EFF;
    background: #fff;
    border: 1px solid #409EFF;
  }

  ::v-deep(.el-input__icon) {
    line-height: 28px;
  }
}
</style>

