su
su1124
2024-01-24 51123d5ad145745f855280783c01cc2906b693d0
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<template>
  <div class="app-container">
    <div class="grid-content bg-purple">
      <el-form :inline="true" ref="form" :model="form" :label-position="labelPosition" class="demo-form-inline"
        label-width="100px">
        <el-row>
          <el-col :span="6">
            <el-form-item label="体检号" prop="tjNum" style="display: flex;">
              <el-input ref="inputName" v-model="form.tjNum" placeholder="请输入体检号" @keyup.enter.native="handle"  @blur="hb" />
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="姓名" prop="tjName" style="display: flex;">
              <el-input v-model="form.tjName" placeholder="请输入姓名" />
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item label="联系电话" prop="tjPhone" style="display: flex;">
              <el-input v-model="form.tjPhone" placeholder="请输入联系电话" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item>
              <el-button style="margin-left: 50px" type="primary" size="mini" @click="handle">搜索</el-button>
              <el-button style="margin-left: 10px" type="primary" size="mini" @click="resetQuery">重置</el-button>
            </el-form-item>
          </el-col>
        </el-row>
 
 
 
 
      </el-form>
    </div>
 
    <template>
      <el-table id="sig" :data="customerList" height="240" style="width: 100%; margin-bottom: 20px" border
        @selection-change="handleSelection" tooltip-effect="dark" ref="multipleTable">
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column prop="tjName" label="姓名" width="100px" align="center" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="tjPhone" label="联系电话" align="center" width="150px" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="tjComp" label="单位" align="center" width="250px" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="tjType" label="体检类型" align="center" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="tjNumber" label="体检号" align="center" width="250px" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="totalAmount" label="总费用" align="center" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column label="登记时间" align="center" prop="registerTime" width="155px" height="10px"
          :show-overflow-tooltip="true">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.registerTime) }}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column label="报告时间" align="center" prop="reportTime" width="155px" height="10px" :show-overflow-tooltip="true">
                    <template slot-scope="scope">
                        <span>{{ parseTime(scope.row.reportTime) }}</span>
                    </template>
                </el-table-column> -->
        <el-table-column label="开票时间" align="center" prop="drawerTime" width="180" :show-overflow-tooltip="true">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.drawerTime, "{y}-{m}-{d}") }}</span>
          </template>
        </el-table-column>
      </el-table>
    </template>
 
 
    <el-form :inline="true" :model="formInline" class="demo-form-inline" style="margin: 0px 4px">
      <el-row >
        <el-col :span="10">
          <el-form-item label="退费共计:">
            <el-input v-model="formInline.price" placeholder="请输入金额"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="10">
          <el-form-item label="退费类型" style="display: flex;">
            <el-select  v-model="formInline.payType" placeholder="请选择付款类型"  >
              <el-option v-for="dict in dict.type.dict_pay_type" :key="dict.value" :label="dict.label"
                :value="dict.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="4">
          <el-form-item >
          <el-button icon="el-icon-document-delete" size="small" v-hasPermi="['hosp:order:export']" @click="handleRefund"
            style="margin-top: 3px">退费</el-button>
          </el-form-item>
 
        </el-col>
      </el-row>
    </el-form>
 
 
    <template>
      <el-table :data="numberList" height="260" v-loading="loading" style="width: 100%; margin-top: 20px" border
        @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column prop="proName" label="项目名称" align="center" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="price" label="单价" align="center" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="count" label="数量" align="center" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="netReceipts" label="实收" align="center" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="tollCollector" label="收费人员" align="center" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column label="收费时间" align="center" prop="collectFeesTime" :show-overflow-tooltip="true">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.collectFeesTime) }}</span>
          </template>
        </el-table-column>
      </el-table>
    </template>
  </div>
</template>
 
<script>
import { getTjRefundList, getTjList, getTjRefund } from "@/api/hosp/customer";
 
