<template>
    <!-- 弹出框表单 -->
    <el-drawer
            :title="title"
            :visible.sync="open"
            :direction="direction"
            :destroy-on-close="true"
            size="50%">
        <el-form ref="form" :model="form" :rules="rules" label-width="120px">
            <el-row>
                                            <Field label="评价人身份证号" prop="peopleIdcard" v-model="form.peopleIdcard" placeholder="请输入评价人身份证号"/>
                            <Field label="评价人姓名" prop="peopleName" v-model="form.peopleName" placeholder="请输入评价人姓名"/>
                            <Field label="评价人性别" prop="peopleSex" v-model="form.peopleSex" placeholder="请输入评价人性别"/>
                            <Field label="评价人手机号" prop="peoplePhone" v-model="form.peoplePhone" placeholder="请输入评价人手机号"/>
                            <Field label="评价选项" prop="pjOption" v-model="form.pjOption" type="select" :enumData="dict.pjOption" placeholder="请选择评价选项"/>
                            <Field label="评价标签" prop="contentTag" v-model="form.contentTag" type="textarea" placeholder="请输入评价标签"/>
                            <Field label="评价人图片地址" prop="picUrl" v-model="form.picUrl" placeholder="请输入评价人图片地址"/>
                            <Field label="部门" prop="sectionName" v-model="form.sectionName" placeholder="请输入部门"/>
                            <Field label="大厅" prop="hallName" v-model="form.hallName" placeholder="请输入大厅"/>
                            <Field label="评价来源 " prop="pjSource" v-model="form.pjSource" type="select" :enumData="dict.pjSource" placeholder="请选择评价来源 "/>
                            <Field label="手输意见" prop="opinion" v-model="form.opinion" type="textarea" placeholder="请输入手输意见"/>
                            <Field label="窗口名" prop="windowName" v-model="form.windowName" placeholder="请输入窗口名"/>
                            <Field label="窗口编号" prop="windowFromnum" v-model="form.windowFromnum" placeholder="请输入窗口编号"/>
                            <Field label="排号编号" prop="flounum" v-model="form.flounum" placeholder="请输入排号编号"/>
                            <Field label="窗口评价" prop="pjxt" v-model="form.pjxt" type="select" :enumData="dict.pjxt" placeholder="请选择窗口评价"/>
                            <Field label="工作人员姓名" prop="workmanName" v-model="form.workmanName" placeholder="请输入工作人员姓名"/>
                            <Field label="工作人员工号" prop="workmanNumber" v-model="form.workmanNumber" placeholder="请输入工作人员工号"/>
                            <Field label="评价器mac" prop="devicenum" v-model="form.devicenum" placeholder="请输入评价器mac"/>
                            <Field label="评价状态" prop="evaluatestatus" v-model="form.evaluatestatus" placeholder="请输入评价状态"/>
                            <Field label="截图还是评价 " prop="evaluatetype" v-model="form.evaluatetype" type="radio" :enumData="dict.evaluatetype" />
                            <Field label="截图地址" prop="photobefor" v-model="form.photobefor" type="textarea" placeholder="请输入截图地址"/>
                            <Field label="签字图片" prop="photoautograph" v-model="form.photoautograph" type="textarea" placeholder="请输入签字图片"/>
                            <Field label="抓拍评价人照片" prop="picture" v-model="form.picture" type="textarea" placeholder="请输入抓拍评价人照片"/>
                            <Field label="音频视频地址" prop="process" v-model="form.process" type="textarea" placeholder="请输入音频视频地址"/>
                            <Field label="评价标记 " prop="eyevaluate" v-model="form.eyevaluate" type="select" :enumData="dict.eyevaluate" placeholder="请选择评价标记 "/>
                            <Field label="评价指向 " prop="pjType" v-model="form.pjType" type="select" :enumData="dict.pjType" placeholder="请选择评价指向 "/>
                            <Field label="评价时间" prop="pjTime" v-model="form.pjTime" type="datetime" />
                            <Field label="站点编码" prop="siteCode" v-model="form.siteCode" placeholder="请输入站点编码"/>
                            <Field label="站点名称" prop="siteName" v-model="form.siteName" placeholder="请输入站点名称"/>
                            <Field label="扩展编号" prop="extNum" v-model="form.extNum" placeholder="请输入扩展编号"/>

            </el-row>

            <form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn />
        </el-form>

    </el-drawer>
</template>

