123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- {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;
- }
- .message_title {
- padding: 15px 10px;
- border: 1px solid #F0F0F0;
- background: #FCFCFC;
- margin-top: 5px;
- margin-bottom: 10px;
- position: relative;
- min-width: 800px;
- margin: 20px auto 10px;
- width: 880px;
- box-sizing: content-box;
- }
- .message_title a {
- display: block;
- height: 24px;
- line-height: 24px;
- background: url(/static/img/linkBG.gif);
- color: #FFF;
- padding: 0 12px;
- margin-right: 28px;
- cursor: pointer;
- }
- .mainbox {
- width: 900px;
- margin: 0 auto;
- }
- textarea {
- padding: 5px;
- }
- .maintable {
- table-layout: fixed;
- _width: 100%;
- width: 100%;
- border: 1px solid #DFDFDF;
- border-collapse: separate !important;
- background-color: #FFF;
- border-right: 0;
- border-bottom: 2px solid #DFDFDF;
- }
- .maintable th {
- background-color: #F2F3F7;
- border-right: 1px solid #DFDFDF;
- border-bottom: 1px solid #DFDFDF;
- line-height: 25px;
- padding: 5px;
- text-align: center;
- font-family: Arial;
- font-size: 12px;
- letter-spacing: 1px;
- color: #333
- }
- .maintable td {
- border-right: 1px solid #DFDFDF;
- border-bottom: 1px solid #EAEAEC;
- padding: 7px;
- line-height: 25px;
- font-size: 13px;
- position: relative;
- }
- .tablelist th,
- .tablelist td {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- word-wrap: break-word;
- }
- .tbcenter td {
- text-align: center
- }
- .maintable h2 {
- border-bottom: 1px solid #999;
- margin: 0;
- font-weight: bold;
- font-size: 15px;
- margin-bottom: 10px;
- margin-top: 5px;
- text-indent: 3px;
- font-family: Arial;
- letter-spacing: 1px;
- }
- .maintable td label {
- cursor: pointer
- }
- .btnx {
- 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;
- }
- .layui-layer-imgbar{
- display: none !important;
- }
- </style>
- <body class="clearfix">
- <div class="message_title clearfix">
- <div class="left" style="line-height: 24px;">新线索添加成功! 接下来您想? </div>
- <a class="left lastlink" href="javascript:void(0);">继续添加</a><a href="javascript:void(0);"
- class="left goback">返回列表</a>
- </div>
- <div class="mainbox">
- <table class="maintable" border="0" cellspacing="0" cellpadding="0">
- <tbody>
- <tr class="firstaddlog">
- <th align="left">添加首次洽谈内容:</th>
- </tr>
- <tr class="firstaddlog">
- <td>
- 洽谈情况:<textarea name="content" cols="68" rows="6" id="content"></textarea>
- </td>
- </tr>
- <tr class="firstaddlog">
- <td>
- 下次回访:
- <input name="nextuptime" type="text" class="txtbox" id="nextuptime" size="15" readonly="readonly"><span
- title="必填信息" class="red2">*</span>
- <input type="submit" value="提交保存信息" title="保存信息" class="btnx" style="vertical-align:bottom">
- </td>
- </tr>
- </tbody>
- </table>
- </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: '#nextuptime'
- , min: 0
- ,trigger:'click'
- });
- let hobj1 = GetRequest();
- var cid = hobj1.cid;//客户id
- $.ajax({
- url: '{:url("empcrm/model_report")}'
- , data: {
- id:cid
- }
- , type: 'post'
- , success: function (res) {
- if (res.code == 0) {
- let str="";
- for(let i in res.data){
- for(let j in res.data[i].child){
- if(j==0){
- if(res.data[i].child[j].type==6){
- let imgstr='';
- for(let k in res.data[i].child[j].value){
- imgstr +='<img class="nowimgbox" width="25px" height="25px" style="display:inline-block;margin-right:8px;" src="'+ res.data[i].child[j].value[k].oss_url +'" img="'+ res.data[i].child[j].value[k].url +'" alt="">';
- }
- str += `<tr>
- <td>
- <h2>${res.data[i].name}:</h2>
- ${res.data[i].child[j].name}:${imgstr}
- </td>
- </tr>`;
- }else{
- str += `<tr>
- <td>
- <h2>${res.data[i].name}:</h2>
- ${res.data[i].child[j].name}:${res.data[i].child[j].type == 1 || res.data[i].child[j].type == 2 || res.data[i].child[j].type == 5 ? res.data[i].child[j].value : res.data[i].child[j].valname}
- </td>
- </tr>`;
- }
- }else{
- if(res.data[i].child[j].type==1||res.data[i].child[j].type==2||res.data[i].child[j].type==5){
- str+=`<tr>
- <td>${res.data[i].child[j].name}:${res.data[i].child[j].value}</td>
- </tr>`;
- }else if (res.data[i].child[j].type == 6) {
- let imgstr = '';
- for (let k in res.data[i].child[j].value) {
- imgstr += '<img class="nowimgbox" width="25px" height="25px" style="display:inline-block;margin-right:8px;" src="' + res.data[i].child[j].value[k].oss_url + '" img="' + res.data[i].child[j].value[k].url + '" alt="">';
- }
- str += `< tr >
- <td>${res.data[i].child[j].name}:${imgstr}</td>
- </tr >`;
- }else{
- if(res.data[i].child[j].keyname!='name'&&res.data[i].child[j].keyname!='phone'){
- str+=`< tr >
- <td>${res.data[i].child[j].name}:${res.data[i].child[j].valname}</td>
- </tr >`;
- }
- }
- }
-
- }
- str+='</div></div>';
- }
- $('.maintable tbody').append(str);
- for(let i=0;i<$('.nowimgbox').length;i++){
- $($('.nowimgbox')[i]).click(function(){
- layer.photos({
- photos: { "data": [{ "src": 'https://o.nczyzs.com/'+$(this).attr('img'), }] },
- shade: 0.2
- });
- })
- }
- }else if(res.code == 403){
- $(".exitbtn").trigger("click");
- } else {
- alert(res.msg)
- }
- }
- });
- $('.lastlink').click(function () {
- window.history.go(-1);
- })
- $('.goback').click(function () {
- let hobj = GetRequest();
- window.parent.addgotolist(hobj.type,'community');
- })
- // 恭喜,回访信息录入成功,记得下一次要及时回访哟!
- $('.btnx').click(function () {
- if ($('#content').val() == "") { alert("亲,请输入首次与客户洽谈的内容情况!"); $('#content').focus(); return false; }
- if ($('#nextuptime').val() == "") { alert("嗨,打算下一次什么时间回访这个客户呢?"); $('#nextuptime').focus(); return false; }
- let hobj = GetRequest();
- var nowstate = '{$data.state}';
- //console.log(nowstate);
- $.ajax({
- url: '{:url("community/addVisitlog")}'
- , data: {
- customer_id: hobj.cid,// (客户id)
- state: nowstate,//
- next_contact_date: $('#nextuptime').val(),//
- remark: $('#content').val()
- }
- , type: 'post'
- , success: function (res) {
- if (res.code == 0) {
- alert("恭喜,回访信息录入成功,记得下一次要及时回访哟!")
- $('.firstaddlog').hide()
- }else if(res.code == 403){
- $(".exitbtn").trigger("click");
- } else {
- alert(res.msg)
- }
- }
- });
- })
- })
- 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}
|