提交 f7585ded 编写于 作者: doc_wei's avatar doc_wei

保养订单修改完成

上级 bbf2f575
......@@ -64,7 +64,7 @@ layui.config({
return "线下下单";
}
}},
{ field: 'createName', title: '录入人', width: 120, rowspan: '2' },
{ field: 'createName', title: '服务顾问', width: 120, rowspan: '2' },
{ field: 'createTime', title: '单据日期', align: 'center', width: 150, rowspan: '2' },
],[
{ field: 'areaName', title: '区域', align: 'left', width: 120},
......
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'laydate'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
laydate = layui.laydate;
laydate.render({
elem: '#nextServiceTime',
range: false
});
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
id: parent.rowId,
serviceTechnicianId: shopUtil.staffMation.staffId,
nextServiceMileage: $("#nextServiceMileage").val(),
nextServiceTime: $("#nextServiceTime").val()
};
AjaxPostUtil.request({url: shopBasePath + "complateKeepFitOrder", params: params, type: 'json', method: "POST", callback: function(json){
if(json.returnCode == 0){
parent.layer.close(index);
parent.refreshCode = '0';
}else{
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}, async: true});
}
return false;
});
// 维修技师选择
$("body").on("click", ".chooseServiceTechnicianBtn", function(e){
shopUtil.openStoreStaffChoosePage(function (staffMation){
$("#serviceTechnician").val(staffMation.userName);
});
});
$("body").on("click", "#cancle", function(){
parent.layer.close(index);
});
});
});
\ No newline at end of file
......@@ -65,15 +65,15 @@ layui.config({
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var tableData = new Array();
$.each($("#useTable tr"), function(i, item) {
// 获取行编号
var rowNum = $(item).attr("trcusid").replace("tr", "");
var row = {
consumeExplain: $("#consumeExplain" + rowNum.toString()).val(),
price: $("#price" + rowNum.toString()).val()
};
tableData.push(row);
});
// $.each($("#useTable tr"), function(i, item) {
// // 获取行编号
// var rowNum = $(item).attr("trcusid").replace("tr", "");
// var row = {
// consumeExplain: $("#consumeExplain" + rowNum.toString()).val(),
// price: $("#price" + rowNum.toString()).val()
// };
// tableData.push(row);
// });
var userType = $("input[name='userType']:checked").val();
......@@ -84,7 +84,8 @@ layui.config({
memberCarId: userType == 1 ? "" : $("#memberCar").val(),
memberCarPlate: userType == 1 ? $("#memberCarPlate").val() : $("#memberCar").find("option:selected").text(),
mealOrderChildId: userType == 1 ? "" : $("#mealId").val(),
servicePrice: $("#servicePrice").val(),
// servicePrice: $("#servicePrice").val(),
servicePrice: 0,
remark: $("#remark").val(),
type: 2,
source: 2,
......
......@@ -60,7 +60,7 @@ layui.config({
return "线下下单";
}
}},
{ field: 'createName', title: '录入人', width: 120 },
{ field: 'createName', title: '服务顾问', width: 120 },
{ field: 'createTime', title: '单据日期', align: 'center', width: 150 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 200, toolbar: '#tableBar'}
]],
......@@ -72,12 +72,10 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'delete') { // 删除
delet(data);
}else if(layEvent == 'select'){ // 详情
if(layEvent == 'select'){ // 详情
select(data)
}else if(layEvent == 'complatePay'){ // 完成支付
complatePay(data)
}else if(layEvent == 'complateKeepFit'){ // 完成保养
complateKeepFit(data)
}else if(layEvent == 'verification'){ // 核销
verification(data)
}else if(layEvent == 'cancleOrder'){ // 取消订单
......@@ -85,21 +83,6 @@ layui.config({
}
});
// 删除
function delet(data){
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){
layer.close(index);
AjaxPostUtil.request({url: shopBasePath + "deleteKeepFitOrder", params: {id: data.id}, type: 'json', method: "POST", callback: function(json){
if(json.returnCode == 0){
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}else{
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
});
}
// 核销
function verification(data){
layer.confirm("确认对该单据进行核销吗?", {icon: 3, title: "核销操作"}, function(index){
......@@ -143,13 +126,13 @@ layui.config({
});
}
// 完成支付
function complatePay(data){
// 保养完成
function complateKeepFit(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/keepFitOrder/complatePayKeepFitOrder.html",
title: '完成支付',
pageId: "complatePayKeepFitOrder",
url: "../../tpl/keepFitOrder/complateKeepFitOrder.html",
title: '保养完成',
pageId: "complateKeepFitOrder",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
if (refreshCode == '0') {
......
var rowId = "";
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form', 'fsCommon'], function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form,
table = layui.table;
// 设置提示信息
var s = "店员选择规则:1.单选,双击指定行数据即可选中";
s += '如没有查到要选择的店员,请检查店员信息是否满足当前规则。';
$("#showInfo").html(s);
// 加载我所在的门店
shopUtil.queryStaffBelongStoreList(function (json){
$("#storeId").html(getDataUseHandlebars(getFileContent('tpl/template/select-option-must.tpl'), json));
});
form.on('select(storeId)', function(data) {
table.reload("messageTable", {page: {curr: 1}, where: getTableParams()})
});
initTable();
function initTable(){
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: shopBasePath + 'storeStaff001',
where: getTableParams(),
even: true,
page: true,
limits: [8, 16, 24, 32, 40, 48, 56],
limit: 8,
cols: [[
{ type: 'radio', fixed: 'left'},
{ field: 'jobNumber', title: '工号', align: 'left', width: 140 },
{ field: 'userName', title: '姓名', width: 120 },
{ field: 'companyName', title: '企业', width: 150 },
{ field: 'departmentName', title: '部门', width: 140 },
{ field: 'jobName', title: '职位', width: 140 },
]],
done: function(res, curr, count){
matchingLanguage();
$('#messageTable').next().find('.layui-table-body').find("table" ).find("tbody").children("tr").on('dblclick',function(){
var dubClick = $('#messageTable').next().find('.layui-table-body').find("table").find("tbody").find(".layui-table-hover");
dubClick.find("input[type='radio']").prop("checked", true);
form.render();
var chooseIndex = JSON.stringify(dubClick.data('index'));
var obj = res.rows[chooseIndex];
parent.shopUtil.staffMation = obj;
parent.refreshCode = '0';
parent.layer.close(index);
});
$('#messageTable').next().find('.layui-table-body').find("table" ).find("tbody").children("tr").on('click',function(){
var click = $('#messageTable').next().find('.layui-table-body').find("table").find("tbody").find(".layui-table-hover");
click.find("input[type='radio']").prop("checked", true);
form.render();
})
}
});
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
});
form.render();
}
form.render();
form.on('submit(formSearch)', function (data) {
if (winui.verifyForm(data.elem)) {
table.reload("messageTable", {page: {curr: 1}, where: getTableParams()});
}
return false;
});
$("body").on("click", "#reloadTable", function(){
loadTable();
});
function loadTable(){
table.reload("messageTable", {where: getTableParams()});
}
function getTableParams(){
var storeId = "-";
if(!isNull($("#storeId").val())){
storeId = $("#storeId").val();
}
return {
userName: $("#userName").val(),
storeId: storeId
};
}
exports('storeStaffChoose', {});
});
\ No newline at end of file
......@@ -39,9 +39,9 @@
<div class="layui-input-inline">
<select id="state" name="state" lay-filter="state" lay-search="">
<option value="">全部</option>
<option value="1">待支付</option>
<option value="2">已支付(待核销)</option>
<option value="3">支付(已核销)</option>
<option value="1">保养中</option>
<option value="2">待核销</option>
<option value="3">核销</option>
<option value="10">已取消</option>
</select>
</div>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="padding:20px; margin:0 auto;">
<form class="layui-form" action="" id="showForm">
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">维修技师<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="serviceTechnician" name="serviceTechnician" win-verify="required" placeholder="请选择维修技师" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon chooseServiceTechnicianBtn"></i>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">下次保养公里数<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="nextServiceMileage" name="nextServiceMileage" win-verify="required|number" placeholder="请输入下次保养公里数" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">下次保养时间<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="nextServiceTime" name="nextServiceTime" win-verify="required" placeholder="请选择下次保养时间" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formAddBean">完成保养</button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/keepFitOrder/'}).use('complateKeepFitOrder');
</script>
</body>
</html>
\ No newline at end of file
......@@ -43,9 +43,9 @@
</div>
</div>
<div class="layui-form-item layui-col-xs12 memberMation">
<label class="layui-form-label">套餐信息</label>
<label class="layui-form-label">套餐信息<i class="red">*</i></label>
<div class="layui-input-block">
<select id="mealId" name="mealId" lay-filter="mealId" lay-search="">
<select id="mealId" name="mealId" lay-filter="mealId" lay-search="" win-verify="required">
</select>
</div>
......@@ -56,7 +56,7 @@
<input type="text" id="memberCarPlate" name="memberCarPlate" placeholder="请输入车牌号" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<!--<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">耗材</label>
<div class="layui-input-block">
<div class="winui-toolbar">
......@@ -89,7 +89,7 @@
<div class="layui-input-block ver-center" id="allPrice">
0 元
</div>
</div>
</div>-->
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
......
......@@ -15,6 +15,9 @@
<script type="text/x-handlebars-template" id="simpleTemplate">
{{#bean}}
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">基本信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">订单编号</label>
<div class="layui-input-block ver-center">
......@@ -69,7 +72,7 @@
{{mealName}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<!--<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">耗材</label>
<div class="layui-input-block">
<table class="layui-table">
......@@ -89,19 +92,19 @@
</tbody>
</table>
</div>
</div>
</div>-->
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">应付金额</label>
<div class="layui-input-block ver-center">
{{payablePrice}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<!--<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">服务费</label>
<div class="layui-input-block ver-center">
{{servicePrice}}
</div>
</div>
</div>-->
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">实付金额</label>
<div class="layui-input-block ver-center">
......@@ -120,6 +123,27 @@
{{{remark}}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">保养信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">维修技师</label>
<div class="layui-input-block ver-center">
{{serviceTechnicianName}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">下次保养公里数</label>
<div class="layui-input-block ver-center">
{{nextServiceMileage}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">下次保养时间</label>
<div class="layui-input-block ver-center">
{{nextServiceTime}}
</div>
</div>
{{/bean}}
</script>
......
......@@ -34,9 +34,9 @@
<div class="layui-input-inline">
<select id="state" name="state" lay-filter="state" lay-search="">
<option value="">全部</option>
<option value="1">待支付</option>
<option value="2">已支付(待核销)</option>
<option value="3">支付(已核销)</option>
<option value="1">保养中</option>
<option value="2">待核销</option>
<option value="3">核销</option>
<option value="10">已取消</option>
</select>
</div>
......@@ -59,17 +59,14 @@
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(d.cancleState == 1 && d.state == 1 && auth('1644317759940')){ }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"><language showName="com.skyeye.deleteBtn"></language></a>
{{# if(d.cancleState == 1 && d.state == 1 && auth('1645623479038') && d.source == 2){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="complateKeepFit">完成保养</a>
{{# } }}
{{# if(d.cancleState == 1 && d.state == 1 && auth('1644317746790') && d.source == 2){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="complatePay">完成支付</a>
{{# } }}
{{# if(d.cancleState == 1 && d.state == 2 && auth('1644378387049') && !isNull(d.mealOrderChildId)){ }}
{{# if(d.cancleState == 1 && d.state == 2 && auth('1644378387049') && !isNull(d.mealOrderChildId) && d.source == 2){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="verification">核销</a>
{{# } }}
{{# if(d.cancleState == 1 && d.state == 1 && auth('1644842786855')){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="cancleOrder">取消订单</a>
{{# if(d.cancleState == 1 && d.state == 1 && auth('1644842786855') && d.source == 2){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="cancleOrder">取消保养</a>
{{# } }}
</script>
</div>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div class="txtcenter" style="margin:0 auto;padding-top:10px;">
<div class="winui-tip alert-info" id="showInfo">
</div>
<form class="layui-form layui-form-pane layui-col-xs12" action="" autocomplete="off">
<div class="winui-toolbar layui-col-xs12">
<div class="winui-tool layui-col-xs3">
<select id="storeId" name="storeId" lay-filter="storeId" lay-search="">
</select>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-inline">
<label class="layui-form-label">姓名</label>
<div class="layui-input-inline">
<input type="text" id="userName" name="userName" placeholder="请输入姓名" class="layui-input" />
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" lay-submit lay-filter="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
</div>
<div class="winui-toolbar layui-col-xs12">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/storeStaff/'}).use('storeStaffChoose');
</script>
</body>
</html>
\ No newline at end of file
......@@ -51,11 +51,11 @@ var shopUtil = {
getKeepFitOrderStateName: function (data){
if(data.cancleState == 1){
if(data.state == 1){
return "<span class='state-down'>待支付</span>";
return "<span class='state-down'>保养中</span>";
}else if(data.state == 2){
return "<span class='state-up'>已支付(待核销)</span>";
return "<span class='state-up'>待核销</span>";
}else if(data.state == 3){
return "<span class='state-up'>已支付(已核销)</span>";
return "<span class='state-up'>已核销</span>";
}
}else{
return '已取消';
......@@ -134,4 +134,27 @@ var shopUtil = {
}, async: false});
},
/**
* 门店员工选择页面
*
* @param callback 回调函数
*/
staffMation: {},
openStoreStaffChoosePage: function (callback){
_openNewWindows({
url: "../../tpl/storeStaff/storeStaffChoose.html",
title: "选择店员",
pageId: "storeStaffChoose",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
if (refreshCode == '0') {
if(typeof(callback) == "function") {
callback(shopUtil.staffMation);
}
} else if (refreshCode == '-9999') {
winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000});
}
}});
},
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册