<script>
    import form from "@/assets/mixins/formdialog";
    export default {
        name: "PjEvaluateDetail",
        mixins: [form],
        components: {

        },
        created() {
            this.changePath("pj/evaluate")
        },
        data() {
            return {
                // 遮罩层
                loading: true,
                // 弹出层标题
                title: "评价汇总",
                // 是否显示弹出层
                open: false,
                direction:"rtl",
                toString:[
                ],
                toDate:[
                    "pjTime",
                ],
                // 表单校验
                rules: {
                    peopleIdcard: [
                        {required: true,message: "请输入评价人身份证号", trigger: "blur" },
                        {max: 64,message: "最多只能录入64个字符",trigger: "blur",},
                    ],
                    peopleName: [
                        {required: true,message: "请输入评价人姓名", trigger: "blur" },
                        {max: 64,message: "最多只能录入64个字符",trigger: "blur",},
                    ],
                    peopleSex: [
                        {required: true,message: "请输入评价人性别", trigger: "blur" },
                        {max: 6,message: "最多只能录入6个字符",trigger: "blur",},
                    ],
                    peoplePhone: [
                        {required: true,message: "请输入评价人手机号", trigger: "blur" },
                        {max: 20,message: "最多只能录入20个字符",trigger: "blur",},
                    ],
                    pjOption: [
                        {required: true,message: "请输入评价选项", trigger: "blur" },
                        {max: 32,message: "最多只能录入32个字符",trigger: "blur",},
                    ],
                    contentTag: [
                        {required: true,message: "请输入评价标签", trigger: "blur" },
                        {max: 255,message: "最多只能录入255个字符",trigger: "blur",},
                    ],
                    picUrl: [
                        {required: true,message: "请输入评价人图片地址", trigger: "blur" },
                        {max: 128,message: "最多只能录入128个字符",trigger: "blur",},
                    ],
                    sectionName: [
                        {required: true,message: "请输入部门", trigger: "blur" },
                        {max: 128,message: "最多只能录入128个字符",trigger: "blur",},
                    ],
                    hallName: [
                        {required: true,message: "请输入大厅", trigger: "blur" },
                        {max: 128,message: "最多只能录入128个字符",trigger: "blur",},
                    ],
                    pjSource: [
                        {required: true,message: "请输入评价来源 ", trigger: "blur" },
                        {max: 20,message: "最多只能录入20个字符",trigger: "blur",},
                    ],
                    windowName: [
                        {required: true,message: "请输入窗口名", trigger: "blur" },
                        {max: 128,message: "最多只能录入128个字符",trigger: "blur",},
                    ],
                    windowFromnum: [
                        {required: true,message: "请输入窗口编号", trigger: "blur" },
                        {max: 128,message: "最多只能录入128个字符",trigger: "blur",},
                    ],
                    workmanName: [
                        {required: true,message: "请输入工作人员姓名", trigger: "blur" },
                        {max: 32,message: "最多只能录入32个字符",trigger: "blur",},
                    ],
                    workmanNumber: [
                        {required: true,message: "请输入工作人员工号", trigger: "blur" },
                        {max: 20,message: "最多只能录入20个字符",trigger: "blur",},
                    ],
                    photobefor: [
                        {required: true,message: "请输入截图地址", trigger: "blur" },
                        {max: 256,message: "最多只能录入256个字符",trigger: "blur",},
                    ],
                    picture: [
                        {required: true,message: "请输入抓拍评价人照片", trigger: "blur" },
                        {max: 256,message: "最多只能录入256个字符",trigger: "blur",},
                    ],
                    process: [
                        {required: true,message: "请输入音频视频地址", trigger: "blur" },
                        {max: 256,message: "最多只能录入256个字符",trigger: "blur",},
                    ],
                    pjType: [
                        {required: true,message: "请输入评价指向 ", trigger: "blur" },
                        {max: 16,message: "最多只能录入16个字符",trigger: "blur",},
                    ],
                    createTime: [
                        {required: true,message: "请选择创建时间" },
                    ],
                }
            };
        },

        methods: {
            /** 编辑 */
            edit(row) {
                this.reset()
                this.query = { id: row.id };
                this.urls.currUrl ="pj/evaluate/edit";
                this.getData();
                this.pageInfo.type="edit"
                this.title = "修改评价汇总";
            },
            /** 新增 */
            add(row) {
                this.reset()
                this.urls.currUrl = "pj/evaluate/add";
                this.getData();
                this.pageInfo.type="add"
                this.title = "新增评价汇总";
            },
            /** 查看*/
            view(row) {
                this.reset()
                this.query = { id: row.id };
                this.urls.currUrl ="pj/evaluate/view";
                this.getData();
                this.pageInfo.type="view"
                this.title = "评价汇总详细";
            },
            /**取消按钮 */
            cancel() {
                this.open = false;
            },
            /**获取数据后弹框 */
            afterRender(data) {
                this.open = true;
            },

            afterSubmit(data) {
                this.open = false;
                this.$emit("ok");
            },

            // 表单重置
            reset() {
                this.form = {
                    peopleIdcard : "",
                    peopleName : "",
                    peopleSex : "",
                    peoplePhone : "",
                    pjOption : "",
                    contentTag : "",
                    picUrl : "",
                    sectionName : "",
                    hallName : "",
                    pjSource : "",
                    opinion : "",
                    windowName : "",
                    windowFromnum : "",
                    flounum : "",
                    pjxt : "窗口评价",
                    workmanName : "",
                    workmanNumber : "",
                    devicenum : "",
                    evaluatestatus : "等待评价",
                    evaluatetype : "截图",
                    photobefor : "",
                    photoautograph : "",
                    picture : "",
                    process : "",
                    eyevaluate : "未标记",
                    pjType : "窗口评价",
                    pjTime : null,
                    siteId : 0,
                    siteCode : "",
                    siteName : "",
                    extNum : "",
                };
                this.resetForm("form");
            },
            resetForm(refName) {
                if (this.$refs[refName]) {
                    this.$refs[refName].resetFields();
                }
            },
        },
    };
</script>
