971 lines
52 KiB
HTML
971 lines
52 KiB
HTML
{layout name="layout2" /}
|
||
<link rel="stylesheet" href="/static/admin/css/goods.css" media="all">
|
||
<div class="">
|
||
<div class="layui-tab-content layui-form">
|
||
<div class="">
|
||
<div class="" >
|
||
|
||
|
||
<div style=" margin-right: 20px;">
|
||
|
||
<div style="display: flex; justify-content: space-between;">
|
||
<div>
|
||
<label class="layui-form-label">员工姓名:</label>
|
||
<div class="layui-input-block">
|
||
<input name="goodss_id" type="hidden">
|
||
<input type="text" name="name" lay-verify="custom_required" lay-verType="tips" style="width: 200px;"
|
||
autocomplete="off"
|
||
switch-tab="0"
|
||
class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">电话号码:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="mobile" lay-verType="tips" style="width: 200px;"autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">员工工号:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="jon" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">员工学历:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="education" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between;">
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">身份证号:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="identity" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">紧急联系人:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="urgent_name" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">联系号码:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="urgent_phone" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">员工性别:</label>
|
||
<div class="layui-input-block" style="width:200px">
|
||
<select name="sex" lay-verType="tips" switch-tab="0" style="width:140px">
|
||
<option value="1" {if $infos.sex == 1}selected{/if}>男 </option>
|
||
<option value="2" {if $infos.sex == 2}selected{/if}>女 </option>
|
||
<option value="3" {if $infos.sex == 3}selected{/if}>未知</option>
|
||
</select>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div style="display: flex; justify-content: space-between;">
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">健康证:</label>
|
||
<div class="layui-input-block" style="width:200px">
|
||
<input class="layui-input" value="{$infos.birthday}" autocomplete="off" name="birthday" id="birthday" type="text" placeholder="请输入健康证有效期" >
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">婚姻状况:</label>
|
||
<div class="layui-input-block" style="width:200px">
|
||
<select name="marry" lay-verType="tips" switch-tab="0" style="width:140px">
|
||
<option value="1" {if $infos.marry == 1}selected{/if}>是</option>
|
||
<option value="2" {if $infos.marry == 2}selected{/if}>否 </option>
|
||
<option value="3" {if $infos.marry == 3}selected{/if}>未知</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">籍贯:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="native" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">隶属部门:</label>
|
||
<div class="layui-input-block" style="width:200px">
|
||
<select name="brand_id" lay-verType="tips" switch-tab="0" verify-msg="请选择隶属部门">
|
||
<option value="">请选择员工的部门</option>
|
||
</select>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div style="display: flex; justify-content: space-between;">
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">工资底薪:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="mooney" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">员工积分:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="score" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">服务等级:</label>
|
||
<div class="layui-input-block" style="width:200px">
|
||
<select name="star" lay-verType="tips" switch-tab="0">
|
||
<option value="0" {if $infos.star == 0}selected{/if}>一星级</option>
|
||
<option value="1" {if $infos.star == 1}selected{/if}>二星级</option>
|
||
<option value="1" {if $infos.star == 2}selected{/if}>三星级</option>
|
||
<option value="1" {if $infos.star == 3}selected{/if}>四星级</option>
|
||
<option value="1" {if $infos.star == 4}selected{/if}>五星级</option>
|
||
</select>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">乙肝两对半:</label>
|
||
<div class="layui-input-block" style="width:200px">
|
||
<select name="physical" lay-verType="tips" switch-tab="0">
|
||
<option value="0" {if $infos.physical == 0}selected{/if}>是</option>
|
||
<option value="1" {if $infos.physical == 1}selected{/if}>否</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
<div style="display: flex; justify-content: space-between;">
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">工资银行卡:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="bank" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">银行卡号:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="account" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">社保银行:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="sbyhk" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">社保账号:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="social" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
<div style="display: flex; justify-content: space-between;">
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">员工苗族:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="nation" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">属相:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="sign" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">出行工具:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="transit" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">服务类别:</label>
|
||
<div class="layui-input-block" style="width:200px">
|
||
<select id="goods_id" name="goods_id" >
|
||
<option value="">请选择员工的部门</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div style="display: flex; justify-content: space-between;">
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">是否在职:</label>
|
||
<div class="layui-input-block" style="width:200px">
|
||
<select name="onwork" lay-verType="tips" switch-tab="0">
|
||
<option value="0" {if $infos.onwork == 0}selected{/if}>离职</option>
|
||
<option value="1" {if $infos.onwork == 1}selected{/if}>在职</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">是否过敏:</label>
|
||
<div class="layui-input-block" style="width:200px">
|
||
<select name="allergy" lay-verType="tips" switch-tab="0">
|
||
<option value="0" {if $infos.allergy == 1}selected{/if}>是</option>
|
||
<option value="1" {if $infos.allergy == 0}selected{/if}>否</option>
|
||
<option value="1" {if $infos.allergy == 2}selected{/if}>未知</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">缴纳社保:</label>
|
||
<div class="layui-input-block" style="width:200px">
|
||
<select name="security" lay-verType="tips" switch-tab="0">
|
||
<option value="1" {if $infos.security == 1}selected{/if}>是</option>
|
||
<option value="0" {if $infos.security == 0}selected{/if}>否</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">购买五险:</label>
|
||
<div class="layui-input-block" style="width:200px">
|
||
<select name="insurances" lay-verType="tips" switch-tab="0">
|
||
<option value="1" {if $infos.insurances == 1}selected{/if}>是</option>
|
||
<option value="0" {if $infos.insurances == 0}selected{/if}>否</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div style="display: flex; justify-content: space-between;">
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">员工住址:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="addr" lay-verType="tips" style="width: 200px;" id="addr" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">服务范围:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="lnglat" lay-verType="tips" value="" id="lnglat" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">定位精度:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="store_longitude" lay-verType="tips" value="" id="lon" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">定位维度:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="store_latitude" lay-verType="tips" style="width: 200px;" value="" id="lat" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">雷达距离:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="distance" lay-verType="tips" style="width: 50px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div style="display: flex; justify-content: space-between;">
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">登入密码:</label>
|
||
<div class="layui-input-block">
|
||
<input type="password" name="password" value="123456" lay-verType="tips" style="width: 200px;" id="addr" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">员工类型:</label>
|
||
<div class="layui-input-block" style="width:200px">
|
||
<select name="type" lay-verType="tips" switch-tab="0">
|
||
<option value="0" {if $infos.type == 0}selected{/if}>服务人员</option>
|
||
<option value="1" {if $infos.type == 1}selected{/if}>办公室人员</option>1
|
||
<option value="2" {if $infos.type == 2}selected{/if}>管理人员</option>
|
||
<option value="3" {if $infos.type == 3}selected{/if}>站长</option>
|
||
</select>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">推荐人ID:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="uid" lay-verType="tips" style="width: 200px;" autocomplete="off" switch-tab="0" class="layui-input">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">员工分组:</label>
|
||
<div class="layui-input-block" style="width:200px">
|
||
<select name="grouping_id" lay-verType="tips" switch-tab="0" verify-msg="选择员工分组">
|
||
<option value="" >请选择员工的分组</option>
|
||
|
||
</select>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<div id="tMap" class="layui-hide" style="padding: 10px;margin-left: 3%; width: 100%;position:relative">
|
||
<div class="layui-form layuimini-form">
|
||
<div class="layui-form-item">
|
||
<div class="layui-input-inline">
|
||
<input type="text" name="search_key" id="search_key" class="layui-input" placeholder="请输入地名" >
|
||
</div>
|
||
<button class="layui-btn layui-btn-normal layui-btn-sm searchKey">查询</button>
|
||
</div>
|
||
</div>
|
||
<style type="text/css" media="all">
|
||
#container {
|
||
width: 100%;
|
||
height: 80%;
|
||
}
|
||
|
||
#toolControl {
|
||
position: absolute;
|
||
top: 10px;
|
||
left: 0px;
|
||
right: 0px;
|
||
margin: auto;
|
||
width: 500px;
|
||
z-index: 1001;
|
||
}
|
||
|
||
.toolItem {
|
||
width: 30px;
|
||
height: 30px;
|
||
float: left;
|
||
margin: 1px;
|
||
padding: 4px;
|
||
border-radius: 3px;
|
||
background-size: 30px 30px;
|
||
background-position: 4px 4px;
|
||
background-repeat: no-repeat;
|
||
box-shadow: 0 1px 2px 0 #e4e7ef;
|
||
background-color: #ffffff;
|
||
border: 1px solid #ffffff;
|
||
}
|
||
|
||
.toolItem:hover {
|
||
border-color: #789cff;
|
||
}
|
||
|
||
.active {
|
||
border-color: #d5dff2;
|
||
background-color: #d5dff2;
|
||
}
|
||
.help{
|
||
position: absolute;
|
||
top: 10px;
|
||
left: 85px;
|
||
right: 0px;
|
||
margin: auto;
|
||
width: 500px;
|
||
z-index: 1002;
|
||
display: flex;
|
||
}
|
||
.h-i{
|
||
width: 40px;
|
||
height: 40px;
|
||
margin: 1px;
|
||
font-size: 12px;
|
||
border-radius: 3px;
|
||
background-color: #D6E0F1;
|
||
display: flex;
|
||
color: #005af7;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-weight: bold;
|
||
}
|
||
#polygon {
|
||
background-image: url('https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/polygon.png');
|
||
}
|
||
</style>
|
||
<div id="maplocation" style="width:1080px;height:600px;"></div>
|
||
<div class="help">
|
||
<div class="h-i" onclick="onclear()">删除</br>绘制</div>
|
||
<div class="h-i" onclick="onhelp()">使用</br>帮助</div>
|
||
</div>
|
||
<div id="toolControl">
|
||
<div class="toolItem active" id="polygon" title="多边形"></div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">注册地区:</label>
|
||
<div class="layui-input-inline">
|
||
<select name="first_category_id" lay-filter="first_category" lay-verify="custom_required"
|
||
lay-verType="tips" switch-tab="0" verify-msg="请选择地区">
|
||
<option value="">请选择地区</option>
|
||
</select>
|
||
</div>
|
||
<div class="layui-input-inline">
|
||
<select name="second_category_id" lay-filter="second_category" lay-verify="custom_required"
|
||
lay-verType="tips" switch-tab="0" verify-msg="请选择地区">
|
||
<option value="">请选择地区</option>
|
||
</select>
|
||
</div>
|
||
<div class="layui-input-inline">
|
||
<select name="third_category_id" lay-filter="third_category" lay-verify="custom_required"
|
||
lay-verType="tips" switch-tab="0" verify-msg="请选择地区">
|
||
<option value="">请选择地区</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">保洁技能:</label>
|
||
<div class="layui-input-block">
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">特长描写:</label>
|
||
<div class="layui-input-block">
|
||
<textarea type="text" name="remark" autocomplete="off" class="layui-textarea">{$infos.remark}</textarea>
|
||
</div>
|
||
</div>
|
||
|
||
<style>
|
||
body .layui-ext-yourskin .layui-layer-btn0{
|
||
border: 1px solid #dedede;
|
||
background-color:#fff;
|
||
color: #333;
|
||
}
|
||
body .layui-ext-yourskin .layui-layer-btn1{
|
||
background-color:#1E9FFF;
|
||
border-color:#1E9FFF;
|
||
color: #fff;
|
||
}
|
||
</style>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item layui-hide">
|
||
<input type="button" lay-submit lay-filter="edit-submit" id="edit-submit" value="确认">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&libraries=service,tools&key=EVOBZ-VX7YU-QKJVR-BVESA-AVFT3-7JBWG"></script>
|
||
<link rel="stylesheet" href="/static/plug/formSelects/formSelects-v4.css" />
|
||
<script src="/static/plug/formSelects/formSelects-v4.js" type="text/javascript" charset="utf-8"></script>
|
||
<script type="text/javascript">
|
||
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
|
||
var dragstart = 0;
|
||
var swop_element_ed = -1;
|
||
var create_table_by_spec = null;
|
||
var spec_table_data = [];
|
||
var spec_value_temp_id_number = 0;
|
||
var geocoder = null
|
||
|
||
var result = []
|
||
var map; // 地图
|
||
var editor; // 编辑器
|
||
var activeType = 'polygon'; // 激活的图形编辑类型
|
||
var lnglat_data = null
|
||
|
||
|
||
function onhelp(){
|
||
alert('点击左侧图形在地图上单击移动即可绘制图形(双击结束绘制、多边形会自动闭合),按esc键退出绘制。删除绘制(单击选中图形,点击删除绘制即可)')
|
||
}
|
||
function onclear(){
|
||
console.log('oncl',editor);
|
||
editor.delete()
|
||
result = []
|
||
}
|
||
|
||
// 切换激活图层
|
||
document.getElementById('toolControl').addEventListener('click', (e) => {
|
||
var id = e.target.id;
|
||
if (id !== 'toolControl') {
|
||
document.getElementById(activeType).className = 'toolItem';
|
||
document.getElementById(id).className = 'toolItem active';
|
||
activeType = id;
|
||
editor.setActionMode(TMap.tools.constants.EDITOR_ACTION.DRAW)
|
||
editor.setActiveOverlay(id);
|
||
}
|
||
});
|
||
|
||
|
||
layui.config({
|
||
version:"{$front_version}",
|
||
base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
|
||
}).extend({
|
||
index: 'lib/index' //主入口模块
|
||
}).use(['index', 'element', 'jquery', 'like', 'likeedit','laydate'], function () {
|
||
var $ = layui.$
|
||
,laydate = layui.laydate
|
||
,formSelects = layui.formSelects
|
||
;
|
||
var like = layui.like;
|
||
var form = layui.form;
|
||
|
||
var likeedit = layui.likeedit;
|
||
|
||
laydate.render({
|
||
elem: '#birthday'
|
||
,format: 'yyyy-MM-dd'
|
||
,trigger: 'click'
|
||
});
|
||
|
||
$('.first_ratio').bind('input propertychange', function() {
|
||
var that = $(this);
|
||
var value = that.val();
|
||
format(that,value)
|
||
|
||
});
|
||
$(document).on('click','#lnglat',function(){
|
||
if(!$("#addr").val()){
|
||
layer.msg('请先填写用户的地址', { icon: 5, anim: 6 });
|
||
return false;
|
||
}
|
||
var markers = [];
|
||
$("#tMap").removeClass('layui-hide');
|
||
layer.open({
|
||
type:1,
|
||
area:["1200px","800px"],
|
||
title:"地图标识",
|
||
btn: ['取消','确定'],
|
||
skin: 'layui-ext-yourskin',
|
||
content:layui.jquery('#tMap'),
|
||
success:function(){
|
||
if(!map){
|
||
var path = []
|
||
var mode = TMap.tools.constants.EDITOR_ACTION.DRAW
|
||
var default_center = new TMap.LatLng(39.986785, 116.301012)
|
||
if(lnglat_data){
|
||
lnglat_data = lnglat_data.split(',')
|
||
|
||
function convertToLatLngArray(coordArray) {
|
||
var latLngArray = [];
|
||
for (var i = 0; i < coordArray.length; i += 2) {
|
||
var lat = parseFloat(coordArray[i].trim());
|
||
var lng = parseFloat(coordArray[i + 1].trim());
|
||
latLngArray.push(new TMap.LatLng(lat, lng));
|
||
}
|
||
return latLngArray;
|
||
}
|
||
path = convertToLatLngArray(lnglat_data)
|
||
default_center = path[0]
|
||
}
|
||
|
||
map = new TMap.Map('maplocation', {
|
||
zoom: 14,
|
||
center: default_center,
|
||
});
|
||
|
||
var markers = new TMap.MultiMarker({
|
||
map: map,
|
||
geometries: [],
|
||
});
|
||
|
||
geocoder = new TMap.service.Geocoder();
|
||
searchService = {
|
||
search:function(name){
|
||
geocoder.getLocation({ address:name })
|
||
.then((result) => {
|
||
console.log(result,999)
|
||
markers.updateGeometries([
|
||
{
|
||
id: 'main',
|
||
position: result.result.location, // 将得到的坐标位置用点标记标注在地图上
|
||
},
|
||
]);
|
||
map.setCenter(result.result.location);
|
||
|
||
// 显示坐标数值
|
||
});
|
||
|
||
|
||
|
||
}
|
||
}
|
||
|
||
// start
|
||
var polygon = new TMap.MultiPolygon({
|
||
map: map,
|
||
//多边形数据
|
||
geometries: [
|
||
{
|
||
'id': 'polygon', //该多边形在图层中的唯一标识(删除、更新数据时需要)
|
||
'styleId': 'polygon', //绑定样式名
|
||
'paths': path, //多边形轮廓
|
||
}
|
||
]
|
||
});
|
||
|
||
editor = new TMap.tools.GeometryEditor({
|
||
// TMap.tools.GeometryEditor 文档地址:https://lbs.qq.com/webApi/javascriptGL/glDoc/glDocEditor
|
||
map: map, // 编辑器绑定的地图对象
|
||
overlayList: [
|
||
{
|
||
overlay: polygon,
|
||
id: 'polygon',
|
||
},
|
||
],
|
||
actionMode: mode, // 编辑器的工作模式
|
||
activeOverlayId: 'marker', // 激活图层
|
||
snappable: true, // 开启吸附
|
||
selectable:true
|
||
});
|
||
|
||
if(lnglat_data){
|
||
setTimeout(function(){
|
||
editor.setActiveOverlay('polygon');
|
||
editor.setActionMode(TMap.tools.constants.EDITOR_ACTION.INTERACT)
|
||
},1000)
|
||
}
|
||
// 监听绘制结束事件,获取绘制几何图形
|
||
editor.on('draw_complete', (geometry) => {
|
||
// 判断当前处于编辑状态的图层id是否是overlayList中id为rectangle(矩形)图层
|
||
// 判断当前处于编辑状态的图层id是否是overlayList中id为rectangle(矩形)图层
|
||
var id = geometry.id;
|
||
if (editor.getActiveOverlay().id === 'rectangle') {
|
||
// 获取矩形顶点坐标
|
||
var geo = rectangle.geometries.filter(function (item) {
|
||
return item.id === id;
|
||
});
|
||
console.log('绘制的矩形定位的坐标:', geo[0].paths);
|
||
}
|
||
|
||
if (editor.getActiveOverlay().id === 'polygon') {
|
||
// 获取多边形顶点坐标
|
||
var geo = polygon.geometries.filter(function (item) {
|
||
return item.id === id;
|
||
});
|
||
|
||
result = (geo[0].paths)
|
||
console.log('绘制的所有多边形坐标:', result);
|
||
//改变成可编辑状态
|
||
editor.setActionMode(TMap.tools.constants.EDITOR_ACTION.INTERACT)
|
||
}
|
||
});
|
||
//end
|
||
}
|
||
|
||
|
||
|
||
|
||
} ,
|
||
yes: function(index, layero){
|
||
$("#tMap").addClass('layui-hide');
|
||
console.log(result,9999)
|
||
//do something
|
||
layer.close(index); //如果设定了yes回调,需进行手工关闭
|
||
},
|
||
btn2: function(index, layero){
|
||
console.log(result,888)
|
||
$('#lnglat').val(result)
|
||
$("#tMap").addClass('layui-hide');
|
||
layer.close(index)
|
||
} //这里content是一个普通的String
|
||
});
|
||
|
||
$(document).on('click','.searchKey',function(){
|
||
console.log('代码执行到这里')
|
||
var search_key=$("#search_key").val();
|
||
searchService.search(search_key);
|
||
|
||
})
|
||
});
|
||
|
||
|
||
//渲染部门
|
||
var brands = {$brand_lists | raw};
|
||
setBrand();
|
||
function setBrand(default_id) {
|
||
var brand_select_html = '<option value="">请选择部门的数据</option>';
|
||
for (var i in brands) {
|
||
brand_select_html += '<option value="' + brands[i]['id'] + '">' + brands[i]['name'] + '</option>';
|
||
}
|
||
$('select[name="brand_id"]').html(brand_select_html);
|
||
$('select[name="brand_id"]').val(default_id);
|
||
form.render('select');
|
||
}
|
||
|
||
|
||
//渲染员工分组
|
||
var grouping = {$grouping_id | raw};
|
||
setBranddss();
|
||
function setBranddss(default_id) {
|
||
var grouping_select_html = '<option value="">请选择分组</option>';
|
||
for (var i in grouping) {
|
||
grouping_select_html += '<option value="' + grouping[i]['id'] + '">' + grouping[i]['name'] + '</option>';
|
||
}
|
||
$('select[name="grouping_id"]').html(grouping_select_html);
|
||
$('select[name="grouping_id"]').val(default_id);
|
||
form.render('select');
|
||
}
|
||
|
||
|
||
//渲染部门
|
||
var goods = {$goods_id | raw};
|
||
//console.log("获取部门所有的内容",goods)
|
||
//setBrandds();
|
||
function setBrandds(default_id) {
|
||
var goods_select_html = '<option value="">请选择部门的数据</option>';
|
||
for (var i in goods) {
|
||
goods_select_html += '<option value="' + goods[i]['id'] + '">' + goods[i]['name'] + '</option>';
|
||
}
|
||
$('#goods_id').html(goods_select_html);
|
||
|
||
if (default_id) {
|
||
$('#goods_id').val(default_id);
|
||
}
|
||
|
||
// 更新渲染表单
|
||
form.render('select');
|
||
}
|
||
|
||
|
||
//分类联动
|
||
var categorys = {$category_lists | raw};
|
||
setSelectFirst();
|
||
function setSelectFirst(default_id) {
|
||
var category_select_html = '<option value="">请选择分类</option>';
|
||
for (var i in categorys) {
|
||
if (categorys[i]['level'] == 1) {
|
||
category_select_html += '<option value="' + categorys[i]['id'] + '">' + categorys[i]['name'] + '</option>';
|
||
}
|
||
}
|
||
$('select[name="first_category_id"]').html(category_select_html);
|
||
$('select[name="first_category_id"]').val(default_id);
|
||
form.render('select');
|
||
}
|
||
function setSelectSecond(default_id, parent_id) {
|
||
parent_id = parent_id === undefined ? $('select[name="first_category_id"]').val() : parent_id;
|
||
$('select[name="second_category_id"]').html('<option value="">请选择分类</option>');
|
||
$('select[name="third_category_id"]').html('<option value="">请选择分类</option>');
|
||
var category_select_html = '<option value="">请选择分类</option>';
|
||
for (var i in categorys) {
|
||
if (categorys[i]['parent_id'] == parent_id) {
|
||
category_select_html += '<option value="' + categorys[i]['id'] + '">' + categorys[i]['name'] + '</option>';
|
||
}
|
||
}
|
||
$('select[name="second_category_id"]').html(category_select_html);
|
||
$('select[name="second_category_id"]').val(default_id);
|
||
form.render('select');
|
||
}
|
||
function setSelectThird(default_id, parent_id) {
|
||
parent_id = parent_id === undefined ? $('select[name="second_category_id"]').val() : parent_id;
|
||
$('select[name="third_category_id"]').html('<option value="">请选择分类</option>');
|
||
var first_category_id = $('select[name="first_category_id"]').val();
|
||
var category_select_html = '<option value="">请选择分类</option>';
|
||
for (var i in categorys) {
|
||
if (categorys[i]['parent_id'] == parent_id) {
|
||
category_select_html += '<option value="' + categorys[i]['id'] + '">' + categorys[i]['name'] + '</option>';
|
||
}
|
||
}
|
||
$('select[name="third_category_id"]').html(category_select_html);
|
||
$('select[name="third_category_id"]').val(default_id);
|
||
form.render('select');
|
||
}
|
||
|
||
form.on('select(first_category)', function (data) {
|
||
setSelectSecond('', data.value);
|
||
});
|
||
form.on('select(second_category)', function (data) {
|
||
setSelectThird('', data.value);
|
||
});
|
||
//------------------------价格库存----------------------------------
|
||
// 单规格图片
|
||
like.imageUpload('.goods-one-spec-img-add', function (uris, element) {
|
||
if(uris.length>1){
|
||
layer.msg('最多最能选中1张图片');
|
||
return;
|
||
}
|
||
element.hide();
|
||
var key = element.parent().parent().parent().attr('spec-value-temp-ids');
|
||
spec_table_data["spec_image[]"+key] = uris[0];//保存图片地址
|
||
$(element).parent().html('<input name="one_spec_image" type="hidden" value="' + like.getUrlFileName(uris[0], '{$storageUrl}') + '"><a class="goods-one-spec-img-del-x">x</a><img class="goods-spec-img" src="' + uris[0] + '">');
|
||
});
|
||
$(document).on('mouseenter', '.goods-spec-img-div', function () {
|
||
$(this).find('.goods-one-spec-img-del-x').show();
|
||
});
|
||
$(document).on('mouseleave', '.goods-spec-img-div', function () {
|
||
$(this).find('.goods-one-spec-img-del-x').hide();
|
||
});
|
||
$(document).on('click', '.goods-one-spec-img-del-x', function () {
|
||
$(this).parent().html('<input type="hidden" name="one_spec_image"><img src="/static/common/image/plug/goods-lists-add-image.png" class="goods-one-spec-img-add">');
|
||
});
|
||
|
||
//多规格图片
|
||
like.imageUpload('.goods-spec-img-add', function (uris, element) {
|
||
|
||
if(uris.length>1){
|
||
layer.msg('最多最能选中1张图片');
|
||
return;
|
||
}
|
||
element.hide();
|
||
var key = element.parent().parent().parent().attr('spec-value-temp-ids');
|
||
spec_table_data["spec_image[]"+key] = uris[0];//保存图片地址
|
||
$(element).parent().html('<input name="spec_image[]" type="hidden" value="' + like.getUrlFileName(uris[0], '{$storageUrl}') + '"><a class="goods-spec-img-del-x">x</a><img class="goods-spec-img" src="' + uris[0] + '">');
|
||
});
|
||
$(document).on('mouseenter', '.goods-spec-img-div', function () {
|
||
$(this).find('.goods-spec-img-del-x').show();
|
||
});
|
||
$(document).on('mouseleave', '.goods-spec-img-div', function () {
|
||
$(this).find('.goods-spec-img-del-x').hide();
|
||
});
|
||
$(document).on('click', '.goods-spec-img-del-x', function () {
|
||
var key = 'spec_image[]' + $(this).parent().parent().parent().attr('spec-value-temp-ids');
|
||
$(this).parent().html('<input type="hidden" name="spec_image[]"><img src="/static/common/image/plug/goods-lists-add-image.png" class="goods-spec-img-add">');
|
||
spec_table_data[key] = '';
|
||
|
||
});
|
||
$(document).on('click', '.goods-spec-img', function () {
|
||
like.showImg($(this).attr('src'),600);
|
||
});
|
||
|
||
//规格生成表格
|
||
createTableBySepc = function () {
|
||
if ($('.goods-spec').size() <= 0) {
|
||
$('#more-spec-lists').hide();
|
||
return;
|
||
}
|
||
|
||
$('#more-spec-lists').show();
|
||
var table_title = [];
|
||
var table_data = [];
|
||
var spec_value_temp_arr = [];
|
||
var i = 0;
|
||
var th_html = $('#template-spec-table-th').html();
|
||
var tr_html = $('#template-spec-table-tr').html();
|
||
|
||
//遍历规格项目
|
||
$('.goods-spec').each(function () {
|
||
var spec_name = $(this).find('.spec_name').first().val();
|
||
if (isEmptyString(spec_name)) {
|
||
return true;
|
||
}
|
||
table_title[i] = spec_name;
|
||
table_data[i] = [];
|
||
spec_value_temp_arr[i] = [];
|
||
var j = 0;
|
||
$(this).find('.goods-spec-value .goods-spec-value-input').each(function () {
|
||
var spec_value = $(this).val();
|
||
var spec_value_temp_id = $(this).attr('spec-value-temp-id');
|
||
if (isEmptyString(spec_value)) {
|
||
return true;
|
||
}
|
||
table_data[i][j] = spec_value;
|
||
spec_value_temp_arr[i][j] = spec_value_temp_id;
|
||
j++;
|
||
});
|
||
i++;
|
||
});
|
||
|
||
table_html = '';
|
||
|
||
//表格头部组装
|
||
spec_th_html = '';
|
||
for (var i in table_title) {
|
||
spec_th_html += '<th>' + table_title[i] + '</th>';
|
||
}
|
||
table_html = th_html.replace('{spec_th}', spec_th_html);
|
||
|
||
spec_value_temp_arr = cartesianProduct(spec_value_temp_arr);
|
||
table_data = cartesianProduct(table_data);
|
||
for (var i in table_data) {
|
||
var spec_tr_html = '';
|
||
var tr_name_arr = [];
|
||
var specs = '';
|
||
if (Array.isArray(table_data[i])) {
|
||
//根据规格创建tr的id
|
||
var spec_value_temp_ids = '';
|
||
for(var j in spec_value_temp_arr[i]){
|
||
spec_value_temp_ids += spec_value_temp_arr[i][j]+',';
|
||
}
|
||
spec_value_temp_ids = spec_value_temp_ids.substring(0, spec_value_temp_ids.lastIndexOf(','));
|
||
spec_tr_html += '<tr spec-value-temp-ids="'+spec_value_temp_ids+'">';
|
||
for (var j in table_data[i]) {
|
||
spec_tr_html += '<td>' + table_data[i][j] + '</td>';
|
||
tr_name_arr[j] = table_data[i][j];
|
||
specs += table_data[i][j].replace(',', '') + ',';
|
||
}
|
||
} else {
|
||
var spec_value_temp_ids = spec_value_temp_arr[i];
|
||
spec_tr_html = '<tr spec-value-temp-ids="'+spec_value_temp_ids+'">';
|
||
spec_tr_html += '<td>' + table_data[i] + '</td>';
|
||
specs += table_data[i].replace(',', '') + ',';
|
||
}
|
||
specs = specs.substring(0, specs.lastIndexOf(','));
|
||
spec_table_data["spec_value_str[]"+spec_value_temp_ids] = specs;
|
||
spec_tr_html += '<td style="display: none"><input type="hidden" name="spec_value_str[]" value="' + specs + '"><input type="hidden" name="item_id[]" value=""></td>';
|
||
table_html += tr_html.replace('{spec_td}', spec_tr_html);
|
||
|
||
}
|
||
$('#more-spec-lists-table').html(table_html);
|
||
setTableValue();
|
||
}
|
||
|
||
//------------------------编辑页面----------------------------------
|
||
{notempty name='info'}
|
||
var goods_info= {$info|raw|default=''};
|
||
|
||
console.log(goods_info);
|
||
$('input[name="goodss_id"]').val(goods_info['base']['id']);
|
||
$('input[name="name"]').val(goods_info['base']['name']);
|
||
$('input[name="mobile"]').val(goods_info['base']['mobile']);
|
||
$('input[name="jon"]').val(goods_info['base']['jon']);
|
||
$('input[name="education"]').val(goods_info['base']['education']);
|
||
$('input[name="identity"]').val(goods_info['base']['identity']);
|
||
$('input[name="urgent_name"]').val(goods_info['base']['urgent_name']);
|
||
$('input[name="urgent_phone"]').val(goods_info['base']['urgent_phone']);
|
||
$('input[name="native"]').val(goods_info['base']['native']);
|
||
$('input[name="sign"]').val(goods_info['base']['sign']);
|
||
$('input[name="mooney"]').val(goods_info['base']['mooney']);
|
||
$('input[name="score"]').val(goods_info['base']['score']);
|
||
$('input[name="bank"]').val(goods_info['base']['bank']);
|
||
$('input[name="account"]').val(goods_info['base']['account']);
|
||
$('input[name="addr"]').val(goods_info['base']['addr']);
|
||
$('input[name="social"]').val(goods_info['base']['social']);
|
||
$('input[name="sbyhk"]').val(goods_info['base']['sbyhk']);
|
||
$('input[name="transit"]').val(goods_info['base']['transit']);
|
||
$('input[name="distance"]').val(goods_info['base']['distance']);
|
||
|
||
$('input[name="birthday"]').val(goods_info['base']['birthday']);
|
||
$('input[name="nation"]').val(goods_info['base']['nation']);
|
||
$('input[name="adder"]').val(goods_info['base']['adder']);
|
||
$('input[name="store_longitude"]').val(goods_info['base']['lat']);
|
||
$('input[name="lnglat"]').val(goods_info['base']['lnglat']);
|
||
$('input[name="store_latitude"]').val(goods_info['base']['lng']);
|
||
$("input[name=sex][value="+goods_info['base']['sex']+"]").prop("checked",true); //性别
|
||
$("input[name=onwork][value="+goods_info['base']['onwork']+"]").prop("checked",true); //是否离职
|
||
setSelectFirst(goods_info['base']['first_category_id']);
|
||
setSelectSecond(goods_info['base']['second_category_id']);
|
||
setSelectThird(goods_info['base']['third_category_id']);
|
||
|
||
setBrand(goods_info['base']['group_id']); //部门的修改
|
||
|
||
|
||
setBrandds(goods_info['base']['goods_id']); //部门的修改
|
||
setBranddss(goods_info['base']['grouping_id']);
|
||
|
||
lnglat_data = goods_info['base']['lnglat']
|
||
|
||
{/notempty}
|
||
//------------------------编辑页面----------------------------------
|
||
});
|
||
</script> |