Commit 57d1c3eb by 洪晓珍

order config screen

parent 15737fda
jQuery(document).ready(function ($) { jQuery(document).ready(function ($) {
var auditTable = "wo_sys_wo_config"
// 工单列表逻辑 // 工单列表逻辑
var app = new Vue({ var app = new Vue({
el: '#app', el: '#app',
data: { data: {
deptId: 0, deptId: 0,
addDeptId:0, addDeptId:0,
woId:0, cfgId:'',
deptNames: [ depts: [
{value: 0, text: "请选择"}, /*{value: 0, text: "请选择"},
{value: 1, text: "好柿"}, {value: 1, text: "好柿"},
{value: 2, text: "心暖"}, {value: 2, text: "心暖"},
{value: 3, text: "电商"}, {value: 3, text: "电商"},
{value: 4, text: "客服"} {value: 4, text: "客服"}*/
], ],
woId: '',
operateName: '新增', operateName: '新增',
displayForm: false, displayForm: false,
displayAuditTrace: false, displayAuditTrace: false,
addWoType: 0, addWoType: '',
woTypes: [ woTypes: [
{value: 0, text: "请选择"}, {value: "default", text: "请选择"},
{value: 1, text: "回访工单"} {value: 'book', text: "预订工单"},
{value: "revisit", text: "回访工单"},
{value: "fee", text: "费率修改工单"},
{value: 'as', text: "售后工单"},
{value: 'sys', text: "系统工单"},
{value: 'manual', text: "人工工单"}
], ],
woTrueTypes: { /*woTrueTypes: {
"revisit": 1, "revisit": 1,
"": 0 "": 0
}, },*/
woTypeDB: { woTypeDB: {
0: "", 0: "",
1: "revisit" 1: "revisit"
}, },
urgentLevels: [ urgentLevels: [
{value: 0, text: "请选择"}, {value: 0, text: "请选择"},
{value: 1, text: "一般"}, {value: 1, text: "非常紧急"},
{value: 2, text: "紧急"}, {value: 2, text: "紧急"},
{value: 3, text: "非常紧急"} {value: 3, text: "一般"}
], ],
addUrgentLevel:0, addUrgentLevel:0,
duringTimeHour: 2, duringTimeHour: 2,
...@@ -44,32 +49,48 @@ jQuery(document).ready(function ($) { ...@@ -44,32 +49,48 @@ jQuery(document).ready(function ($) {
remindTime: 5, remindTime: 5,
sysCfgList: [], sysCfgList: [],
auditTraceList: [], auditTraceList: [],
sysCfgId: 0 sysCfgId: 0,
auditDetails: []
}, },
mounted: function () { mounted: function () {
// 初始化加载回访工单列表 // 初始化加载工单列表
var url = "/work/sysWoCfg/list?page=1&limit=10"; var url = "/work/sysWoCfg/listAll";
var data = JSON.stringify({ /*var data = JSON.stringify({
"woType": "revisit" "woType": "revisit"
}); });*/
$.ajax({ $.ajax({
url: url, url: url,
dataType: "json", dataType: "json",
data: data, /*data: data,*/
type: 'post', type: 'post',
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (res) { success: function (res) {
if (res.data) { if (res.data) {
console.log(res.data);
app.sysCfgList = 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: { methods: {
sysCfgDetail: function (sysCfg) { sysCfgDetail: function (sysCfg) {
console.log("sysCfgDetail");
app.displayForm = true; app.displayForm = true;
app.displayAuditTrace = false; app.displayAuditTrace = false;
// 获取工单详情 // 获取工单配置详情
var data = JSON.stringify( var data = JSON.stringify(
{ {
"id": sysCfg.id "id": sysCfg.id
...@@ -85,7 +106,7 @@ jQuery(document).ready(function ($) { ...@@ -85,7 +106,7 @@ jQuery(document).ready(function ($) {
success: function (res) { success: function (res) {
console.log(res); console.log(res);
if (res.data) { if (res.data) {
app.addWoType = app.woTrueTypes[res.data.woType]; app.addWoType = res.data.woType;
app.addUrgentLevel = res.data.urgentLevel; app.addUrgentLevel = res.data.urgentLevel;
app.addDeptId = res.data.deptId; app.addDeptId = res.data.deptId;
var duringTime = res.data.duringTime; var duringTime = res.data.duringTime;
...@@ -103,55 +124,131 @@ jQuery(document).ready(function ($) { ...@@ -103,55 +124,131 @@ jQuery(document).ready(function ($) {
}); });
}, },
querySysCfg: function () { querySysCfg: function () {
console.log('querySysCfg: ' + app.deptId); app.displayForm = false;
console.log("woId: " + app.woId); app.displayAuditTrace = false;
var data = JSON.stringify( console.log('querySysCfg: deptId:' + app.deptId + ", cfgId: " + app.cfgId);
{ var url = "/work/sysWoCfg/listByCriteria?deptId=" + app.deptId + "&cfgId=" + app.cfgId;
"woId": app.woId, $.ajax({
"deptId": app.deptId, url: url,
"creator":1, dataType: "json",
"creatorName":'sys', type: 'post',
"deptId": app.addDeptId, contentType: "application/json; charset=utf-8",
"deptName": app.deptNames[app.addDeptId].text, success: function (res) {
"duringTime": parseInt(app.duringTimeMin) + parseInt(app.duringTimeHour * 60), console.log(res);
"remindTime": app.remindTime, if (res.data) {
"assignLimit": parseInt(app.assignLimit), console.log(res.data);
"urgentLevel":app.addUrgentLevel app.sysCfgList = res.data;
} }
);
}
});
}, },
queryAuditTrace: function (sysCfg) { queryAuditTrace: function (sysCfg) {
console.log('queryAuditTrace: ' + sysCfg.id); console.log('queryAuditTrace: ' + sysCfg.id);
app.displayAuditTrace = true; app.displayAuditTrace = true;
app.displayForm = false; app.displayForm = false;
var data = JSON.stringify(
{
"tableName": auditTable,
"fieldValue": sysCfg.id
}
);
var url = "/work/auditTrace/list";
$.ajax({
url: url,
dataType: "json",
data: data,
type: 'post',
contentType: "application/json; charset=utf-8",
success: function (res) {
console.log(res);
app.auditDetails = res.data;
}
});
}, },
addSysCfg: function () { addSysCfg: function () {
app.displayForm = true;
console.log('addSysCfg'); console.log('addSysCfg');
app.displayForm = true;
app.displayAuditTrace = false;
app.operateName = '新增'; 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 () { saveOrUpdateSysCfg: function () {
console.log('saveOrUpdateSysCfg');
if(app.operateName == '新增'){
console.log('saveSysCfg');
console.log("Insert data...");
console.log(data);
var data = JSON.stringify( var data = JSON.stringify(
{ {
"id": app.sysCfgId, "woType": app.addWoType,
"woType": app.woTypeDB[app.addWoType], "creator":1,//处理人id
"creator":1, "creatorName":'admin',//处理人名字
"creatorName":'sys',
"deptId": app.addDeptId, "deptId": app.addDeptId,
"deptName": app.deptNames[app.addDeptId].text, "deptName": app.depts.deptName,
"duringTime": parseInt(app.duringTimeMin) + parseInt(app.duringTimeHour * 60), "duringTime": parseInt(app.duringTimeMin) + parseInt(app.duringTimeHour * 60),
"remindTime": app.remindTime, "remindTime": app.remindTime,
"assignLimit": parseInt(app.assignLimit), "assignLimit": parseInt(app.assignLimit),
"urgentLevel":app.addUrgentLevel "urgentLevel":app.addUrgentLevel
} }
); );
console.log("Request data..."); 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); console.log(data);
var url = "/work/sysWoCfg/saveOrUpdate"; 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({ $.ajax({
url: url, url: url,
dataType: "json", dataType: "json",
...@@ -161,8 +258,22 @@ jQuery(document).ready(function ($) { ...@@ -161,8 +258,22 @@ jQuery(document).ready(function ($) {
success: function (res) { success: function (res) {
console.log(res); console.log(res);
app.displayForm = false; 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; // app.displayForm = true;
} }
} }
......
...@@ -172,7 +172,7 @@ jQuery(document).ready(function ($) { ...@@ -172,7 +172,7 @@ jQuery(document).ready(function ($) {
var data = JSON.stringify( var data = JSON.stringify(
{ {
"woId": woId, "woId": woId,
"processUid": 1 "processUid": 1//当前用户
} }
); );
$.ajax({ $.ajax({
...@@ -190,7 +190,7 @@ jQuery(document).ready(function ($) { ...@@ -190,7 +190,7 @@ jQuery(document).ready(function ($) {
var data = JSON.stringify( var data = JSON.stringify(
{ {
"fieldValue": woId, "fieldValue": woId,
"processUid": 1, "processUid": 1,//当前用户
"tableName":auditTableName "tableName":auditTableName
} }
); );
......
...@@ -152,13 +152,13 @@ ...@@ -152,13 +152,13 @@
<p> <p>
<span>归属部门:</span> <span>归属部门:</span>
<select name="department" v-model="deptId"> <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> </option>
</select> </select>
</p> </p>
<p> <p>
<span>工单ID:</span> <span>工单规则ID:</span>
<input type="text" v-model="woId"> <input type="text" v-model="cfgId">
</p> </p>
<p class="btns"> <p class="btns">
<button type="button" class="btn btn-primary" @click="querySysCfg">查询</button> <button type="button" class="btn btn-primary" @click="querySysCfg">查询</button>
...@@ -172,8 +172,8 @@ ...@@ -172,8 +172,8 @@
<th>归属部门</th> <th>归属部门</th>
<th>工单类型</th> <th>工单类型</th>
<th>紧急程度</th> <th>紧急程度</th>
<th>工单时效</th> <th>工单时效(分)</th>
<th>倒计时</th> <th>倒计时提醒(分)</th>
<th>派发上限</th> <th>派发上限</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
...@@ -183,10 +183,10 @@ ...@@ -183,10 +183,10 @@
<tr v-for="sysCfg in sysCfgList" v-bind:key="sysCfg.id"> <tr v-for="sysCfg in sysCfgList" v-bind:key="sysCfg.id">
<td scope="row">{{sysCfg.id}}</td> <td scope="row">{{sysCfg.id}}</td>
<td>{{sysCfg.deptName}}</td> <td>{{sysCfg.deptName}}</td>
<td>{{sysCfg.woType}}</td> <td>{{sysCfg.woTypeDisplay}}</td>
<td>{{sysCfg.urgentLevel}}</td> <td>{{sysCfg.urgentLevelDisplay}}</td>
<td>{{sysCfg.duringTime}}</td> <td>{{sysCfg.duringTime}}</td>
<td>{{sysCfg.counter}}</td> <td>{{sysCfg.remindTime}}</td>
<td>{{sysCfg.assignLimit}}</td> <td>{{sysCfg.assignLimit}}</td>
<td><a href="#" @click="sysCfgDetail(sysCfg)">编辑</a><a href="#" @click="queryAuditTrace(sysCfg)">操作日志</a></td> <td><a href="#" @click="sysCfgDetail(sysCfg)">编辑</a><a href="#" @click="queryAuditTrace(sysCfg)">操作日志</a></td>
</tr> </tr>
...@@ -204,14 +204,14 @@ ...@@ -204,14 +204,14 @@
<div class="row1"> <div class="row1">
<span>一级部门:</span> <span>一级部门:</span>
<select name="" v-model="addDeptId"> <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> </option>
</select> </select>
</div> </div>
<div class="row2"> <div class="row2">
<span>工单类型:</span> <span>工单类型:</span>
<select name="" v-model="addWoType"> <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> </option>
</select> </select>
</div> </div>
...@@ -255,88 +255,14 @@ ...@@ -255,88 +255,14 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr class="active" v-for="audit in auditDetails" v-bind:key = "audit.id">
<td>陈小钱</td> <td>{{ audit.operatorName }}</td>
<td>2018.12.28 22:22:31</td> <td>{{ audit.operateTime }}</td>
<td>编辑</td> <td>{{ audit.actionType }}</td>
<td>对工单时效进行了操作原值“10”新值“20”</td> <td>{{ audit.actionDetail }}</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> </tr>
</tbody> </tbody>
</table> </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> </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