Преглед изворни кода

服务预约单列表和详情

NULL1222 пре 1 недеља
родитељ
комит
4a43e64c4d

+ 223 - 0
src/bgj/serviceAppointment/index.vue

@@ -0,0 +1,223 @@
+<template>
+    <div>
+        <basicLayout
+            ref="list"
+            formPath="serviceAppointment"
+            tableName="serviceAppointmentTable"
+            idName="sc_serviceformid"
+            :apiId="{ query: 2026052013163202 }"
+            :detailPath="{
+                path: '/serviceAppointmentDetail',
+            }"
+        >
+            <template #custom>
+                <div class="mt-10">
+                    <label class="search__label">{{ $t("状态") }}:</label>
+                    <el-select
+                        class="inline-24"
+                        v-model="status"
+                        :placeholder="$t(`请选择状态`)"
+                        @change="selectChange"
+                        size="small"
+                        clearable
+                    >
+                        <el-option
+                            :label="$t(`待处理`)"
+                            value="待处理"
+                        ></el-option>
+                        <el-option
+                            :label="$t(`进行中`)"
+                            value="进行中"
+                        ></el-option>
+                        <el-option
+                            :label="$t(`待验收`)"
+                            value="待验收"
+                        ></el-option>
+                        <el-option
+                            :label="$t(`已完成`)"
+                            value="已完成"
+                        ></el-option>
+                    </el-select>
+                </div>
+                <div class="mt-10">
+                    <label class="search__label">{{ $t("服务类型") }}:</label>
+                    <el-select
+                        class="inline-24"
+                        v-model="where.type"
+                        :placeholder="$t(`请选择工单类型`)"
+                        @focus="queryType('serviceworktype')"
+                        @change="selectChange"
+                        size="small"
+                        clearable
+                    >
+                        <el-option
+                            v-for="item in options.serviceworktype"
+                            :key="item.value"
+                            :label="$t(item.value)"
+                            :value="item.value"
+                        >
+                        </el-option>
+                    </el-select>
+                </div>
+                <div class="mt-10">
+                    <label class="search__label">{{ $t("创建时间") }}:</label>
+                    <el-date-picker
+                        style="margin-right: 24px !important"
+                        size="small"
+                        @change="selectChange"
+                        value-format="yyyy-MM-dd"
+                        v-model="createDate"
+                        type="daterange"
+                        :range-separator="$t(`至`)"
+                        :start-placeholder="$t(`开始日期`)"
+                        :end-placeholder="$t(`结束日期`)"
+                        clearable
+                    >
+                    </el-date-picker>
+                </div>
+                <div class="mt-10">
+                    <label class="search__label">{{ $t("完成时间") }}:</label>
+                    <el-date-picker
+                        style="margin-right: 24px !important"
+                        size="small"
+                        @change="selectChange"
+                        value-format="yyyy-MM-dd"
+                        v-model="finishDate"
+                        type="daterange"
+                        :range-separator="$t(`至`)"
+                        :start-placeholder="$t(`开始日期`)"
+                        :end-placeholder="$t(`结束日期`)"
+                        clearable
+                    >
+                    </el-date-picker>
+                </div>
+            </template>
+            <template v-slot:tbList="scope">
+                <div v-if="scope.data.column.columnname == 'status'">
+                    <span
+                        :style="
+                            tool.getStatusColor(
+                                scope.data.column.data[
+                                    [scope.data.column.columnname]
+                                ]
+                            )
+                        "
+                        >{{
+                            $t(
+                                scope.data.column.data[
+                                    [scope.data.column.columnname]
+                                ]
+                            )
+                        }}</span
+                    >
+                </div>
+                <div v-else-if="scope.data.column.columnname == 'city'">
+                    <span>
+                        {{ $t(scope.data.column.data.province)
+                        }}{{ $t(scope.data.column.data.city)
+                        }}{{ $t(scope.data.column.data.county) }}
+                    </span>
+                </div>
+                <div v-else>
+                    {{
+                        scope.data.column.data[[scope.data.column.columnname]]
+                            ? $t(
+                                  scope.data.column.data[
+                                      [scope.data.column.columnname]
+                                  ]
+                              )
+                            : "--"
+                    }}
+                </div>
+            </template>
+            <template v-slot:tbOpreation="scope">
+                <changeBill
+                    v-if="
+                        mainData.status == '待处理' &&
+                        tool.checkAuth($route.name, 'changeBill')
+                    "
+                    class="inline-16"
+                    @onSuccess="onSuccess"
+                    :data="scope.data.data"
+                ></changeBill>
+                <assignAgent
+                    v-if="
+                        mainData.status == '待处理' &&
+                        tool.checkAuth($route.name, 'assignAgent')
+                    "
+                    class="inline-16"
+                    @onSuccess="onSuccess"
+                    :data="scope.data.data"
+                ></assignAgent>
+            </template>
+        </basicLayout>
+    </div>
+</template>
+
+<script>
+import changeBill from "./modules/changeBill";
+import assignAgent from "./modules/assignAgent";
+export default {
+    components: {
+        changeBill,
+        assignAgent,
+    },
+    data() {
+        return {
+            options: {
+                serviceworktype: [],
+            },
+            where: {
+                status: [], //工单状态,可多选
+                type: "", //服务类型
+                begindate_createdate: "",
+                enddate_createdate: "",
+                begindate_finishdate: "",
+                enddate_finishdate: "",
+            },
+            status: "",
+            createDate: "",
+            finishDate: "",
+        };
+    },
+    methods: {
+        async queryType(type) {
+            if (this.options[type].length == 0) {
+                const res = await this.$store.dispatch(
+                    "optiontypeselect",
+                    "servicebookingtype"
+                );
+                this.options[type] = res.data;
+            }
+        },
+        selectChange() {
+            if (this.status) {
+                this.where.status = [this.status];
+            } else {
+                this.where.status = [];
+            }
+            if (this.createDate) {
+                this.where.begindate_createdate = this.createDate[0];
+                this.where.enddate_createdate = this.createDate[1];
+            } else {
+                this.where.begindate_createdate = "";
+                this.where.enddate_createdate = "";
+            }
+            if (this.finishDate) {
+                this.where.begindate_finishdate = this.finishDate[0];
+                this.where.enddate_finishdate = this.finishDate[1];
+            } else {
+                this.where.begindate_finishdate = "";
+                this.where.enddate_finishdate = "";
+            }
+            this.$refs.list.param.content.where = this.where;
+            this.$refs.list.param.content.pageNumber = 1;
+            this.$refs.list.listData();
+        },
+        onSuccess() {
+            this.$refs.list.listData();
+        },
+    },
+};
+</script>
+<style></style>

+ 178 - 0
src/bgj/serviceAppointment/modules/assignAgent.vue

@@ -0,0 +1,178 @@
+<template>
+    <div>
+        <el-button
+            size="mini"
+            :type="btnType ? btnType : 'text'"
+            @click="show"
+            >{{ $t("指派经销商") }}</el-button
+        >
+        <el-drawer
+            append-to-body
+            :show-close="false"
+            :visible.sync="dialogFormVisible"
+            size="800px"
+        >
+            <div slot="title" style="font-size: 15px">
+                <span style="margin-right: 16px">{{ $t("指派经销商") }}</span>
+            </div>
+            <div class="drawer__panel">
+                <el-input
+                    style="width: 250px; margin-bottom: 10px"
+                    size="small"
+                    :placeholder="$t('请输入搜索内容')"
+                    clearable
+                    @clear="getAgentList((params.content.pageNumber = 1))"
+                    v-model="params.content.where.condition"
+                    @keyup.enter.native="
+                        getAgentList((params.content.pageNumber = 1))
+                    "
+                ></el-input>
+                <selectTable
+                    @rowClick="handleRowClick"
+                    v-if="dialogFormVisible"
+                    idName="sa_agentsid"
+                    ref="table"
+                    v-model="result"
+                    :layout="tablecols"
+                    :data="agentList"
+                    :showSelection="false"
+                    height="500px"
+                    :custom="true"
+                >
+                    <template v-slot:customcol="scope">
+                        <div>
+                            {{
+                                scope.column.data[[scope.column.columnname]]
+                                    ? scope.column.data[
+                                          [scope.column.columnname]
+                                      ]
+                                    : "--"
+                            }}
+                        </div>
+                    </template>
+                </selectTable>
+                <div class="container normal-panel" style="text-align: right">
+                    <el-pagination
+                        style="text-align: right"
+                        background
+                        small
+                        @size-change="handleSizeChange"
+                        @current-change="handleCurrentChange"
+                        :current-page="params.content.pageNumber"
+                        :page-size="params.content.pageSize"
+                        layout="total, prev, pager, next, jumper"
+                        :total="total"
+                    >
+                    </el-pagination>
+                </div>
+            </div>
+        </el-drawer>
+    </div>
+</template>
+
+<script>
+import selectTable from "@/components/selectTable/index";
+export default {
+    name: "add",
+    components: { selectTable },
+    props: ["data", "btnType"],
+    data() {
+        return {
+            dialogFormVisible: false,
+            result: [],
+            selectArr: [],
+            isLength: true,
+            agentList: [],
+            tablecols: [],
+            total: 0,
+            params: {
+                id: 2026052016055302,
+                content: {
+                    pageNumber: 1,
+                    pageSize: 20,
+                    where: {
+                        condition: "",
+                    },
+                },
+            },
+        };
+    },
+    watch: {
+        dialogFormVisible(val) {
+            if (!val) {
+                this.$refs.table.allArr = [];
+            }
+        },
+    },
+    methods: {
+        show() {
+            this.dialogFormVisible = true;
+            this.getAgentList();
+            this.tablecols = this.tool.tabelCol(
+                this.$route.name
+            ).assignAgentTable.tablecols;
+        },
+        async getAgentList() {
+            let res = await this.$api.requested(this.params);
+            this.agentList = res.data;
+            this.total = res.total;
+        },
+        // selectChange(data) {
+        //     this.selectArr = data;
+        //     this.isLength = data.length < 1;
+        //     console.log("data", data);
+        // },
+        handleRowClick(row) {
+            this.$confirm(
+                this.$t("是否确定将当前服务预约单指派给") +
+                    this.$t(row.enterprisename) +
+                    this.$t("受理") +
+                    "?",
+                this.$t("提示"),
+                {
+                    confirmButtonText: this.$t("确定"),
+                    cancelButtonText: this.$t("取消"),
+                    type: "warning",
+                }
+            )
+                .then(() => {
+                    this.assignAgent(row);
+                })
+                .catch(() => {});
+        },
+        async assignAgent(row) {
+            const res = await this.$api.requested({
+                id: 2026052013194802,
+                content: {
+                    sc_serviceformid: this.data.sc_serviceformid,
+                    sa_agentsid: row.sa_agentsid,
+                },
+            });
+            if (res.code == 1) {
+                this.$message.success(this.$t("指派成功"));
+                this.dialogFormVisible = false;
+                this.$emit("onSuccess");
+            }
+        },
+        handleSizeChange(val) {
+            // console.log(`每页 ${val} 条`);
+            this.params.content.pageSize = val;
+            this.getAgentList();
+        },
+        handleCurrentChange(val) {
+            // console.log(`当前页: ${val}`);
+            this.params.content.pageNumber = val;
+            this.getAgentList();
+        },
+    },
+};
+</script>
+
+<style scoped>
+.dialog-footer {
+    margin-top: 0;
+}
+.el-select {
+    width: 100% !important;
+}
+</style>

