qinxianzhangyao
2023-10-19 ceb611ede1ca3988d731adffee433a1a7bcd442b
src/views/system/examcharge/index.vue
@@ -82,7 +82,7 @@
    <div class="app-container">
        <el-row :gutter="20">
            <!--部门数据-->
            <el-col :span="4" :xs="24">
            <el-col :span="5" :xs="24">
                <el-form :inline="true" ref="form" :model="form" class="demo-form-inline" label-width="78px" :rules="rules">
                    <el-form-item label="姓名" prop="name">
                        <el-input v-model="form.name" placeholder="请输入姓名" />
@@ -90,21 +90,22 @@
                    <el-form-item label="联系电话" prop="phone">
                        <el-input v-model="form.phone" placeholder="请输入联系电话" />
                    </el-form-item>
                    <el-form-item label="体检项目" prop="tjPro">
                        <el-input ref="inputName" v-model="form.tjPro" placeholder="请输入体检项目" />
                    <!-- @focus="hadeltjpro" -->
                    <el-form-item label="体检项目" prop="tjProName">
                        <el-input ref="inputName" v-model="form.tjProName" placeholder="请输入体检项目" />
                    </el-form-item>
                    <el-form-item label="数量" prop="number">
                        <el-input ref="inputName" v-model="form.number" placeholder="请输入数量" />
                    </el-form-item>
                    <el-form-item label="应收金额" prop="ys">
                        <el-input v-model="form.ys" placeholder="金额" :disabled="true"></el-input>
                        <el-input v-model="form.ys" placeholder="金额"></el-input>
                    </el-form-item>
                    <el-form-item label="优惠折扣" prop="zk">
                    <el-form-item label="优惠" prop="zk">
                        <el-input-number v-model="form.zk" :precision="2" :step="0.1" :max="10" :min="1"
                            @change="numberChange" :disabled="isfalse"></el-input-number>
                            disabled></el-input-number>
                    </el-form-item>
                    <el-form-item label="实收金额" prop="ss">
                        <el-input v-model="form.ss" placeholder="实付">
                        <el-input v-model="form.ss" placeholder="实付" @input="numberChange">
                        </el-input>
                    </el-form-item>
                    <el-form-item label="付款类型" prop="type">
@@ -125,8 +126,7 @@
            <el-col :span="17" :xs="24" style="padding: 0 10px;">
                <el-row :gutter="10" class="mb8">
                    <el-col :span="1.5">
                        <el-form :inline="true" ref="form" :model="queryParams" class="demo-form-inline" label-width="80px"
                            :rules="rules">
                        <el-form :inline="true" ref="form" :model="queryParams" class="demo-form-inline" label-width="80px">
                            <el-form-item label="姓名" prop="name">
                                <el-input v-model="queryParams.name" placeholder="请输入姓名" />
                            </el-form-item>
