{
    template: '${tmpl}',
        data: function() {

            var name = (rule, value, callback) => {
                console.log(rule, value, callback);
                if (value == '') {
                    callback(new Error('请输入姓名'));
                } else {
                    callback();
                }
            };
            var phoneNum = (rule, value, callback) => {
                var x = /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/g.test(value);
                if (!x) {
                    callback(new Error('联系电话格式错误！'));
                } else {
                    callback();
                }
            };
            return {
                tableData: [

                ],
                labelPosition: 'right',
                apply: {
                    orderType: "zzdd",
                    contacts: '',
                    mobile: '',
                    email: '',
                    notes: ''
                },
                applyRules: {
                    contacts: [
                        { required: true, message: '请输入姓名', trigger: 'blur', validator: name },
                    ],
                    mobile: [
                        { required: true, message: '请输入正确电话号码', trigger: 'change', validator: phoneNum }
                    ],
                },
                checkImg: false,
                num: null,
                params: {
                    itemCode: "",
                    order_appendinfo: {
                        level: "",
                        area_list: [],
                        department_list: [],
                        type_list: []
                    },
                    apply: {
                        orderType: "zzdd",
                        contacts: "",
                        mobile: "",
                        email: "",
                        notes: ""
                    },
                    tm: {
                        totalSum: null,
                    },
                },
                serviceName: "",

            }
        },
    mounted: function() {
        console.log(Number(this.$route.query.sdsId), `llllllkkkkkkkkkkkkkkkkkkkkkk`);
        this.num = Number(this.$route.query.num);
        this.getProduct();
        console.log(this.$route.query);
        /** 
         * 
        $("#app-header").hide();
         * 
        */
    },
    created: function() {

    },
    methods: {
        goOrder(){
            this.params.tm.totalSum = this.tableData[0].countPrice;
            this.params.tm.salesNum = Number(this.$route.query.num);
            this.apply.orderType = "zzdd";
            this.params.apply = this.apply;
            this.params.itemCode = this.tableData[0].code;
            this.$root.postReq("/web/orderCtl/createOtherOrder", this.params).then((d) => {
                console.log("---------submitOrder-------");
                if (this.$store.state.currentUser == null) {
                    this.$message.warning("未登录");
                    return
                }
                if (d.code == 1) {
                    this.$root.pushx({
                        title: "订单支付",
                        name: "/orderpay",
                        params: { orderNum: d.data.code }
                    });
                } else {
                    this.$message.warning(d.msg);
                }
            }).catch((e) => {
                console.log(e);
            })
        },
        getProduct(){
            var data = { ...this.$route.query };
            this.tableData.push(data);
            console.log(data,'!!!!!!!!!!!!!!!1');
            
        },
        tiaozhuan(code) {
            switch (code) {
                case 1:
                    this.$router.push({
                        path: `/${this.$root.channelName}/jdtrademark?`
                    });
                    break;
                case 2:
                    this.$router.push({
                        path: `/${this.$root.channelName}/servicedetails`
                    });
                    break;
                default:
                    break;
            }

        },
    },
    computed: {

    },
    vname: "gsb-nowbuy"
}