+ 251 - 0
src/bgj/serviceAppointment/modules/changeBill.vue

@@ -0,0 +1,251 @@
+<template>
+    <div>
+        <el-button
+            size="mini"
+            :type="btnType ? btnType : 'text'"
+            @click="show"
+            >{{ $t("转工单") }}</el-button
+        >
+        <el-drawer
+            append-to-body
+            :show-close="false"
+            :visible.sync="dialogFormVisible"
+            size="600px"
+        >
+            <div slot="title" style="font-size: 15px">
+                <span style="margin-right: 16px"
+                    >{{ data && data.billno ? data.billno + "_" : ""
+                    }}{{ $t("转工单") }}</span
+                >
+            </div>
+            <div class="drawer__panel">
+                <el-row :gutter="20">
+                    <el-form
+                        :model="form"
+                        :rules="rules"
+                        ref="form"
+                        :label-width="tool.onlyZh('90px')"
+                        label-position="top"
+                        size="mini"
+                    >
+                        <el-col :span="24">
+                            <el-form-item
+                                :label="$t(`工单模板`)"
+                                prop="sc_workorder_templateid"
+                            >
+                                <el-select
+                                    class="inline-24"
+                                    @change="modelChange"
+                                    v-model="form.sc_workorder_templateid"
+                                    :placeholder="$t(`请选择模板`)"
+                                    size="small"
+                                    clearable
+                                >
+                                    <el-option
+                                        v-for="(item, index) in serveModelList"
+                                        :key="index"
+                                        :label="$t(item.name)"
+                                        :value="item.sc_workorder_templateid"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t(`工单类型`)" prop="type">
+                                <el-input
+                                    size="mini"
+                                    type="text"
+                                    :placeholder="$t(`请先选择工单模板`)"
+                                    :disabled="true"
+                                    v-model="form.type"
+                                ></el-input>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item
+                                :label="$t('负责人')"
+                                prop="leader_userid"
+                            >
+                                <el-select
+                                    class="inline-24"
+                                    v-model="form.leader_userid"
+                                    :placeholder="$t(`请选择负责人`)"
+                                    size="small"
+                                    clearable
+                                >
+                                    <el-option
+                                        v-for="(item, index) in leaderList"
+                                        :key="index"
+                                        :label="`${$t(item.name)} ${$t(
+                                            item.position
+                                        )}`"
+                                        :value="item.userid"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item
+                                :label="$t('参与人')"
+                                prop="part_userids"
+                            >
+                                <el-select
+                                    class="inline-24"
+                                    v-model="form.part_userids"
+                                    :placeholder="$t(`请选择参与人`)"
+                                    size="small"
+                                    clearable
+                                    multiple
+                                >
+                                    <el-option
+                                        v-for="(item, index) in leaderList"
+                                        :key="index"
+                                        :label="`${$t(item.name)} ${$t(
+                                            item.position
+                                        )}`"
+                                        :value="item.userid"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item :label="$t('备注:')" prop="remarks">
+                                <el-input
+                                    type="textarea"
+                                    v-model="form.remarks"
+                                    :placeholder="$t('请填写备注')"
+                                ></el-input>
+                            </el-form-item>
+                        </el-col>
+                    </el-form>
+                </el-row>
+            </div>
+            <div class="fixed__btn__panel">
+                <el-button
+                    size="small"
+                    @click="dialogFormVisible = false"
+                    class="normal-btn-width"
+                    >{{ $t("取 消") }}</el-button
+                >
+                <el-button
+                    size="small"
+                    type="primary"
+                    @click="onSubmit"
+                    class="normal-btn-width"
+                    >{{ $t("确 定") }}</el-button
+                >
+            </div>
+        </el-drawer>
+    </div>
+</template>
+
+<script>
+export default {
+    name: "add",
+    components: {},
+    props: ["data", "btnType"],
+    data() {
+        return {
+            dialogFormVisible: false,
+            serveModelList: [],
+            serveClassList: [],
+            leaderList: [],
+            form: {
+                sc_serviceformid: "",
+                type: "",
+                sc_workorder_templateid: "",
+                leader_userid: "",
+                part_userids: [],
+                remarks: "",
+            },
+            rules: {
+                sc_workorder_templateid: [
+                    {
+                        required: true,
+                        message: this.$t("请选择工单模板"),
+                        trigger: "blur",
+                    },
+                ],
+                type: [
+                    {
+                        required: true,
+                        message: this.$t("请先选择工单模板"),
+                        trigger: "blur",
+                    },
+                ],
+                leader_userid: [
+                    {
+                        required: true,
+                        message: this.$t("请选择负责人"),
+                        trigger: "blur",
+                    },
+                ],
+            },
+        };
+    },
+    methods: {
+        show() {
+            this.form.remarks = this.data.remarks;
+            this.dialogFormVisible = true;
+            this.getServeModel();
+            this.getLeaderList();
+        },
+        onSubmit() {
+            this.$refs["form"].validate(async (valid) => {
+                if (!valid) return false;
+                this.form.sc_serviceformid = this.$route.query.id;
+                const res = await this.$api.requested({
+                    id: "2026052013202502",
+                    version: 1,
+                    content: this.form,
+                });
+                this.tool.showMessage(res, () => {
+                    this.$emit("onSuccess");
+                    this.dialogFormVisible = false;
+                });
+            });
+        },
+        modelChange(data) {
+            this.form.type = this.serveModelList.find(
+                (item) => item.sc_workorder_templateid == data
+            ).type;
+        },
+        async getServeModel() {
+            let res = await this.$api.requested({
+                id: 2026051511261302,
+                content: {
+                    pageNumber: 1,
+                    pageSize: 100,
+                    where: {
+                        condition: "",
+                    },
+                },
+            });
+            this.serveModelList = res.data;
+        },
+        async getLeaderList() {
+            let res = await this.$api.requested({
+                id: 2026052109150402,
+                content: {
+                    pageNumber: 1,
+                    pageSize: 100,
+                    where: {
+                        condition: "",
+                    },
+                },
+            });
+            this.leaderList = res.data;
+            console.log("this.leaderList", this.leaderList);
+        },
+    },
+};
+</script>
+
+<style scoped>
+.dialog-footer {
+    margin-top: 0;
+}
+.el-select {
+    width: 100% !important;
+}
+</style>

+ 253 - 0
src/bgj/serviceAppointment/modules/detail.vue

@@ -0,0 +1,253 @@
+<template>
+    <div>
+        <basicDetails
+            ref="details"
+            :titleText="mainData.billno"
+            :editData="mainData"
+            :mainAreaData="mainAreaData"
+            turnPageId="2026051510000003"
+            idname="sc_serviceformid"
+            ownertable="sc_serviceform"
+            tags=""
+            :tabs="['服务预约', '关联工单']"
+            :column="5"
+            @pageChange="pageChange"
+            @onEditSuccess="queryMainData($route.query.id)"
+        >
+            <div slot="tags"></div>
+            <template slot="customOperation">
+                <changeBill
+                    v-if="
+                        mainData.status == '待处理' &&
+                        tool.checkAuth($route.name, 'changeBill')
+                    "
+                    class="inline-16"
+                    btnType="primary"
+                    @onSuccess="queryMainData"
+                    :data="mainData"
+                ></changeBill>
+                <assignAgent
+                    v-if="
+                        mainData.status == '待处理' &&
+                        tool.checkAuth($route.name, 'assignAgent')
+                    "
+                    class="inline-16"
+                    btnType="primary"
+                    @onSuccess="queryMainData"
+                    :data="mainData"
+                ></assignAgent>
+            </template>
+            <div slot="slot0">
+                <base-info
+                    v-if="detailInfo"
+                    :detailInfo="detailInfo"
+                ></base-info>
+            </div>
+            <div slot="slot1"></div>
+        </basicDetails>
+    </div>
+</template>
+
+<script>
+import BaseInfo from "@/bgj/headquartersServiceMaterial/modules/baseInfo";
+import changeBill from "./changeBill";
+import assignAgent from "./assignAgent";
+export default {
+    name: "detail",
+    data() {
+        return {
+            mainData: {},
+            mainAreaData: {},
+            detailInfo: "",
+            btnLoading: false,
+        };
+    },
+    components: { BaseInfo, changeBill, assignAgent },
+    methods: {
+        async queryMainData() {
+            const res = await this.$api.requested({
+                id: 2026052013170002,
+                content: {
+                    nocache: true,
+                    sc_serviceformid: this.$route.query.id,
+                },
+            });
+            this.mainData = res.data;
+            this.changeDataStructure();
+            console.log("this.mainData", this.mainData);
+        },
+        changeDataStructure() {
+            let that = this;
+            this.mainAreaData = [
+                {
+                    label: "预约单号",
+                    value: this.mainData.billno,
+                },
+                {
+                    label: "状态",
+                    value: this.$t(this.mainData.status),
+                    style: function () {
+                        let style = that.tool.getStatusColor(
+                            that.mainData.status
+                        );
+                        return style;
+                    },
+                },
+                {
+                    label: "服务类型",
+                    value: this.mainData.type,
+                },
+                {
+                    label: "客户姓名",
+                    value: this.mainData.name,
+                },
+                {
+                    label: "客户电话",
+                    value: this.mainData.phonenumber,
+                },
+                {
+                    label: "省市县",
+                    value:
+                        this.mainData.province +
+                        this.mainData.city +
+                        this.mainData.county,
+                },
+                {
+                    label: "详细地址",
+                    value: this.mainData.address,
+                },
+                {
+                    label: "厨房数",
+                    value: this.mainData.kitchen,
+                },
+                {
+                    label: "卫生间数",
+                    value: this.mainData.toilet,
+                },
+                {
+                    label: "阳台数",
+                    value: this.mainData.balcony,
+                },
+                {
+                    label: "经销商",
+                    value: this.mainData.enterprisename,
+                },
+                {
+                    label: "创建时间",
+                    value: this.mainData.createdate,
+                },
+                {
+                    label: "完成时间",
+                    value: this.mainData.finishdate,
+                },
+                {
+                    label: "备注",
+                    value: this.mainData.remarks,
+                },
+            ];
+            this.detailInfo = {
+                baseInfo: [
+                    {
+                        label: "预约单号",
+                        value: this.mainData.billno,
+                    },
+                    {
+                        label: "服务类型",
+                        value: this.mainData.type,
+                    },
+                    {
+                        label: "状态",
+                        value: this.$t(this.mainData.status),
+                        style: function () {
+                            let style = that.tool.getStatusColor(
+                                that.mainData.status
+                            );
+                            return style;
+                        },
+                    },
+                    {
+                        label: "客户姓名",
+                        value: this.mainData.name,
+                    },
+                    {
+                        label: "客户电话",
+                        value: this.mainData.phonenumber,
+                    },
+                    {
+                        label: "省市县",
+                        value:
+                            this.mainData.province +
+                            this.mainData.city +
+                            this.mainData.county,
+                    },
+                    {
+                        label: "详细地址",
+                        value: this.mainData.address,
+                    },
+                    {
+                        label: "厨房数",
+                        value: this.mainData.kitchen,
+                    },
+                    {
+                        label: "卫生间数",
+                        value: this.mainData.toilet,
+                    },
+                    {
+                        label: "阳台数",
+                        value: this.mainData.balcony,
+                    },
+                    {
+                        label: "现场联系人",
+                        value: this.mainData.scenecontact,
+                    },
+                    {
+                        label: "现场联系人电话",
+                        value: this.mainData.scenecontactphonenumber,
+                    },
+                    {
+                        label: "经销商",
+                        value: this.mainData.enterprisename,
+                    },
+                ],
+                systemInfo: [
+                    {
+                        label: "创建时间",
+                        value: this.mainData.createdate,
+                    },
+                    {
+                        label: "创建人",
+                        value: this.mainData.createby,
+                    },
+                    {
+                        label: "指派时间",
+                        value: this.mainData.assigndate,
+                    },
+                    {
+                        label: "转单人",
+                        value: this.mainData.transformby,
+                    },
+                    {
+                        label: "转单时间",
+                        value: this.mainData.transformdate,
+                    },
+                ],
+            };
+        },
+        // 监听切换数据,上一页,下一页
+        pageChange(id, rowindex, tabIndex) {
+            this.flag = false;
+            tabIndex = this.$route.query.tabIndex;
+            this.$router.replace({
+                path: "/ourServiceMaterialDetail",
+                query: { id: id, rowindex: rowindex, tabIndex: tabIndex },
+            });
+            this.queryMainData(id);
+        },
+    },
+    mounted() {
+        this.queryMainData(this.$route.query.id);
+    },
+};
+</script>
+
+<style scoped></style>

+ 13 - 2
src/components/selectTable/index.vue

@@ -1,7 +1,8 @@
 <template>
   <div>
-    <el-table ref="tables" :fit="tool.calculatedColumnWidth($refs.tables,layout)"  @select="aaaa" @select-all="selectAll" v-loading="loading" highlight-current-row :data="data" size="mini" :height="height" style="width:100%"  border>
+    <el-table ref="tables" :fit="tool.calculatedColumnWidth($refs.tables,layout)"  @select="aaaa" @select-all="selectAll" @row-click="handleRowClick" v-loading="loading" highlight-current-row :data="data" size="mini" :height="height" style="width:100%"  border>
         <el-table-column
+        v-if="showSelection !== false"
         type="selection"
         width="45"
         align="center"
@@ -30,7 +31,7 @@ export default {
     custom:是否启用自定义结构;
     opwidth:操作列宽度
   */
-  props:['layout','data','custom','height','fixedName','idName'],
+  props:['layout','data','custom','height','fixedName','idName','showSelection'],
   data () {
     return {
       list:[],
@@ -69,6 +70,16 @@ export default {
       console.log(this.allArr);
       this.$emit('selectChange',this.allArr)
     },
+    handleRowClick (row) {
+      this.$refs["tables"].toggleRowSelection(row);
+      let index = this.allArr.findIndex(v => v[this.idName] == row[this.idName]);
+      if (index == -1) {
+        this.allArr.push(row);
+      } else {
+        this.allArr.splice(index, 1);
+      }
+      this.$emit('rowClick', row);
+    },
     selectAll (val) {
       if (val.length == 0) {
         this.data.forEach(item => {

+ 23 - 0
src/router/bgj.js

@@ -91,5 +91,28 @@ const bgj = [
       },
     ],
   },
+  {
+    path: '/serviceAppointment',
+    name: 'serviceAppointment',
+    meta: {
+      title: '服务预约单',
+      ast_nav: true,
+      keeproute: true,
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/bgj/serviceAppointment/index'),
+    children: [
+      {
+        path: '/serviceAppointmentDetail',
+        name: 'serviceAppointment',
+        meta: {
+          title: '服务预约单详情',
+          ast_nav: true,
+          keeproute: true,
+        },
+        component: () =>
+          import(/* webpackChunkName: "about" */ '@/bgj/serviceAppointment/modules/detail'),
+      },
+    ],
+  },
 ];
 export default bgj;