@@ -136,50 +136,63 @@
                        </el-form>
                    </el-col>
                    <el-col :span="1.5">
                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleUpdate"
                            v-hasPermi="['hosp:org:edit']">查询</el-button>
                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleUpdate">查询</el-button>
                    </el-col>
                </el-row>
                <div style="margin-bottom: 10px;">
                    <el-radio-group v-model="queryParams.type" @input="handleUpdate" style="margin-left: 30px">
                        <el-radio-button label="1">收费记录</el-radio-button>
                        <el-radio-button label="2">退费记录</el-radio-button>
                        <!-- <el-radio-button label="2">退费记录</el-radio-button> -->
                    </el-radio-group>
                </div>
                <el-table v-loading="loading" :data="tableList" @selection-change="handleSelect" border max-height="740px"
                <el-table v-loading="loading" :data="tableList" @selection-change="handleSelect" border max-height="720px"
                    :row-style="changRed" style="margin-left: 30px;">
                    <el-table-column type="selection" width="55" align="center" />
                    <el-table-column label="姓名" align="center" prop="customer.cusName" width="90px" />
                    <el-table-column label="手机号" align="center" prop="customer.cusPhone" width="120px"
                    <el-table-column label="手机号" align="center" prop="customer.cusPhone" width="110px"
                        :show-overflow-tooltip="true"></el-table-column>
                    <el-table-column label="订单流水号" align="center" prop="waterId" width="210px" />
                    <el-table-column label="体检项目" align="center" prop="proname" />
                    <el-table-column label="订单流水号" align="center" prop="waterId" width="180px" />
                    <el-table-column label="体检项目" align="center" prop="tjProName" width="120px" />
                    <el-table-column label="应收金额" align="center" prop="copeWith" width="90px" />
                    <el-table-column label="实收金额" align="center" prop="paidIn" width="90px" />
                    <el-table-column label="付款类型" align="center" prop="payType" width="90px">
                    <el-table-column label="实收金额" align="center" prop="paidIn" width="80px" />
                    <el-table-column label="付款类型" align="center" prop="payType" width="80px">
                        <template slot-scope="scope">
                            <dict-tag :options="dict.type.dict_pay_type" :value="scope.row.payType" />
                        </template>
                    </el-table-column>
                    <el-table-column label="收费员" align="center" prop="updateBy" width="110px" />
                    <el-table-column label="收费员" align="center" prop="updateBy" width="100px" />
                    <el-table-column label="收退时间" align="center" prop="updateTime" />
                    <el-table-column fixed="right" label="操作" align="center" class-name="small-padding " width="120px"
                    <el-table-column fixed="right" label="操作" align="center" class-name="small-padding " width="100px"
                        v-if="queryParams.type == '1'">
                        <template slot-scope="scope">
                            <el-button size="mini" type="text" @click="handlerefund(scope.row)"
                                v-hasPermi="['system:dept:edit']" v-if="scope.row.remarks != '已退费'">退费</el-button>
                            <el-button size="mini" type="text" v-hasPermi="['system:dept:edit']"
                                v-if="scope.row.remarks == '已退费'">{{ scope.row.remarks }}</el-button>
                            <el-button size="mini" type="text" v-hasPermi="['system:dept:edit']"
                                v-if="scope.row.remarks != '已退费'" @click="receipt(scope.row)">补打小票</el-button>
                            <!-- <el-button size="mini" type="text" @click="handlerefund(scope.row)"
                                v-if="scope.row.remarks != '已退费'">退费</el-button> -->
                            <el-button size="mini" type="text" v-if="scope.row.remarks == '已退费'">{{ scope.row.remarks
                            }}</el-button>
                            <el-button size="mini" type="text" v-if="scope.row.remarks != '已退费'"
                                @click="receipt(scope.row)">补打</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </el-col>
        </el-row>
        <!-- 添加补录项目 -->
        <el-dialog :title="title" :visible.sync="Projectopen1" width="980px" style="height: 860px" append-to-body>
            <el-row type="flex" class="row-bg" justify="space-around">
                <el-col :span="6">
                    <div class="tab3">
                        <div class="outside1">
                            <el-tree ref="tree" :data="Treedata" show-checkbox node-key="proId" check-strictly
                                :props="defaultProps" @check-change="handleCurrentChecked">
                            </el-tree>
                        </div>
                    </div>
                </el-col>
            </el-row>
        </el-dialog>
        <div style="
              position: absolute;
              bottom: 100px;
@@ -219,8 +232,9 @@
</template>
    
