马宇豪
2025-02-10 02bd5982028af6e791dd0857f535a41aaf74679e
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<template>
  <el-dialog
    title="批量缴费"
    :visible.sync="dialogVisible"
    :modal-append-to-body="false"
    :close-on-click-modal="false"
    width="450px"
    :before-close="handleClose"
  >
    <el-form ref="dataForm" :model="dataForm"  :rules="rules" label-position="right" label-width="150px" style="padding-right: 50px" element-loading-text="保存中...">
      <!--      <el-form-item label="缴款人类型:" prop="payPersonType">-->
      <!--        <el-radio-group v-model="dataForm.payPersonType">-->
      <!--          <el-radio :label="2">团体</el-radio>-->
      <!--        </el-radio-group>-->
      <!--      </el-form-item>-->
      <el-form-item label="缴款单位名称:" prop="payCompanyName">
        <el-input v-model.trim="dataForm.payCompanyName"/>
      </el-form-item>
      <el-form-item label="缴款单位证件号:" prop="payCompanyCard">
        <el-input v-model.trim="dataForm.payCompanyCard"/>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="handleClose">取 消</el-button>
      <el-button type="primary" @click="onSubmit">确 定</el-button>
    </span>
  </el-dialog>
</template>
 
<script >
import { verifySimplePhone } from '@/utils/validate'
import {coalTeamPay} from "@/api/specialOperationsPay/coalPay";
import {nonCoalTeamPay} from "@/api/specialOperationsPay/notCoalPay";
 
export default {
  name: 'batchPay',
  components: {
  },
  data() {
    return {
      dialogVisible: false,
      dialogStatus: '',
      rules: {
        payCompanyName: [{ required: true, message: '请输入缴费单位名称', trigger: 'blur' }],
        payCompanyCard: [{ required: true, message: '请输入缴费单位证件号', trigger: 'blur' }]
      },
      dataForm: {
      },
 
    }
  },
  created() {
 
  },
  methods: {
    openDialog (data,type) {
      this.resetDataForm();
      this.dialogVisible = true
      this.dialogStatus = type
      this.dataForm.id = data.id
      this.dataForm.payPersonType = 2
      if(this.dialogStatus == 'edit') {
        this.dataForm = data
      }
      this.$nextTick(() => {
        this.$refs['dataForm'].clearValidate()
      })
    },
    handleClose() {
      this.dialogVisible = false;
      this.$emit("getList");
    },
    onSubmit() {
      this.$refs["dataForm"].validate( async valid => {
        if (valid) {
          if(this.dialogStatus == 'add'){
            const res = await nonCoalTeamPay(this.dataForm);
            if(res.code == 200) {
              this.$emit("getList");
              this.dialogVisible = false;
              this.$message({
                type:'success',
                message: '提交成功'
              })
            }else{
              this.$message({
                type:'warning',
                message: res.msg
              })
            }
          }else {
            // const res = await updatePlat(this.dataForm);
            // if(res.code == 200) {
            //   this.$emit("getList");
            //   this.dialogVisible = false;
            //   this.$message({
            //     type:'success',
            //     message: '编辑成功'
            //   })
            // }else{
            //   this.$message({
            //     type:'warning',
            //     message: res.msg
            //   })
            // }
          }
        }
      })
 
    },
    resetDataForm() {
      this.dataForm = {
      }
    },
  }
}
 
</script>
<style scoped>
.infoTitle{
  margin-top:-10px;
  margin-bottom:20px;
  display: flex;
  justify-content: space-around;
  font-weight: 800;
  font-size: 16px
}
 
</style>