qx
qx
9 天以前 d4ad5101a4a7d956b973d050c65a97e1a9d6b1c0
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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
      <el-row>
        <el-col :span="11">
          <el-form-item label="单位名称" prop="company" style="display: flex">
            <el-select
              :remote-method="getRemoteData"
              v-model="queryParams.company"
              value-key="drugManufacturerId"
              remote
              filterable
              placeholder="请选择单位名称"
              clearable
              @change="searchSelect"
            >
              <el-option
                v-for="dict in CompanyList"
                :key="dict.drugManufacturerId"
                :label="dict.cnName"
                :value="dict.drugManufacturerId"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item>
            <el-button
              type="primary"
              icon="el-icon-search"
              size="mini"
              @click="handleQuery"
              style="margin: 0 15px"
              >搜索</el-button
            >
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
              >重置</el-button
            >
          </el-form-item>
        </el-col>
      </el-row>
 
      <!-- <el-form-item label="交易金额" prop="transactionAmount">
                <el-input v-model="queryParams.transactionAmount" placeholder="请输入交易金额" clearable
                    @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="支付方式" prop="paymentMethod">
                <el-input v-model="queryParams.paymentMethod" placeholder="请输入支付方式" clearable
                    @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="卡号" prop="cardNo">
                <el-select v-model="queryParams.cardNo" placeholder="请选择卡号(微信/支付宝填手机号;其他填银行卡号)" clearable>
                    <el-option v-for="dict in dict.type.dict_pay_type" :key="dict.value" :label="dict.label"
                        :value="dict.value" />
                </el-select>
            </el-form-item>
            <el-form-item label="交款人" prop="payer">
                <el-input v-model="queryParams.payer" placeholder="请输入交款人" clearable @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="收款人" prop="payee">
                <el-input v-model="queryParams.payee" placeholder="请输入收款人" clearable @keyup.enter.native="handleQuery" />
            </el-form-item> -->
    </el-form>
 
    <!-- <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
                <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
                    v-hasPermi="['system:info:add']">新增
                </el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
                    v-hasPermi="['system:info:edit']">修改
                </el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
                    v-hasPermi="['system:info:remove']">删除
                </el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
                    v-hasPermi="['system:info:export']">导出
                </el-button>
            </el-col>
            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row> -->
 
    <el-table
      id="sig"
      v-loading="loading"
      :data="infoList"
      @selection-change="handleSelectionChange"
      border
      ref="tb"
      max-height="260px"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="部门" align="center" prop="pacName" />
      <el-table-column label="预检人数" align="center" prop="count" />
      <el-table-column label="实检人数" align="center" prop="sjCount" />
      <el-table-column label="应收金额" align="center" prop="copeWith" />
      <el-table-column label="签约金额" align="center" prop="signingPrice">
      </el-table-column>
      <el-table-column
        label="已付金额"
        align="center"
        prop="transactionAmount"
      />
      <el-table-column label="差额" align="center" prop="difference" />
      <el-table-column label="签约人" align="center" prop="payer" />
      <el-table-column
        label="预约时间"
        align="center"
        prop="createTime"
        :formatter="formatDate"
      />
    </el-table>
 
    <el-form
      :inline="true"
      :model="formInline"
      class="demo-form-inline"
      style="margin: 12px 6px"
      label-width="100px"
    >
      <el-row>
        <el-col :span="5">
          <el-form-item label="负责人" style="display: flex">
            <el-input
              v-model="formInline.payer"
              placeholder="单位负责人"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="交易金额" style="display: flex">
            <el-input v-model="formInline.price" placeholder="金额"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="交易类型" prop="payType" 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 style="display: flex">
            <el-button
              type="primary"
              size="mini"
              @click="SubmitEvent"
              style="margin: 0 15px"
              >收费</el-button
            >
          </el-form-item>
        </el-col>
        <!-- <el-col :span="7">
          <el-form-item>
            <el-button
              type="primary"
              size="mini"
              @click="SubmitEvent"
              style="margin: 0 15px"
              >收费</el-button
            >
            <el-button type="primary" size="mini" @click="handleDelete"
              >退费</el-button
            >
          </el-form-item>
        </el-col> -->
      </el-row>
    </el-form>
 
   
      <el-radio-group
        v-model="jcStatus"
        @input="radioChange"
        style="margin-left: 20px; margin-top: 20px"
      >
        <el-radio-button label="0">已检未结账人员</el-radio-button>
        <el-radio-button label="1">未检人员</el-radio-button>
         <el-radio-button label="2">全部人员</el-radio-button>
      </el-radio-group>
 
    <el-row :gutter="20">
      <el-col :span="12" :xs="24" style="padding: 0px 20px">
        <div class="tj">
          <span class="tj_txt">体检人员情况表</span>
        </div>
 
        <el-table
          v-loading="loading"
          :data="peopleList"
          border
          max-height="260px"
        >
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="序号" align="center" prop="newID" />
          <el-table-column label="姓名" align="center" prop="name" />
          <el-table-column label="性别" align="center" prop="sex" />
          <el-table-column label="电话" align="center" prop="iphone" />
          <el-table-column label="状态" align="center" prop="tjStatus" />
          <el-table-column label="体检时间" align="center" prop="tjTime">
          </el-table-column>
        </el-table>
      </el-col>
 
      <el-col :span="12" :xs="24">
        <div class="tj">
          <span class="tj_txt">已结账记录</span>
        </div>
 
        <el-table
          v-loading="loading"
          :data="dataList"
          border
          max-height="260px"
        >
          <el-table-column
            label="交易金额"
            align="center"
            prop="transactionAmount"
          />
          <el-table-column
            label="交易方式"
            align="center"
            prop="paymentMethod"
          />
          <el-table-column label="交易人员" align="center" prop="payer" />
          <el-table-column label="操作人员" align="center" prop="payee">
          </el-table-column>
          <el-table-column label="结账时间" align="center" prop="createTime" />
          <el-table-column label="操作" align="center">
            <template>
              <el-button type="primary">撤销结账</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-col>
    </el-row>
  </div>