<script>
import { getTjPrice, addOrderAndDetail, tjRefund, getFlowingWaterList } from "@/api/system/examcharge";
import { getTjPrice, addOrderAndDetail, tjRefund, getFlowingWaterList, getPrintSetUp } from "@/api/system/examcharge";
import { getInfo } from "@/api/login";
import { projectGetList } from "@/api/system/tijian";
import printJS from "print-js";
export default {
    dicts: ["dict_pay_type"],
@@ -228,19 +242,36 @@
    data() {
        return {
            tjNumbers: "",
            // 遮罩层
            loading: false,
            Projectopen1: false,
            // 弹出层标题
            title: "",
            disabled: "",
            iconData: "el-icon-arrow-down",
            DataList: [],
            tableList: [],
            list: [],
            Treedata: [],
            defaultProps: {
                children: "tjProjectList",
                label: "proName",
                disabled: function (data, node) {
                    if (data.tjProjectList && data.tjProjectList.length > 0) {
                        return false
                    }
                    else {
                        return true
                    }
                }
            },
            // 选中数组
            ids: [],
            getInfodis: "",
            waterId: "",
            isfalse: false,
            toggleSearchStatus: "0",
            queryParams: {
                name: "",
@@ -249,7 +280,7 @@
            },
            formIn: {
                name: "",
                tjPro: "体检费",
                tjPro: "",
                phone: "",
                number: 1,
                ys: "0",
@@ -264,11 +295,12 @@
            // 表单参数
            form: {
                name: "",
                tjPro: "体检费",
                tjPro: "",
                tjProName: "体检费",
                phone: "",
                number: 1,
                ys: "0",
                ss: "0",
                ys: 0,
                ss: 0,
                type: "0",
                zk: 10,
@@ -374,11 +406,12 @@
        resetQuery() {
            this.form = {
                name: null,
                tjPro: "体检费",
                tjPro: null,
                phone: null,
                tjProName: "体检费",
                number: 1,
                ys: "0",
                ss: "0",
                ys: 0.00,
                ss: 0.00,
                type: "0",
                zk: 10,
            };
@@ -392,48 +425,85 @@
        handleUpdate() {
            getFlowingWaterList(this.queryParams).then(res => {
                this.tableList = res.data
                this.tableList.forEach(element => {
                    element.proname = "体检费"
                });
            })
        },
        hadeltjpro() {
            /** 查询部门下拉树结构 */
            projectGetList().then((response) => {
                this.Treedata = response.data.list;
            });
            this.Projectopen1 = true;
            this.title = "项目列表";
        },
        // 点击获取每个树节点
        handleCurrentChecked(data, checked, checkedNodes) {
            console.log(data, checked)
            // this.form.tjPro = "",
            //     this.form.ys = 0
            if (checked) {
                // this.menuOptions.id = data.id
                this.$refs.tree.setCheckedKeys([data.proId], true)
            } else {
                // this.menuOptions.id = null
            }
            if (checked == true) {
                this.form.tjPro = data.proId
                this.form.tjProName = data.proName
                const r = /^\+?[0-9][0-9]*$/; //正整数(可以0打头)
                if (r.test(data.proPrice)) {
                    this.form.ys = data.proPrice + ".00";
                } else {
                    this.form.ys = data.proPrice
                }
            }
            this.Projectopen1 = false;
        },
        // 折扣
        numberChange(currentValue, oldValue) {
            this.form.zk = currentValue;
            this.form.ss = (
                this.form.ys *
                (this.form.zk / 10)
            ).toFixed(2);
            const r = /^\+?[0-9][0-9]*$/; //正整数(可以以打头)
            //const r=/^\+?[1-9][0-9]*$/;//正整数
            if (r.test(this.form.ss)) {
                this.form.ss = this.form.ss + ".00";
            }
        numberChange() {
            let price = (this.form.ss / this.form.ys) * 10
            this.form.zk = price.toFixed(2)
        },
        receipt(row) {
            this.formIn = {
                name: row.customer.cusName,
                tjPro: "体检费",
                phone: row.customer.cusPhone,
                ys: row.copeWith,
                ss: row.paidIn,
                zk: row.discount,
            }
            this.$nextTick(() => {
                const style =
                    "@media print { @page{margin:0 10mm,size:4mm 6mm;}};"; //打印时去掉眉页眉尾
                printJS({
                    printable: "printBill", // 标签元素id
                    noPrint: ".noPrint",
                    type: 'html',
                    header: "",
                    targetStyles: ["*"],
                    maxWidth: "800",
                    scanStyles: true, //打印必须加上,不然页面上的css样式无效
                    style,
                });
            });
            getPrintSetUp().then(res => {
                if (res.msg == "0") {
                    this.formIn = {
                        name: row.customer.cusName,
                        tjPro: row.tjProName,
                        phone: row.customer.cusPhone,
                        ys: row.copeWith,
                        ss: row.paidIn,
                        zk: row.discount,
                    }
                    this.$nextTick(() => {
                        const style =
                            "@media print { @page{margin:0 10mm,size:4mm 6mm;}};"; //打印时去掉眉页眉尾
                        printJS({
                            printable: "printBill", // 标签元素id
                            noPrint: ".noPrint",
                            type: 'html',
                            header: "",
                            targetStyles: ["*"],
                            maxWidth: "800",
                            scanStyles: true, //打印必须加上,不然页面上的css样式无效
                            style,
                        });
                    });
                } else {
                    const tjnumber = row.tjNumber;
                    const viewNum = "809623418249637888";
                    const params = { viewNum, tjnumber };
                    this.$tab.openPage("个人发票", "/report/charge", params);
                }
                this.resetQuery()
                this.handleUpdate()
                this.getList()
            })
        },
        // 收费
@@ -442,29 +512,40 @@
                this.formIn = this.form
                addOrderAndDetail(this.form).then(res => {
                    if (res.code == 200) {
                        this.tjNumbers = res.msg
                        this.$modal.msgSuccess("收费成功");
                        getPrintSetUp().then(res => {
                            if (res.msg == "0") {
                                this.$nextTick(() => {
                                    const style =
                                        "@media print { @page{margin:0 10mm,size:4mm 6mm;}};"; //打印时去掉眉页眉尾
                                    printJS({
                                        printable: "printBill", // 标签元素id
                                        noPrint: ".noPrint",
                                        type: 'html',
                                        header: "",
                                        targetStyles: ["*"],
                                        maxWidth: "800",
                                        scanStyles: true, //打印必须加上,不然页面上的css样式无效
                                        style,
                                    });
                                });
                        this.$nextTick(() => {
                            const style =
                                "@media print { @page{margin:0 10mm,size:4mm 6mm;}};"; //打印时去掉眉页眉尾
                            printJS({
                                printable: "printBill", // 标签元素id
                                noPrint: ".noPrint",
                                type: 'html',
                                header: "",
                                targetStyles: ["*"],
                                maxWidth: "800",
                                scanStyles: true, //打印必须加上,不然页面上的css样式无效
                                style,
                            });
                        });
                        this.resetQuery()
                        this.handleUpdate()
                        this.getList()
                            } else {
                                const tjnumber = this.tjNumbers;
                                const viewNum = "809623418249637888";
                                const params = { viewNum, tjnumber };
                                this.$tab.openPage("个人发票", "/report/charge", params);
                            }
                            this.resetQuery()
                            this.handleUpdate()
                            this.getList()
                        })
                    }
                })
            } else {
                this.$modal.msgError("请填写带星号信息");
                this.$modal.msgError("请填写姓名");
            }
        },