export default {
  dicts: [
    "dict_user_national",
    "dict_user_marry",
    "sys_yes_no",
    "sys_user_sex",
    "dict_team",
    "dict_pay_type",
  ],
  name: "Tijian",
 
  data() {
    return {
      idList: [],
      waterId: "",
      mobanId: "",
      tjnumber: "",
      formInline: {
        price: 0,
        payType: "0",
      },
      tjOrderId: "",
      orderIds: "",
      list: [],
      // 遮罩层
      loading: false,
      labelPosition: "right",
      size: "",
      multipleSelection: [],
      // 套餐提交按钮
      confirm: false,
      TotalPrice1: 0,
      customerList: [],
      copewith: "",
      DataList: [],
      tjFlowingWater: {},
      // 搜索套餐名字
      name: "",
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      nodeobj: {},
      // 是否显示弹出层
      Seachopen: false,
      pacId: "",
      // 结果
      result: "",
      // 显示搜索条件
      showSearch: true,
      // 树状形状
      data: [],
      tjSerialNumber: "",
      formPacId: "",
      refundPros: [],
      tollCollectorName: "",
      waterId: "",
      customer: {},
      numberList: [],
      // 表单参数
      form: {
        tjNum: null,
        tjName: null,
        tjPhone: null,
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    getList() {
      this.$nextTick(() => {
        this.$refs.inputName.focus();
      });
    },
    hb(){
      console.log(this.form.tjNum);
       if (this.form.tjNum != null) {
        this.handle();
      }
    },
    /** 搜索操作 */
    handle() {
      this.loading = true;
      getTjRefundList(this.form).then((response) => {
        if( response.data){
          this.customerList = response.data;
        this.customerList.forEach((item1) => {
          this.tjnumber = item1.tjNumber;
        });
        if (this.customerList.length != 0) {
          this.$nextTick(() => {
            this.$refs.multipleTable.toggleRowSelection(
              this.customerList[0],
              true
            );
          });
        } else {
          this.$refs.multipleTable.clearSelection();
        }
        this.customerList.forEach((item) => {
          if (item.isAdditionCollectFees === "N") {
            item.isAdditionCollectFees = "否";
          } else {
            item.isAdditionCollectFees = "是";
          }
          if (item.tjType === "1") {
            item.tjType = "团队";
          } else {
            item.tjType = "个人";
          }
        });
        this.total = response.total;
        this.loading = false;
        }
       
      });
    },
 
    //重置按钮
    resetQuery() {
      this.$tab.refreshPage();
    },
 
    // 表格单选
    handleSelection(selection, val) {
      if (selection) {
        if (selection.length > 1) {
          let del_row = selection.shift();
          this.$refs.multipleTable.toggleRowSelection(del_row, false);
        }
      }
      this.DataList = this.$refs.multipleTable.selection;
      this.DataList.forEach((item) => {
        this.tjOrderId = item.tjOrderId;
      });
      this.loading = true;
      let data = {
        orderId: this.tjOrderId,
      };
      getTjList(data).then((res) => {
        this.numberList = res.data;
        this.loading = false;
      });
    },
 
    // 多选
    handleSelectionChange(val) {
      this.multipleSelection = val;
      this.refundPros = [];
      this.refundPros = this.multipleSelection;
      this.formInline.price = 0;
      this.multipleSelection.forEach((item) => {
        this.tollCollectorName = item.tollCollector;
        if (this.formInline.price) {
          this.formInline.price += item.netReceipts;
        } else {
          this.formInline.price = item.netReceipts;
        }
      });
    },
 
    // 退费
    handleRefund() {
      console.log(this.form)
      this.customerList.forEach((item) => {
        (this.orderIds = item.tjFlowingWater.orderId),
          (this.copewith = item.totalAmount);
        this.waterId = item.tjFlowingWater.waterId;
        this.tjSerialNumber = item.tjFlowingWater.tjSerialNumber;
        this.customer = {
          cusName: item.tjName,
          createBy: item.tjFlowingWater.createBy,
          createTime: item.tjFlowingWater.createTime,
          cusPhone: item.tjPhone,
          tjStatus: item.tjFlowingWater.payStasus,
          tjType: item.tjFlowingWater.payType,
          tjNumber: item.tjNumber,
        };
      });
 
      if (this.refundPros.length > 0) {
        var data = {
          orderId: this.orderIds,
          refundPrice: this.formInline.price,
          payType: this.formInline.payType,
          customer: this.customer,
          tollCollectorName: this.tollCollectorName,
          waterId: this.waterId,
          tjSerialNumber: this.tjSerialNumber,
          refundPros: this.refundPros,
          copewith: this.copewith,
          discount: "/",
        };
      } else {
        this.$message({
          type: "warning ",
          message: "请选择退费项目!",
        });
        return;
      }
      getTjRefund(data).then((res) => {
        this.tjnumber = res.data.waterId;
        this.mobanId = res.data.mobanId;
        if (res.code === 200) {
          this.$modal.msgSuccess("退费成功");
          this.form.tjNum = res.data.waterId
          this.handle();
          // this.$forceUpdate();
          this.idList = res.data;
          const tjnumber = this.tjnumber;
          const viewNum = this.mobanId;
          const params = { viewNum, tjnumber };
          this.$tab.openPage("退款小票", "/report/charge", params);
        }
      });
    },
  },
};
</script>
 
<style>
#sig .el-table__header-wrapper .el-checkbox {
  display: none;
}
</style>