浏览代码

系统增加优尼雅售后系统功能

xian 4 年之前
父节点
当前提交
04348537c5
共有 1 个文件被更改,包括 498 次插入0 次删除
  1. 498 0
      watero-rst-web/src/main/webapp/WEB-INF/views/yulia/add.ftl

+ 498 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/yulia/add.ftl

@@ -0,0 +1,498 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+    <#include "/base/add_base.ftl">
+    <!-- 新增需求引入js、css -->
+    <link href="${path}/common/lib/bootstrap/bootstrap.min.css" rel="stylesheet" />
+    <title>添加检测记录</title>
+    <style>
+        .input-text{
+            height: 31px;
+        }
+        .form-label {
+            padding-left: 0;
+            margin-left: 0px;
+            width: 17%;
+        }
+        .formControls{
+            padding-top: 3px;
+        }
+    </style>
+</head>
+<body>
+<div class="pd-20">
+    <form class="form form-horizontal" id="form-admin-add">
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-3" style="padding-left: 0;margin-left: 0px;width: 17%;"><h4 style="font-weight: bold;">添加售后信息</h4></label>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>机器条码:</label>
+            <div class="formControls col-9 col-sm-9">
+                <input style="height: 31px;width: 70%" type="text" class="input-text" placeholder="请输入机器条码 或 点击上传条码(系统自动识别)" id="machineNo" name="machineNo">
+                <span style="height: 31px;width: 29%" class="btn" id="upload-barcode-btn">上传条码图片</span>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>产品信息:</label>
+            <div class="formControls col-9 col-sm-9">
+                <select id="productId" name="productId" class="my-select" style="width: 50%;">
+                    <option value="">请输入机器条码</option>
+                </select>
+                <select id="productColorId" name="productColorId" class="my-select" style="width: 49%">
+                    <option value="">请输入机器条码</option>
+                </select>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>店铺信息:</label>
+            <div class="formControls col-9 col-sm-9">
+                <select id="storeId" name="storeId" style="width: 99%;height: 31px">
+                    <#if storeInfos??>
+                        <#list storeInfos as s>
+                            <option value="${(s.storeId)!}">${(s.storeName)!}</option>
+                        </#list>
+                    </#if>
+                </select>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>客户问题:</label>
+            <div class="formControls col-xs-9 col-sm-9 skin-minimal">
+                <select name="complaintId"  id="complaintId" class="chosen3 question_class"></select>
+                <select name="smallClassId" id="smallClassId" class="chosen3 question_class"></select>
+                <select id="questionId" name="questionId" class="chosen question_class">
+                    <option value="">请选择客户问题</option>
+                    <#if (listComplaintQuestionInfo?size > 0)>
+                        <#list listComplaintQuestionInfo as info>
+                            <option value="${info.questionId!}">${info.questionName!}</option>
+                        </#list>
+                    </#if>
+                </select>
+            </div>
+        </div>
+
+        <div class="row cl" >
+            <label class="form-label col-3 col-sm-3">问题详情:</label>
+            <div class="formControls col-xs-9 col-sm-9">
+                <textarea style="width: 98%;" rows="2" cols="20" name="questionDescription" id="questionDescription" class="my-textarea" placeholder="问题详情"></textarea>
+                <p style="font-size: 10px;color: #8a8383;">请仔细填写此内容,此内容可帮助维修人员快速定位问题</p>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>客户信息:</label>
+            <div class="formControls col-9 col-sm-9">
+                <input style="height: 31px;width: 50%" class="input-text" type="text" name="detectName" id="detectName" placeholder="请输入客户姓名或昵称"/>
+                <input style="height: 31px;width: 49%" class="input-text" type="text" name="detectTel" id="detectTel" placeholder="请输入客户电话或手机号码"/>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>处理方式:</label>
+            <div class="formControls col-9 col-sm-9">
+                <select style="width: 50%" class="my-select" id="procTypeId" name="procTypeId"></select>
+                <select style="width: 49%" class="my-select" id="procMethodId" name="methodId"></select>
+            </div>
+        </div>
+
+
+        <div class="row cl" style="display: none">
+            <label class="form-label col-3 col-sm-3">备注信息:</label>
+            <div class="formControls col-xs-9 col-sm-9">
+                <textarea style="width: 98%" rows="3" cols="20" name="detectItemDesc" id="detectItemDesc" class="my-textarea" placeholder="备注信息"></textarea>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <div class="form-label" style="margin-left: 7%;">
+                <button type="button" class="btn btn-primary radius" onclick="add();">确认提交</button>
+            </div>
+        </div>
+    </form>
+</div>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
+<script type="text/plain" id="upload_ue"></script>
+
+<script type="text/javascript">
+    let _editor;
+    $(function() {
+        procType();
+        /* 初始化上传插件 */
+        _editor = UE.getEditor('upload_ue',{
+            initialFrameWidth : 375,
+            initialFrameHeight: 600
+        });
+
+        _editor.ready(function () {
+            _editor.setDisabled("attachment");//设置编辑器不可用
+            _editor.hide();//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
+            //侦听图片上传
+            _editor.addListener('beforeInsertImage', function (t, arg) {
+                $.ajax({
+                    cache: true,
+                    type: "POST",
+                    data: {"image":arg[0].src},
+                    url: "${path}/admin/afterSales/parseMachineNoByImage",
+                    async: false,
+                    success: function(data){
+                        if (data.returnCode === 200) {
+                            setProduct(data);
+                            $("#machineNo").val(data.returnMsg.machineNo);
+                        } else {
+                            layer.msg('产品条码不存在,请重新输入!',{icon: 1,time:1000});
+                        }
+                    },
+                    error: function(XmlHttpRequest, textStatus, errorThrown){
+                    }
+                });
+            });
+        });
+
+        $("#upload-barcode-btn").click(function() {
+            _editor.getDialog("insertimage").open();
+        });
+
+        /* 客诉处理方式回显 state */
+        $("#procTypeId").change(function (){
+            var procTypeId = parseInt($(this).val());
+            procMethod(procTypeId);
+        });
+        /* 监听问题类型 选择事件 */
+        $("[name='complaintId']").change(function(){
+            initComplaintSmallClassInfo($(this).val());
+        });
+        /* 查询产品颜色信息 */
+        $('#productId').change(function(){
+            getProduct($(this).children('option:selected').val())
+        });
+        /* 初始化问题大类*/
+        initComplaintTypeInfo();
+        /* 监听问题类型 选择事件 */
+        $("[name='smallClassId']").change(function(){
+            listQuestion();
+        });
+        // 初始化
+        $('.question_class').chosen({
+            placeholder_text_single: '请选择', //单选选择框的默认提示信息,当选项为空时会显示。如果原下拉框设置了data-placeholder,会覆盖这里的值。
+            width: '33%', //设置chosen下拉框的宽度。即使原下拉框本身设置了宽度,也会被width覆盖。
+        });
+        // 文本框失去焦点时校验
+        $("#machineNo").blur(function() {
+            getProductByMachineNo();
+        });
+        let chosenData = {
+            no_results_text: "没有找到结果!",//搜索无结果时显示的提示
+            search_contains:true,   //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
+            allow_single_deselect:true, //单选下拉框是否允许取消选择。如果允许,选中选项会有一个x号可以删除选项
+            disable_search: false, //禁用搜索。设置为true,则无法搜索选项。
+            disable_search_threshold: 0, //当选项少等于于指定个数时禁用搜索。
+            inherit_select_classes: true, //是否继承原下拉框的样式类,此处设为继承
+            placeholder_text_single: '请选择', //单选选择框的默认提示信息,当选项为空时会显示。如果原下拉框设置了data-placeholder,会覆盖这里的值。
+            width: '100%', //设置chosen下拉框的宽度。即使原下拉框本身设置了宽度,也会被width覆盖。
+            max_shown_results: 1000, //下拉框最大显示选项数量
+            display_disabled_options: false,
+            single_backstroke_delete: false, //false表示按两次删除键才能删除选项,true表示按一次删除键即可删除
+            case_sensitive_search: false, //搜索大小写敏感。此处设为不敏感
+            group_search: false, //选项组是否可搜。此处搜索不可搜
+            include_group_label_in_selected: true //选中选项是否显示选项分组。false不显示,true显示。默认false。
+        };
+        $('.chosen').chosen(chosenData);
+        $('.chosen3').chosen(chosenData);
+        $('.chosen2').chosen({
+            search_contains:false,
+            enable_split_word_search: true //分词搜索,选项词可通过空格或'[]'分隔。search_contains为false时才能看出效果
+        });
+    });
+
+    /** 设置产品 */
+    function setProduct(data) {
+        let product = data.returnMsg.product;
+        let $productId = $("#productId");
+        $productId.empty();
+        $productId.append("<option value='" + product.productId + "'>" + product.productName + "</option>");
+        getProduct(product.productId);
+    }
+
+    /** 根据产品编码查询机产品信息 */
+    function getProductByMachineNo() {
+        let no = $("#machineNo").val();
+        $.ajax({
+            cache: true,
+            type: "POST",
+            data: {"machineNo":no},
+            url: "${path}/admin/afterSales/getProductByMachineNo",
+            async: false,
+            success: function(data){
+                if (data.returnCode === 200) {
+                    setProduct(data);
+                } else {
+                    layer.msg('产品条码不存在,请重新输入!',{icon: 1,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+    function procType(){
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/proc/type",
+            async: false,
+            success: function(data){
+                if (data.returnCode === 200) {
+                    let html = '';
+                    if (data.returnCode === 200) {
+                        for(var i=0;i<data.returnMsg.list.length;i++){
+                            listInfo = data.returnMsg.list[i];
+                            if(listInfo.procTypeId === 2 || listInfo.procTypeId === 3 || listInfo.procTypeId === 4 ){
+                                html += '<option value="'+ listInfo.procTypeId +'">'+ listInfo.procTypeName +'</option>';
+                            }
+                        }
+                    }else{
+                        html = '';
+                    }
+                    let $procTypeId = $("#procTypeId");
+                    $procTypeId.html(html);
+                    // 默认选中 维修
+                    $procTypeId.val("3");
+                    procMethod($procTypeId.val());
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+    function procMethod(procTypeId){
+        $.ajax({
+            cache: true,
+            type: "POST",
+            data: {"procTypeId":procTypeId},
+            url: "${path}/admin/proc/method",
+            async: false,
+            success: function(data){
+                if (data.returnCode === 200) {
+                    var html = '';
+                    if (data.returnCode === 200) {
+                        for(var i=0;i<data.returnMsg.list.length;i++){
+                            listInfo = data.returnMsg.list[i];
+                            html += '<option value="'+ listInfo.procMethodId +'">'+ listInfo.procMethodName +'</option>';
+                        }
+                    }else{
+                        html = '';
+                    }
+                    $("#procMethodId").html(html);
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        })
+    }
+    function getProduct(productId) {
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/product/get_product",
+            data:{colorProductId:productId},
+            async: false,
+            success: function(data){
+                if (data.returnCode === 200) {
+                    let $productColorId = $("#productColorId");
+                    $productColorId.empty();
+                    if(data.returnMsg.productColorList.length > 0){
+                        for(let i=0;i<data.returnMsg.productColorList.length;i++){
+                            let productColor = data.returnMsg.productColorList[i];
+                            $productColorId.append('<option value='+productColor.colorId+'>'+productColor.colorName+'</option>');
+                        }
+                    }
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('添加错误',{icon: 5,time:1000});
+            }
+        });
+    }
+    /** 添加事件 */
+    function  add() {
+        let questionId = $("#questionId").val();
+        if( questionId == null || questionId === "" ){
+            layer.msg('请选择客户问题',{icon: 5,time:1000});
+            return;
+        }
+        let machineNo = $("#machineNo").val();
+        if (machineNo == null || machineNo === "") {
+            layer.msg('请填写或上传产品条码',{icon: 5,time:1000});
+            return;
+        }
+        let productId = $("#productId").val();
+        if (productId == null || productId === "") {
+            layer.msg('产品信息不能为空',{icon: 5,time:1000});
+            return;
+        }
+        let productColorId = $("#productColorId").val();
+        if (productColorId == null || productColorId === "") {
+            layer.msg('产品信息不能为空',{icon: 5,time:1000});
+            return;
+        }
+        let storeId = $("#storeId").val();
+        if (storeId == null || storeId === "") {
+            layer.msg('店铺不能为空',{icon: 5,time:1000});
+            return;
+        }
+        let detectName = $("#detectName").val();
+        if (detectName == null || detectName === "") {
+            layer.msg('联系人不能为空',{icon: 5,time:1000});
+            return;
+        }
+        let detectTel = $("#detectTel").val();
+        if (detectTel == null || detectTel === "") {
+            layer.msg('联系人电话或手机号码 不能为空',{icon: 5,time:1000});
+            return;
+        }
+        let procTypeId = $("#procTypeId").val();
+        if (procTypeId == null || procTypeId === "") {
+            layer.msg('处理方式不能为空',{icon: 5,time:1000});
+            return;
+        }
+        let procMethodId = $("#procTypeId").val();
+        if (procMethodId == null || procMethodId === "") {
+            layer.msg('处理方式不能为空',{icon: 5,time:1000});
+            return;
+        }
+
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/afterSales/add_detect",
+            data:$('#form-admin-add').serialize(),
+            async: false,
+            success: function(data){
+                if (data.returnCode === 200) {
+                    layer.msg('添加成功',{icon: 1,time:1000},function () {
+                        location.replace(location.href);
+                        window.location.href= "${path}/admin/afterSales/listAfterSales";
+                    });
+                } else {
+                    layer.msg('添加失败',{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('添加错误',{icon: 5,time:1000});
+            }
+        });
+    }
+    function initComplaintTypeInfo() {
+        let customerCounselTypeOverall = null;
+        let complaintType = null;
+        $.ajax({
+            type: "POST",
+            data: {
+                complaintConsultingType : customerCounselTypeOverall,
+                complaintType : complaintType,
+                complaintIsShow : 2
+            },
+            url: "${path}/admin/complaintQuestion/list_complaintType",
+            async: true,
+            success: function(data){
+                var html = '';
+                var id;
+                if (data.returnCode === 200) {
+                    for(var i=0;i<data.returnMsg.complaintTypeInfoList.length;i++){
+                        var complaintTypeInfo = data.returnMsg.complaintTypeInfoList[i];
+                        if(i === 0 ){
+                            id = complaintTypeInfo.complaintId;
+                        }
+                        html += '<option value="'+ complaintTypeInfo.complaintId +'">'+ complaintTypeInfo.complaintClassName +'</option>';
+                    }
+                }else{
+                    html = '';
+                }
+                $("[name='complaintId']").html(html);
+                $("#complaintId").trigger("chosen:updated");
+                initComplaintSmallClassInfo(id);
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+    /*显示小类*/
+    function initComplaintSmallClassInfo(complaintId,smallId){
+        if(complaintId == null || complaintId === ""){
+            $("[name='smallClassId']").html('');
+            return;
+        }
+        // 查询数据
+        $.ajax({
+            type: "POST",
+            data: {
+                complaintId : complaintId,
+                smallClassIsShow : 2
+            },
+            url: "${path}/admin/complaintQuestion/list_complaintSmallClass",
+            async: true,
+            success: function(data){
+                let html = '';
+                if (data.returnCode === 200) {
+                    for(var i=0;i<data.returnMsg.complaintSmallClassInfoList.length;i++){
+                        var ComplaintSmallClassInfo = data.returnMsg.complaintSmallClassInfoList[i];
+                        html += '<option value="'+ ComplaintSmallClassInfo.smallClassId +'">'+ ComplaintSmallClassInfo.smallClassName +'</option>';
+                    }
+                }else{
+                    html = '';
+                }
+                $("[name='smallClassId']").html(html);
+                $("#smallClassId").trigger("chosen:updated");//初始化
+                if(smallId != null && smallId !== "" && typeof(smallId)!=="undefined" ){
+                    $("select[name='smallClassId']").val(smallId);
+                }
+                listQuestion();
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+    function listQuestion(){
+        let smallClassId = $("#smallClassId").val();
+        $.ajax({
+            type: "POST",
+            data: {
+                smallClassId : smallClassId,
+                questionIsShow : 2
+            },
+            url: "${path}/admin/complaintQuestion/list_question_all",
+            async: false,
+            success: function(data){
+                let html = "";
+                if (data.returnCode === 200) {
+                    for(var i=0;i<data.returnMsg.complaintQuestionInfoList.length;i++){
+                        var complaintQuestion= data.returnMsg.complaintQuestionInfoList[i];
+                        html += '<option value="'+ complaintQuestion.questionId +'">'+ complaintQuestion.questionName +'</option>';
+                    }
+                }else{
+                    html = '';
+                }
+                let questionId = $("#questionId");
+                questionId.html(html);
+                //初始化
+                questionId.trigger("chosen:updated");
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+</script>
+</body>
+</html>