123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- {extend name="public/layout"}
- {block name="body"}
- <link rel="stylesheet" href="__LAYUI__/layui/css/layui.css" media="all">
- <link rel="stylesheet" " href=" /static/css/common.css">
- <script src="/static/js/jquery.min.js"></script>
- <style>
- body {
- padding-bottom: 40px;
- background-color: #F3F3F3;
- }
- .mainbox {
- display: block;
- width: 900px;
- padding-top: 20px;
- margin: 0 auto;
- }
- .titbox {
- padding: 15px 10px;
- border: 1px solid #F0F0F0;
- background: #FCFCFC;
- margin-bottom: 10px;
- position: relative;
- line-height: 28px;
- }
- .goback {
- display: block;
- cursor: pointer;
- color: #000;
- background: url(__STATIC__/img/btn_bg.gif) repeat-x;
- border: 1px solid #C0C0C0;
- padding: 0 12px;
- *padding: 0 6px;
- height: 28px;
- width: 84px;
- }
- .crmsgbox {
- display: block;
- width: 100%;
- _width: 100%;
- width: 100%;
- border: 1px solid #DFDFDF;
- background-color: #FFF;
- border-bottom: 2px solid #DFDFDF;
- padding: 0 10px;
- }
- .everytit {
- border-bottom: 1px solid #999;
- font-weight: bold;
- font-size: 15px;
- margin-bottom: 10px;
- margin-top: 5px;
- text-indent: 3px;
- font-family: Arial;
- letter-spacing: 1px;
- }
- .everydiv {
- display: block;
- border-bottom: 1px solid #EAEAEC;
- padding: 7px;
- line-height: 25px;
- font-size: 13px;
- position: relative;
- box-sizing: content-box;
- }
- .w70 {
- width: 70px;
- }
- .addbtn {
- display: block;
- margin: 0 auto;
- border: none;
- width: 98px;
- height: 30px;
- color: #fff;
- font-size: 14px;
- font-weight: bold;
- text-align: center;
- background: url(__STATIC__/img/icon-sub.png) no-repeat;
- cursor: pointer;
- margin-left: 32px;
- }
- .btn {
- cursor: pointer;
- color: #000;
- background: url(__STATIC__/img/btn_bg.gif) repeat-x;
- border: 1px solid #C0C0C0;
- padding: 0 12px;
- *padding: 0 6px;
- width: 80px;
- height: 28px;
- }
- </style>
- <body class="clearfix">
- <div class="mainbox">
- <div class="titbox clearfix">
- <div class="left">你正在编辑"<span style="color:#336699;">{$data.name}</span>"......</div>
- <div class="right">
- <div class="left">点击这里返回:</div>
- <button class="left goback" type="button">返回</button>
- </div>
- </div>
- <div class="crmsgbox">
- <div class="everytit">客户信息:</div>
- <div class="clearfix everydiv">
- <div class="left w70"><span >客户姓名</span>:</div>
- <input name="name" type="text" class="txtbox left" id="name" size="20" value="{$data.name}" maxlength="10">
- <div class="left w70 ml20"><span >小区名称</span>:</div>
- <input name="community_name" type="text" class="txtbox left" id="community_name" size="26" maxlength="30" value="{$data.community_name}">
- </div>
- <div class="clearfix everydiv">
- <div class="left"><span >面积</span>:</div>
- <input name="square" type="text" class="txtbox left" id="square"
- onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" size="8" maxlength="5" value="{$data.square}">
- <span class="left">平方</span>
- <div class="left w70 ml20">房子户型:</div>
- <select class="left" name="housetype_arrow" id="housetype_arrow" style="height:26px;">
- <option value="">------------</option>
- {volist name="fields" id="vo"}
- {if $vo.keyname == 'housetype_arrow'}
- {volist name="vo.select" id="v" key="k"}
- <option value="{$v.id}" {if $data.housetype eq $v.name} selected {/if}>{$v.name}</option>
- {/volist}
- {/if}
- {/volist}
- </select>
- </div>
- <div class="clearfix everydiv">
- <div class="left w70"><span >意向风格</span>:</div>
- <!-- <div class="left ">
- <input name="deco_style" type="radio" value="1" id="fid1" title="新中式" >
- <label for="fid1" title="新中式">新中式</label>
- </div>
- <div class="left ml10 ">
- <input name="deco_style" type="radio" value="2" id="fid2" title="现代简约" >
- <label for="fid2" title="现代简约">现代简约</label>
- </div> -->
- {volist name="decostyle_list" id="vo" key="k"}
- <div class="left {if $k neq 1} ml10 {/if}">
- <input name="deco_style" type="radio" value="{$vo.id}" id="fid{$k}" title="{$vo.name}" {if $data.deco_style eq $vo.id} checked="checked" {/if}>
- <label for="fid{$k}" title="{$vo.name}">{$vo.name}</label>
- </div>
- {/volist}
- </div>
- <div class="everytit">交定信息:</div>
- <div class="clearfix everydiv">
- <div class="left">交定日期:</div>
- <input class="left txtbox" name="qduptime" type="text" id="qduptime" size="15" value="{:empty($data.deposit.confirm_date) ? '' : $data.deposit.confirm_date}" readonly="readonly">
- <div class="left ml20">合同日期:</div>
- <input class="left txtbox" name="sign_time" type="text" id="sign_time" size="15" value="{:empty($data.sign.confirm_date) ? '' : $data.sign.confirm_date}" readonly="readonly">
- </div>
- <div class="clearfix everydiv">
- <div class="left">基本合同金额:</div>
- <input class="left txtbox" name="sign_money" type="text" value="{$data.sign.money}" onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" maxlength="10" autocomplete="off" size="12" >
- <span class="left">元</span>
- <input type="hidden" name="vlogid" id="vlogid" value="{$data.sign.id}" />
- </div>
- <div class="clearfix everydiv">
- <div class="left w70"><span >装修套餐</span>:</div>
- <!-- <div class="left ">
- <input name="package_id" type="radio" value="1" id="pid1" title="全案设计">
- <label for="pid1" title="全案设计">全案设计</label>
- </div>
- <div class="left ml10 ">
- <input name="package_id" type="radio" value="2" id="pid2" title="品质整装">
- <label for="pid2" title="品质整装">品质整装</label>
- </div> -->
- {volist name="product" id="vo" key="k"}
- <div class="left {if $k neq 1} ml10 {/if}">
- <input name="package_id" type="radio" value="{$vo.id}" id="pid{$k}" title="{$vo.name}" {if $data.package_id eq $vo.id} checked="checked" {/if}>
- <label for="pid{$k}" title="{$vo.name}">{$vo.name}</label>
- </div>
- {/volist}
- </div>
- <div class="everytit" style="margin-top: 14px;">必填信息:</div>
- <div class="clearfix everydiv">
- <div class="left w70"><span style="color:#FF0000;">家装顾问</span>:</div>
- <select class="left" name="yid" id="yid" style="height:26px;" disabled="disabled">
- <option value="">------------</option>
- {volist name="employee_list" id="vo"}
- <option value="{$vo.id}" {if $data.employee_id eq $vo.id} selected {/if}>{$vo.name}</option>
- {/volist}
- <!-- <option value=" " > </option> -->
- </select>
- <div class="left w70"><span style="color:#FF0000;">设计师</span>:</div>
- <select class="left" name="designer_id" id="designer_id" style="height:26px;" disabled="disabled">
- <option value="">------------</option>
- {volist name="designers.arr" id="vo"}
- <option value="{$vo.id}" {if $data.designer_id eq $vo.id} selected {/if}>{$vo.name}</option>
- {/volist}
- <!-- <option value=" "> </option> -->
- </select>
- </div>
- </div>
- <div class="clearfix" style="margin:15px auto;">
- <button class="left btn" type="button">返回</button>
- <button class="addbtn left" type="button">提交</button>
- </div>
- </div>
- </body>
- <script src="__LAYUI__/layui/layui.js"></script>
- {/block}{block name="js"}
- <script type="text/javascript">
- layui.config({
- base: '__LAYUI__/',
- urlbase: '/sys'
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['table', 'laydate'], function () {
- var table = layui.table, laydate = layui.laydate,
- $ = layui.$;
-
- // laydate.render({
- // elem: '#sign_time'
- // ,max:0
- // });
- let hobj = GetRequest();
- var cid = hobj.id;//客户id
-
- $('.addbtn').click(function(){
- if ($('#name').val() == "") { alert("提示:客户姓名是必须要填写!"); $('#name').focus(); return false; }
- if ($('input[name="community_name"]').val() == "") { alert("提示:客户的小区名称是必须要填写!"); $('input[name="xiaoqu"]').focus(); return false; }
- if ($('input[name="square"]').val() == "") { alert("提示:客户的房子面积忘记输入啦!"); $('input[name="mianji"]').focus(); return false; }
- //if ($('input:radio[name="package_id"]:checked').val() == null) { alert("提示:请选择客户的意向装修产品!"); return false; }
- //if ($('input:radio[name="deco_style"]:checked').val() == null) { alert("提示:请选择客户意向的装修风格!"); return false; }
- // if ($('#yid').val() == "") { alert("提示:客服专员忘记填写了!"); $('#yid').focus(); return false; }
- if ($('input[name="sign_money"]').val() == "") { alert("提示:顾客合同共计多少钱!"); $('input[name="sign_money"]').focus(); return false; }
- if ($('input[name="zhucai"]').val() == "") { alert("提示:主材金额是多少!"); $('input[name="zhucai"]').focus(); return false; }
- //if ($('#designer_id').val() == "") { alert("提示:给顾客挑选一个设计师吧!"); $('#sid').focus(); return false; }
-
- $.ajax({
- url: '{:url("community/sign_savecust")}'
- , data: {
- id: cid,// (客户id)
- designer_id: $('#designer_id').val(),//设计师id)
- name: $('#name').val(),//(客户名称)
- community_name: $('input[name="community_name"]').val(),//(小区名称)
- square: $('input[name="square"]').val(),//(建筑面积)
- housetype_arrow:$('#housetype_arrow').val(),//(屋子户型)
- package_id: $('input:radio[name="package_id"]:checked').val(),// (意向产品)
- deco_style: $('input:radio[name="deco_style"]:checked').val(),// (意向风格)
- }
- , type: 'post'
- , success: function (res) {
- if(res.code == 403){
- $(".exitbtn").trigger("click");
- } else {
- alert(res.msg)
- }
- }
- });
- $.ajax({
- url: '{:url("community/addVisitlog")}'
- , data: {
- customer_id: hobj.id,// (客户id)
- designer_id: $("#designer_id").val(),
- state: '签单',
- money: $('[name=sign_money]').val(),
- //confirm_date: $('#sign_time').val(),//
- other_money: $("[name=zhucai]").val(),
- deco_style: $('input:radio[name="decostyle"]:checked').val(),
- package_id: $('input:radio[name="package_id"]:checked').val(),
- vlogid: $('#vlogid').val()
- }
- , type: 'post'
- , success: function (res) {
- if (res.code == 0) {
- var msg = '记录修改成功!要继续修改吗?\n\n点"确认"继续修改\n\n点"取消"返回操作';
- if (confirm(msg) == true) {
- return true;
- } else {
- let iframe = parent.layui.$('iframe');
- for (let i = 0; i < iframe.length; i++) {
- let str = iframe[i].src;
- let appoint = "/empcrm/community/achment_list.html";
- var start = str.length - appoint.length; //相差长度=字符串长度-特定字符长度
- var char = str.substr(start, appoint.length);//将相差长度作为开始下标,特定字符长度为截取长度
- if (char == appoint) {
- parent.layui.$('iframe')[i].contentDocument.defaultView.reload()
- }
- }
- let hobj = GetRequest();
- window.parent.gosignlist(hobj.id, hobj.type ? hobj.type : '','community');
- }
- }else if(res.code == 403){
- $(".exitbtn").trigger("click");
- } else {
- alert(res.msg)
- }
- }
- });
- })
- })
- function isPhoneNumber(tel) { var reg = /^0?1[3|4|5|6|7|8|9][0-9]\d{8}$/; return reg.test(tel); }
- $('.btn').click(function () {
- let hobj = GetRequest();
- window.parent.gosignlist(hobj.id, hobj.type ? hobj.type : '','community');
- })
- $('.goback').click(function () {
- let hobj = GetRequest();
- window.parent.gosignlist(hobj.id, hobj.type ? hobj.type : '','community');
- })
- function GetRequest() {
- var url = location.search; //获取url中"?"符后的字串
- var theRequest = new Object();
- if (url.indexOf("?") != -1) {
- var str = url.substr(1);
- strs = str.split("&");
- for (var i = 0; i < strs.length; i++) {
- theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
- }
- }
- return theRequest;
- }
- </script>
- {/block}
|