</template>
 
<script>
import { getInfo } from "@/api/login";
import {
  getCompany,
  queryCompany,
  getTeamTjPeopleList,
} from "@/api/team/tuanti";
 
import {
  listInfo,
  getpay,
  delInfo,
  addInfo,
  updateInfo,
} from "@/api/system/info";
 
export default {
  name: "Info",
  dicts: ["dict_pay_type"],
  data() {
    return {
      // 绑定单选按钮
      tjStatus: "0",
      jcStatus:0,
      formInline: {
        payer: "",
        price: "",
      },
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      tjCompPayId: "",
      // 总条数
      total: 0,
      // 体检单位缴费明细表格数据
      infoList: [],
      copeWith: "",
      transactionAmount: "",
      dataList: [],
      tableList: [],
      peopleList: [],
      // 弹出层标题
      title: "",
      CompanyList: [],
      // 是否显示弹出层
      open: false,
      compId: "",
      teamNo: "",
      // 登陆人名字
      tollCollectorName: "",
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        company: null,
        transactionAmount: null,
        paymentMethod: null,
        cardNo: null,
        payer: null,
        payee: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {},
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询体检单位缴费明细列表 */
    formatDate(row) {
      if (!row.createTime) return "";
      const date = new Date(row.createTime);
      const year = date.getFullYear();
      const month = (date.getMonth() + 1).toString().padStart(2, "0");
      const day = date.getDate().toString().padStart(2, "0");
      return `${year}-${month}-${day}`;
    },
    getList() {
      // this.loading = true;
      // listInfo(this.queryParams).then(response => {
      //     this.infoList = response.data;
      //     this.loading = false;
      // });
 
      // 获取单位信息集合
      getCompany(this.queryParam).then((response) => {
        this.CompanyList = response.data;
        this.loading = false;
      });
      // 获取登录人信息
      getInfo().then((response) => {
        this.tollCollectorName = response.user.nickName;
        this.loading = false;
      });
    },
 
    // 选框数据
    searchSelect(val) {
      this.compId = val;
    },
 
    radioChange(val){
 
    },
 
    // 体检公司拼音搜索
    getRemoteData(query) {
      if (query) {
        let compName = query;
        queryCompany(compName).then((response) => {
          this.CompanyList = response.data;
        });
      }
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        tjCompPayId: null,
        transactionAmount: null,
        paymentMethod: null,
        cardNo: null,
        payer: null,
        payee: null,
        createTime: null,
        createBy: null,
        updateTime: null,
        updateBy: null,
        deleted: null,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.loading = true;
      listInfo(this.compId).then((response) => {
        this.infoList = response.data;
        if (this.infoList.length != 0) {
          // this.infoList.forEach((item) => {
          this.$nextTick(() => {
            this.$refs.tb.toggleRowSelection(this.infoList[0], true);
          });
          // });
        } else {
          this.$refs.tb.clearSelection();
        }
        this.infoList.forEach((item) => {
          this.copeWith = item.copeWith;
          this.transactionAmount = item.transactionAmount;
          this.formInline.price = item.copeWith - item.transactionAmount;
          if (item.payInfo != null) {
            this.tjCompPayId = item.payInfo.tjCompPayId;
          }
 
          this.formInline.payer = item.payer;
          if (item.payInfoList != null) {
            this.dataList = item.payInfoList;
            this.dataList.forEach((item) => {
              if (item.paymentMethod === 0) {
                item.paymentMethod = "现金支付";
              } else if (item.paymentMethod === 1) {
                item.paymentMethod = "刷卡支付";
              } else if (item.paymentMethod === 2) {
                item.paymentMethod = "支付宝";
              } else if (item.paymentMethod === 3) {
                item.paymentMethod = "微信";
              } else if (item.paymentMethod === 4) {
                item.paymentMethod = "云闪付";
              }
            });
          }
        });
        this.loading = false;
      });
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      console.log(2222);
      if (selection.length > 1) {
        let del_row = selection.shift();
        this.$refs.tb.toggleRowSelection(del_row, false); //设置这一行取消选中
      }
      // this.ids = selection.map((item) => item.id);
      // this.single = selection.length !== 1;
      // this.multiple = !selection.length;
      this.tableList = selection;
      this.teamNo = "";
      this.tableList.forEach((item) => {
        this.teamNo = item.teamNo;
        this.copeWith = item.copeWith;
        this.transactionAmount = item.transactionAmount;
        this.formInline.price = item.copeWith - item.transactionAmount;
        if (item.payInfo != null) {
          this.tjCompPayId = item.payInfo.tjCompPayId;
        }
        if (item.payInfoList != null) {
          this.dataList = item.payInfoList;
          this.dataList.forEach((item) => {
            if (item.paymentMethod === 0) {
              item.paymentMethod = "现金支付";
            } else if (item.paymentMethod === 1) {
              item.paymentMethod = "刷卡支付";
            } else if (item.paymentMethod === 2) {
              item.paymentMethod = "支付宝";
            } else if (item.paymentMethod === 3) {
              item.paymentMethod = "微信";
            } else if (item.paymentMethod === 4) {
              item.paymentMethod = "云闪付";
            }
          });
        }
      });
      console.log(11111);
      if (this.teamNo) {
        getTeamTjPeopleList(this.teamNo).then((res) => {
          if (res.data) {
            this.peopleList = res.data;
            res.data.forEach((item, index) => {
              item.newID =
                (this.queryParams.pageNum - 1) * this.queryParams.pageSize +
                index +
                1;
            });
          }
        });
      }
    },
    /** 新增按钮操作 */
    // handleAdd() {
    //   this.reset();
    //   this.open = true;
    //   this.title = "添加体检单位缴费明细";
    // },
 
    // 单选按钮
    radioChange(val) {},
 
    /** 收费提交按钮 */
    SubmitEvent() {
      if (this.formInline.price != 0) {
        let data = {
          paymentMethod: this.formInline.payType,
          transactionAmount: this.formInline.price,
          payee: this.tollCollectorName, // 收款人
          tjCompPayId: this.tjCompPayId,
          payer: this.formInline.payer,
        };
        getpay(data).then((response) => {
          this.$modal.msgSuccess("操作成功");
          this.handleQuery();
          const tjnumber = this.waterId;
          const viewNum = this.mobanId;
          const params = { viewNum, tjnumber };
          this.$tab.openPage("团检小票", "/report/charge", params);
        });
      } else {
        this.$message.error("交易金额不能为0");
      }
    },
 
    /** 退费按钮操作 */
    handleDelete() {
      if (this.formInline.price != 0) {
        if (this.formInline.price < this.transactionAmount) {
          let data = {
            paymentMethod: this.formInline.payType,
            transactionAmount: this.formInline.price,
            payee: this.tollCollectorName, // 收款人
            tjCompPayId: this.tjCompPayId,
            payer: this.formInline.payer,
          };
          addInfo(data).then((response) => {
            this.$modal.msgSuccess("操作成功");
            this.handleQuery();
          });
        } else {
          this.$message.error("超出已付金额,退费失败");
        }
      } else {
        this.$message.error("退费金额不能为0");
      }
    },
    /** 导出按钮操作 */
    handleExport() {},
  },
};
</script>
 
<style>
#sig .el-table__header-wrapper .el-checkbox {
  display: none;
}
 
.mb8 {
  margin-top: 10px;
}
 
.tj {
  margin-top: 8px;
}
 
.tj_txt {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
}
</style>