corToQueDialog.vue 2.19 KB
Newer Older
fukai committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
<template>

	<el-dialog v-dialogDrag width="50%" title="手工分配" v-if="visiable" :visible.sync="visiable" :before-close="handleClose">
      <div class="corToQue">
        <span>
          <el-form ref="modelForm"    :model="model" :rules="polrules" >
              <el-form-item label="退回原因" prop="remark" style="width: 100%">
                <c-input v-model="model.remark" maxlength="255" type="textarea" placeholder="请输入退回原因"></c-input>
              </el-form-item>
          </el-form>
        </span>
     </div>
        <span slot="footer">
          <el-button @click="handleClose">取 消</el-button>
          <el-button type="primary" @click="handleOn">确 定</el-button>
      </span>
	</el-dialog>
</template>
<script>
import Api from '~/service/Api';
export default {
	name: 'corToQueDialog',
	props: {
		isShowCorToQue: {
			type: Boolean,
			default: false
		},
		multipleSelection: {
			type: Array,
			default: () => []
    },
    model:{}
	},
	data () {
		return {
      visiable: false,
       polrules: {
        remark: [
          { required: true, message: "退回原因不能为空", trigger: "blur" }
        ],
       
      },
		}
  },
  watch: {
		isShowCorToQue (newVal) {
			if (newVal) {
				this.visiable = true
			}
		}
	},
	
	methods: {
  
  	handleClose () {
			this.visiable = false
			this.$emit('closeCorDialog')
		},
		async handleOn (row) {
      this.$refs.modelForm.validate((valid) => {
        if(valid){
        this.$confirm('您确定将该笔交易退回分配?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning',
        }).then(async () => {
          let params = {
            taskIds: this.multipleSelection,
            remark: this.model.remark
          }
          let res = await Api.post("/public/taskdist/assign/cor2que", params);
          if (res.respCode == SUCCESS) {
            this.$notify({
              title: '成功',
              message: '退回分配成功',
              type: 'success',
            });
            this.visiable = false
            this.$emit('refreshC')
          }
        })
     }}
    )
    },
  }
}
</script>
<style lang="less" scoped>

</style>