Commit 57d1c3eb by 洪晓珍

order config screen

parent 15737fda
jQuery(document).ready(function ($) {
var auditTable = "wo_sys_wo_config"
// 工单列表逻辑
var app = new Vue({
el: '#app',
data: {
deptId: 0,
addDeptId:0,
woId:0,
deptNames: [
{value: 0, text: "请选择"},
cfgId:'',
depts: [
/*{value: 0, text: "请选择"},
{value: 1, text: "好柿"},
{value: 2, text: "心暖"},
{value: 3, text: "电商"},
{value: 4, text: "客服"}
{value: 4, text: "客服"}*/
],
woId: '',
operateName: '新增',
displayForm: false,
displayAuditTrace: false,
addWoType: 0,
addWoType: '',
woTypes: [
{value: 0, text: "请选择"},
{value: 1, text: "回访工单"}
{value: "default", text: "请选择"},
{value: 'book', text: "预订工单"},
{value: "revisit", text: "回访工单"},
{value: "fee", text: "费率修改工单"},
{value: 'as', text: "售后工单"},
{value: 'sys', text: "系统工单"},
{value: 'manual', text: "人工工单"}
],
woTrueTypes: {
/*woTrueTypes: {
"revisit": 1,
"": 0
},
},*/
woTypeDB: {
0: "",
1: "revisit"
},
urgentLevels: [
{value: 0, text: "请选择"},
{value: 1, text: "一般"},
{value: 1, text: "非常紧急"},
{value: 2, text: "紧急"},
{value: 3, text: "非常紧急"}
{value: 3, text: "一般"}
],
addUrgentLevel:0,
duringTimeHour: 2,
......@@ -44,32 +49,48 @@ jQuery(document).ready(function ($) {
remindTime: 5,
sysCfgList: [],
auditTraceList: [],
sysCfgId: 0
sysCfgId: 0,
auditDetails: []
},
mounted: function () {
// 初始化加载回访工单列表
var url = "/work/sysWoCfg/list?page=1&limit=10";
var data = JSON.stringify({
// 初始化加载工单列表
var url = "/work/sysWoCfg/listAll";
/*var data = JSON.stringify({
"woType": "revisit"
});
});*/
$.ajax({
url: url,
dataType: "json",
data: data,
/*data: data,*/
type: 'post',
contentType: "application/json; charset=utf-8",
success: function (res) {
if (res.data) {
console.log(res.data);
app.sysCfgList = res.data;
}
}
});
$.ajax({
url: "/work/sysWoCfg/dept",
dataType: "json",
type: 'post',
contentType: "application/json; charset=utf-8",
success: function (res) {
if (res.data) {
console.log(res.data);
app.depts = res.data;
}
}
})
},
methods: {
sysCfgDetail: function (sysCfg) {
console.log("sysCfgDetail");
app.displayForm = true;
app.displayAuditTrace = false;
// 获取工单详情
// 获取工单配置详情
var data = JSON.stringify(
{
"id": sysCfg.id
......@@ -85,7 +106,7 @@ jQuery(document).ready(function ($) {
success: function (res) {
console.log(res);
if (res.data) {
app.addWoType = app.woTrueTypes[res.data.woType];
app.addWoType = res.data.woType;
app.addUrgentLevel = res.data.urgentLevel;
app.addDeptId = res.data.deptId;
var duringTime = res.data.duringTime;
......@@ -103,55 +124,37 @@ jQuery(document).ready(function ($) {
});
},
querySysCfg: function () {
console.log('querySysCfg: ' + app.deptId);
console.log("woId: " + app.woId);
var data = JSON.stringify(
{
"woId": app.woId,
"deptId": app.deptId,
"creator":1,
"creatorName":'sys',
"deptId": app.addDeptId,
"deptName": app.deptNames[app.addDeptId].text,
"duringTime": parseInt(app.duringTimeMin) + parseInt(app.duringTimeHour * 60),
"remindTime": app.remindTime,
"assignLimit": parseInt(app.assignLimit),
"urgentLevel":app.addUrgentLevel
}
);
app.displayForm = false;
app.displayAuditTrace = false;
console.log('querySysCfg: deptId:' + app.deptId + ", cfgId: " + app.cfgId);
var url = "/work/sysWoCfg/listByCriteria?deptId=" + app.deptId + "&cfgId=" + app.cfgId;
$.ajax({
url: url,
dataType: "json",
type: 'post',
contentType: "application/json; charset=utf-8",
success: function (res) {
console.log(res);
if (res.data) {
console.log(res.data);
app.sysCfgList = res.data;
}
}
});
},
queryAuditTrace: function (sysCfg) {
console.log('queryAuditTrace: ' + sysCfg.id);
app.displayAuditTrace = true;
app.displayForm = false;
},
addSysCfg: function () {
app.displayForm = true;
console.log('addSysCfg');
app.operateName = '新增';
},
saveOrUpdateSysCfg: function () {
console.log('saveOrUpdateSysCfg');
var data = JSON.stringify(
{
"id": app.sysCfgId,
"woType": app.woTypeDB[app.addWoType],
"creator":1,
"creatorName":'sys',
"deptId": app.addDeptId,
"deptName": app.deptNames[app.addDeptId].text,
"duringTime": parseInt(app.duringTimeMin) + parseInt(app.duringTimeHour * 60),
"remindTime": app.remindTime,
"assignLimit": parseInt(app.assignLimit),
"urgentLevel":app.addUrgentLevel
}
{
"tableName": auditTable,
"fieldValue": sysCfg.id
}
);
console.log("Request data...");
console.log(data);
var url = "/work/sysWoCfg/saveOrUpdate";
var url = "/work/auditTrace/list";
$.ajax({
url: url,
dataType: "json",
......@@ -160,9 +163,117 @@ jQuery(document).ready(function ($) {
contentType: "application/json; charset=utf-8",
success: function (res) {
console.log(res);
app.displayForm = false;
app.auditDetails = res.data;
}
});
},
addSysCfg: function () {
console.log('addSysCfg');
app.displayForm = true;
app.displayAuditTrace = false;
app.operateName = '新增';
app.addDeptId = 0;
app.addWoType = 'default';
app.addUrgentLevel = 0;
app.duringTimeHour = 0;
app.duringTimeMin = 0;
app.remindTime = 5;
app.assignLimit = 20;
},
saveOrUpdateSysCfg: function () {
if(app.operateName == '新增'){
console.log('saveSysCfg');
console.log("Insert data...");
console.log(data);
var data = JSON.stringify(
{
"woType": app.addWoType,
"creator":1,//处理人id
"creatorName":'admin',//处理人名字
"deptId": app.addDeptId,
"deptName": app.depts.deptName,
"duringTime": parseInt(app.duringTimeMin) + parseInt(app.duringTimeHour * 60),
"remindTime": app.remindTime,
"assignLimit": parseInt(app.assignLimit),
"urgentLevel":app.addUrgentLevel
}
);
var url = "/work/sysWoCfg/save";
$.ajax({
url: url,
dataType: "json",
data: data,
type: 'post',
contentType: "application/json; charset=utf-8",
success: function (res) {
console.log(res);
app.displayForm = false;
if(res.data.id = -1){
//TODO
this.messagebox.show("插入失败,已存在相同工单类型和归属部门的工单配置,请编辑实现");
}
$.ajax({
url: "/work/sysWoCfg/listAll",
dataType: "json",
type: 'post',
contentType: "application/json; charset=utf-8",
success: function (res) {
if (res.data) {
console.log(res.data);
app.sysCfgList = res.data;
}
}
});
}
});
//重新加載列表
} else if(app.operateName == '编辑'){
console.log('updateSysCfg');
console.log("Update data...");
console.log(data);
var data = JSON.stringify(
{
"id": app.sysCfgId,
"woType": app.addWoType,
"creator":1,//处理人id
"creatorName":'admin',//处理人名字
"deptId": app.addDeptId,
"deptName": app.depts.deptName,
"duringTime": parseInt(app.duringTimeMin) + parseInt(app.duringTimeHour * 60),
"remindTime": app.remindTime,
"assignLimit": parseInt(app.assignLimit),
"urgentLevel":app.addUrgentLevel
}
);
var url = "/work/sysWoCfg/update";
$.ajax({
url: url,
dataType: "json",
data: data,
type: 'post',
contentType: "application/json; charset=utf-8",
success: function (res) {
console.log(res);
app.displayForm = false;
$.ajax({
url: "/work/sysWoCfg/listAll",
dataType: "json",
type: 'post',
contentType: "application/json; charset=utf-8",
success: function (res) {
if (res.data) {
console.log(res.data);
app.sysCfgList = res.data;
}
}
});
}
});
//重新加載列表
}
// app.displayForm = true;
}
}
......
......@@ -172,7 +172,7 @@ jQuery(document).ready(function ($) {
var data = JSON.stringify(
{
"woId": woId,
"processUid": 1
"processUid": 1//当前用户
}
);
$.ajax({
......@@ -190,7 +190,7 @@ jQuery(document).ready(function ($) {
var data = JSON.stringify(
{
"fieldValue": woId,
"processUid": 1,
"processUid": 1,//当前用户
"tableName":auditTableName
}
);
......
......@@ -152,13 +152,13 @@
<p>
<span>归属部门:</span>
<select name="department" v-model="deptId">
<option v-for="(item,index) in deptNames" :value='index'> {{item.text}}
<option v-for="(item,index) in depts" :value='item.deptId'> {{item.deptName}}
</option>
</select>
</p>
<p>
<span>工单ID:</span>
<input type="text" v-model="woId">
<span>工单规则ID:</span>
<input type="text" v-model="cfgId">
</p>
<p class="btns">
<button type="button" class="btn btn-primary" @click="querySysCfg">查询</button>
......@@ -172,8 +172,8 @@
<th>归属部门</th>
<th>工单类型</th>
<th>紧急程度</th>
<th>工单时效</th>
<th>倒计时</th>
<th>工单时效(分)</th>
<th>倒计时提醒(分)</th>
<th>派发上限</th>
<th>操作</th>
</tr>
......@@ -183,10 +183,10 @@
<tr v-for="sysCfg in sysCfgList" v-bind:key="sysCfg.id">
<td scope="row">{{sysCfg.id}}</td>
<td>{{sysCfg.deptName}}</td>
<td>{{sysCfg.woType}}</td>
<td>{{sysCfg.urgentLevel}}</td>
<td>{{sysCfg.woTypeDisplay}}</td>
<td>{{sysCfg.urgentLevelDisplay}}</td>
<td>{{sysCfg.duringTime}}</td>
<td>{{sysCfg.counter}}</td>
<td>{{sysCfg.remindTime}}</td>
<td>{{sysCfg.assignLimit}}</td>
<td><a href="#" @click="sysCfgDetail(sysCfg)">编辑</a><a href="#" @click="queryAuditTrace(sysCfg)">操作日志</a></td>
</tr>
......@@ -204,14 +204,14 @@
<div class="row1">
<span>一级部门:</span>
<select name="" v-model="addDeptId">
<option v-for="(item,index) in deptNames" :value='index'> {{item.text}}
<option v-for="(item,index) in depts" :value='item.deptId'> {{item.deptName}}
</option>
</select>
</div>
<div class="row2">
<span>工单类型:</span>
<select name="" v-model="addWoType">
<option v-for="(item,index) in woTypes" :value='index' > {{item.text}}
<option v-for="(item,index) in woTypes" :value='item.value' > {{item.text}}
</option>
</select>
</div>
......@@ -255,88 +255,14 @@
</tr>
</thead>
<tbody>
<tr>
<td>陈小钱</td>
<td>2018.12.28 22:22:31</td>
<td>编辑</td>
<td>对工单时效进行了操作原值“10”新值“20”</td>
</tr>
<tr>
<td>陈小钱</td>
<td>2018.12.28 22:22:31</td>
<td>编辑</td>
<td>对工单时效进行了操作原值“10”新值“20”</td>
</tr>
<tr>
<td>陈小钱</td>
<td>2018.12.28 22:22:31</td>
<td>编辑</td>
<td>对工单时效进行了操作原值“10”新值“20”</td>
</tr>
<tr>
<td>陈小钱</td>
<td>2018.12.28 22:22:31</td>
<td>编辑</td>
<td>对工单时效进行了操作原值“10”新值“20”</td>
</tr>
</tbody>
<tr class="active" v-for="audit in auditDetails" v-bind:key = "audit.id">
<td>{{ audit.operatorName }}</td>
<td>{{ audit.operateTime }}</td>
<td>{{ audit.actionType }}</td>
<td>{{ audit.actionDetail }}</td>
</tr>
</tbody>
</table>
<!--<table class="table table4">
<thead>
<tr>
<th>新增系统工单规则</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="row1">
<span>一级部门:</span>
<select name="" id="">
<option value="">好柿</option>
<option value="">心暖</option>
<option value="">电商</option>
<option value="">客服</option>
</select>
</div>
<div class="row2">
<span>工单类型:</span>
<select name="" id="">
<option value="">回访工单</option>
<option value="">预定工单</option>
</select>
</div>
<div class="row3">
<span>紧急程度:</span>
<select name="" id="">
<option value="">一般</option>
<option value="">紧急</option>
<option value="">非常紧急</option>
</select>
</div>
<div class="row4">
<span>工单时效:</span>
<input type="text">小时
<input type="text">分钟
<i>为空值则不限定时间</i>
</div>
<div class="row5">
<span>提醒时间:</span>
<input type="text">分钟
<i>为空值则不提醒</i>
</div>
<div class="row6">
<span>派发上限:</span>
<input type="text">
<i>即每个角色当天可接收工单上限,为空值则不限定上限</i>
</div>
<div class="row7">
<button class="btn btn-default" type="submit">保存</button>
</div>
</td>
</tr>
</tbody>
</table>-->
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment