linwe
2024-07-29 6416b40cf242340eaa163c498bd49d8103e73610
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<template>
  <div class="cur-container-box">
    <avue-form ref="replyForm" :option="option" v-model="form" :close-on-click-modal="false">
 
      <template slot-scope="{size}" slot="menuForm">
        <el-button type="primary" :size="size" @click="handleSubmit(2)">通 过</el-button>
        <el-button :size="size" @click="handleSubmit(3)">驳 回</el-button>
      </template>
 
      <template slot-scope="{ row, size, index }" slot="houseCode" v-if="this.type == 2">
        <el-select v-model="form.houseCode" filterable remote :remote-method="onRemoteMethod" @change="onSelectChange"
          placeholder="请选择标准地址" reserve-keyword>
          <el-option v-for="item in standardAddressList" :key="item.houseCode"
            :label="item.placeName+'------详细地址:'+item.location" :value="item.houseCode">
          </el-option>
        </el-select>
      </template>
 
    </avue-form>
  </div>
</template>
 
<script>
  import {
    setCheckPlaceExt,
    getPlaceAddressList,
    getList
  } from "@/api/place/place"
 
  import {
    getTaskNoFraudReportingList,
    removeTask,
    update,
    add,
    applyTaskExamine
  } from "@/api/task/task"
 
  export default {
    inject: ["placeElement"],
 
    data() {
      return {
        id: '',
        form: {},
        type: '',
        standardAddressList: [], //标准地址数据
        option: {
          submitBtn: false,
          emptyBtn: false,
          column: [{
              span: 23,
              prop: "houseCode",
              slot: true,
              label: "标准地址",
              // labelWidth: 120,
              display: false
            },
            {
              span: 23,
              row: true,
              label: "审批意见",
              prop: "confirmNotion",
              type: 'textarea',
              minRows: 3,
              maxRows: 5,
              rules: [],
            }
          ]
        },
      }
    },
 
    watch: {
 
    },
 
    methods: {
 
      onSelectChange(e) {
        console.log("selectChange===>", e);
        // this.getPlaceAddressListRequest()
      },
      init(row) {
        this.id = row.taskId
        this.type = row.type
        let houseCodeColumn = this.findObject(this.option.column, 'houseCode')
        console.log("*******77777************" + this.type)
        if (this.type == 2) {
          console.log("*******777778************" + this.type)
 
          houseCodeColumn.display = true
        } else {
          console.log("*******777779************" + this.type)
 
          houseCodeColumn.display = false
        }
        this.getPlaceAddressListRequest()
      },
      onRemoteMethod(query) {
        console.log("remote===>", query)
        this.getPlaceAddressListRequest(query)
      },
      getPlaceAddressListRequest(query) {
        // 场所名称查询
        if (this.type == 2) {
          getList(1, 10, {
            placeName: query
          }).then(res => {
            this.standardAddressList = res.data.data.records;
          })
        } else {
          getList(1, 10, {
            neiName: query
          }).then(res => {
            this.standardAddressList = res.data.data.records;
          })
        }
      },
 
      handleSubmit(status) {
        let auditForm = {
          id: this.id,
          status: status,
          remark: this.form.confirmNotion,
          houseCode: this.form.houseCode,
          reportType: 6
        }
        applyTaskExamine(auditForm).then(res => {
          if (res.data.code == 200) {
            this.placeElement.visible = false
            this.placeElement.onLoad(this.placeElement.page)
            this.$message.warning("审核成功")
          }
        })
        // setCheckPlaceExt({
        //   confirmFlag: 2,
        //   id: this.placeElement.curAuditRow.placeExtId,
        //   confirmNotion: this.form.confirmNotion
        // }).then(() => {
        //   this.$message({
        //     type: "success",
        //     message: "操作成功!",
        //   })
        //   this.$refs.replyForm && this.$refs.replyForm.resetForm()
        // this.placeElement.auditBasePopup = false
 
        //   this.placeElement.onLoad(this.placeElement.page)
        // })
      },
 
      handleReset() {
        if ('confirmNotion' in this.form && this.form.confirmNotion.trim() == '' || !this.form.confirmNotion) {
          this.$message({
            type: 'warning',
            message: "请输入审批意见!",
          })
 
          return
        }
 
        setCheckPlaceExt({
          confirmFlag: 3,
          id: this.placeElement.curAuditRow.placeExtId,
          confirmNotion: this.form.confirmNotion
        }).then(() => {
          this.$message({
            type: "success",
            message: "操作成功!",
          })
          this.$refs.replyForm && this.$refs.replyForm.resetForm()
          this.placeElement.auditBasePopup = false
 
          this.placeElement.onLoad(this.placeElement.page)
        })
      },
    }
  }
</script>
 
<style lang="scss" scoped>
  .cur-container-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
 
    .content-box {
      margin: 0 4px;
      padding: 0 16px;
      height: 0;
      flex: 1;
      overflow: hidden;
      overflow-y: auto;
    }
 
    .footer-btn-box {
      margin-top: 10px;
      display: flex;
      justify-content: center;
    }
  }
</style>