
15 changed files with 616 additions and 402 deletions
@ -1,294 +0,0 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<button-bar view-title="运维任务模板" :btndisabled="btndisabled" @btnhandle="btnHandle" /> |
|||
<div class="searchcon"> |
|||
<el-button size="small" class="searchbtn" @click="isSearchShow = !isSearchShow">{{ isSearchShow ? '隐藏查询条件' : '显示查询条件' }}</el-button> |
|||
<div v-show="isSearchShow" class="search"> |
|||
<el-form :inline="true" class="tab-header"> |
|||
<el-form-item label="模板名称"><el-input v-model="queryParams.params.templatename" placeholder="请输入模板名称" clearable /></el-form-item> |
|||
<el-form-item label="描述:2-计划检修;3-巡检任务;"><el-input v-model="queryParams.params.ordertype" placeholder="请输入描述:2-计划检修;3-巡检任务;" clearable /></el-form-item> |
|||
<el-form-item label="仓库类型(仓库、门店)"><el-input v-model="queryParams.params.devtype" placeholder="请输入仓库类型(仓库、门店)" clearable /></el-form-item> |
|||
<el-divider /> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" @click="dosearch">查询</el-button> |
|||
<el-button type="primary" @click="resetQuery">重置</el-button> |
|||
</div> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
<!-- Start 项目列表头部 --> |
|||
<div class="listtop"> |
|||
<div class="tit">运维任务模板列表</div> |
|||
<pageye v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current" :limit.sync="queryParams.size" class="pagination" @pagination="loadList" /> |
|||
</div> |
|||
<!-- End 项目列表头部 --> |
|||
|
|||
<!-- Start 项目列表 --> |
|||
<div class="listcon"> |
|||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" @selection-change="handleSelectionChange"> |
|||
<el-table-column width="50px" type="selection" align="center" /> |
|||
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center" /> |
|||
<el-table-column label="SID" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span class="bluezi" @click="toInfo(scope.row)">{{ scope.row.sid }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="templatename" label="模板名称" align="center" /> |
|||
<el-table-column prop="ordertype" label="描述:2-计划检修;3-巡检任务;" align="center" /> |
|||
<el-table-column prop="devtype" label="仓库类型(仓库、门店)" align="center" /> |
|||
</el-table> |
|||
</div> |
|||
<!-- End 项目列表 --> |
|||
<div class="pages"> |
|||
<div class="tit" /> |
|||
<!-- 翻页 --> |
|||
<pagination |
|||
v-show="dataList.length > 0" |
|||
:total="queryParams.total" |
|||
:page.sync="queryParams.current" |
|||
:limit.sync="queryParams.size" |
|||
class="pagination" |
|||
@pagination="loadList" |
|||
/> |
|||
</div> |
|||
</div> |
|||
<!-- End 查询和其列表部分 --> |
|||
|
|||
<!-- 新增修改部分组件 --> |
|||
<div-add v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" /> |
|||
|
|||
<!-- 详情部分组件 --> |
|||
<div-info v-show="viewState == 4" ref="divinfo" @doback="resetState" /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/yxtdispatchcenter/dispatchtemplate' |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import divAdd from './dispatchtemplateAdd' |
|||
import divInfo from './dispatchtemplateInfo' |
|||
|
|||
export default { |
|||
name: 'DispatchTemplateIndex', |
|||
components: { |
|||
ButtonBar, |
|||
Pagination, |
|||
pageye, |
|||
divAdd, |
|||
divInfo |
|||
}, |
|||
data() { |
|||
return { |
|||
btndisabled: false, |
|||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看 |
|||
isSearchShow: true, |
|||
tableLoading: false, |
|||
dataList: [], |
|||
queryParams: { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
sids: [], // 用于导出的时候保存已选择SID |
|||
templatename: '', // 模板名称 |
|||
ordertype: '', // 描述:2-计划检修;3-巡检任务; |
|||
devtype: '' // 仓库类型(仓库、门店) |
|||
} |
|||
}, |
|||
multipleSelection: [] |
|||
} |
|||
}, |
|||
created() { |
|||
this.loadList() |
|||
}, |
|||
methods: { |
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
btnHandle(btnKey) { |
|||
switch (btnKey) { |
|||
case 'toAdd': |
|||
this.toAdd() |
|||
break |
|||
case 'toEdit': |
|||
this.toEdit() |
|||
break |
|||
case 'doSubmit': |
|||
this.doSubmit() |
|||
break |
|||
case 'doDel': |
|||
this.doDel() |
|||
break |
|||
case 'doImport': |
|||
this.doImport() |
|||
break |
|||
case 'doExport': |
|||
this.doExport() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
toAdd(row) { |
|||
this.viewState = 2 |
|||
this.$refs['divadd'].showAdd() |
|||
}, |
|||
toEdit() { |
|||
if (this.multipleSelection.length === 0) { |
|||
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行编辑' }) |
|||
return |
|||
} |
|||
if (this.multipleSelection.length > 1) { |
|||
this.$message({ showClose: true, type: 'error', message: '只能选择一条记录进行编辑' }) |
|||
return |
|||
} |
|||
this.viewState = 3 |
|||
const row = this.multipleSelection[0] |
|||
this.$refs['divadd'].showEdit(row) |
|||
}, |
|||
doSubmit(row) { |
|||
// 提交的代码 |
|||
this.btndisabled = true |
|||
req |
|||
.doSubmit(this.queryParams.params) |
|||
.then(resp => { |
|||
console.log(resp) |
|||
this.btndisabled = false |
|||
if (resp.success) { |
|||
// 加提交后的逻辑 |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
this.btndisabled = false |
|||
}) |
|||
}, |
|||
doDel(row) { |
|||
if (this.multipleSelection.length === 0) { |
|||
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' }) |
|||
return |
|||
} |
|||
const _this = this |
|||
const sids = [] |
|||
this.multipleSelection.forEach(row => { |
|||
sids.push(row.sid) |
|||
}) |
|||
const tip = '请确认是否删除所选 ' + this.multipleSelection.length + ' 条记录?' |
|||
this.$confirm(tip, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}) |
|||
.then(() => { |
|||
const loading = this.$loading({ |
|||
lock: true, |
|||
text: 'Loading', |
|||
spinner: 'el-icon-loading', |
|||
background: 'rgba(0, 0, 0, 0.7)' |
|||
}) |
|||
req |
|||
.delBySids(sids) |
|||
.then(resp => { |
|||
loading.close() |
|||
if (resp.success) { |
|||
_this.$message({ type: 'success', message: resp.msg, showClose: true }) |
|||
_this.loadList() |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
.catch(e => { |
|||
loading.close() |
|||
}) |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
doImport(row) { |
|||
// 导入的代码 |
|||
req |
|||
.importExcel(this.queryParams.params) |
|||
.then(resp => { |
|||
if (resp.success) { |
|||
console.log(resp) |
|||
} |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
doExport(row) { |
|||
// 导出的代码 |
|||
const sids = [] |
|||
this.multipleSelection.forEach(row => { |
|||
sids.push(row.sid) |
|||
}) |
|||
this.queryParams.params.sids = sids |
|||
req |
|||
.exportExcel(this.queryParams.params) |
|||
.then(resp => { |
|||
if (resp.success) { |
|||
var map = resp.data |
|||
const fileName = map.filename // 导出文件名 |
|||
// // 对于<a>标签,只有 Firefox 和 Chrome(内核) 支持 download 属性 |
|||
// // IE10以上支持blob但是依然不支持download |
|||
const link = document.createElement('a') // 创建a标签 |
|||
link.download = fileName // a标签添加属性 |
|||
link.style.display = 'none' |
|||
link.href = map.downurl |
|||
document.body.appendChild(link) |
|||
link.click() // 执行下载 |
|||
URL.revokeObjectURL(link.href) // 释放url |
|||
document.body.removeChild(link) // 释放标签 |
|||
} |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
dosearch() { |
|||
this.queryParams.current = 1 |
|||
this.loadList() |
|||
}, |
|||
resetQuery() { |
|||
this.queryParams.params = {} |
|||
this.queryParams.params.sid = '' // sid |
|||
this.queryParams.params.name = '' // 登录名 |
|||
this.dosearch() |
|||
}, |
|||
loadList() { |
|||
const _this = this |
|||
this.tableLoading = true |
|||
req |
|||
.listPage(this.queryParams) |
|||
.then(resp => { |
|||
_this.tableLoading = false |
|||
if (resp.success) { |
|||
const data = resp.data |
|||
_this.queryParams.total = data.total |
|||
_this.dataList = data.records |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
_this.tableLoading = false |
|||
}) |
|||
}, |
|||
handleSelectionChange(val) { |
|||
this.multipleSelection = val |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
toInfo(row) { |
|||
this.$refs['divinfo'].showInfo(row) |
|||
this.viewState = 4 |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
</style> |
@ -0,0 +1,305 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<button-bar ref="btnbar" view-title="历史报警" :btndisabled="btndisabled" @btnhandle="btnHandle" /> |
|||
<div class="main-content"> |
|||
<div class="searchcon"> |
|||
<el-button size="small" class="searchbtn" @click="isSearchShow = !isSearchShow">{{ isSearchShow ? '隐藏查询条件' : '显示查询条件' }}</el-button> |
|||
<div v-show="isSearchShow" class="search"> |
|||
<el-form ref="queryParams" :model="queryParams.params" :inline="true" class="tab-header"> |
|||
<el-form-item label="客户名称"><el-input v-model="queryParams.params.custname" placeholder="请输入客户名称" clearable /></el-form-item> |
|||
<el-form-item label="工单名称"><el-input v-model="queryParams.params.ordername" placeholder="请输入工单名称" clearable /></el-form-item> |
|||
<el-form-item label="等级"> |
|||
<el-select |
|||
v-model="queryParams.params.orderdegree" |
|||
class="addinputw" |
|||
placeholder="等级" |
|||
size="small" |
|||
> |
|||
<el-option |
|||
v-for="(item, i) in arrList" |
|||
:key="i" |
|||
:label="item.type" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button> |
|||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
|||
</div> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
<!-- Start 项目列表头部 --> |
|||
<div class="listtop"> |
|||
<div class="tit">汇总工单数据列表</div> |
|||
<pageye v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current" :limit.sync="queryParams.size" class="pagination" @pagination="loadList" /> |
|||
</div> |
|||
<!-- End 项目列表头部 --> |
|||
|
|||
<!-- Start 项目列表 --> |
|||
<div> |
|||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" @selection-change="handleSelectionChange"> |
|||
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center" /> |
|||
<el-table-column prop="ordername" label="企业名称" align="center" /> |
|||
<el-table-column prop="custname" label="客户名称" align="center" /> |
|||
<el-table-column prop="orderdegreekey" label="告警说明" width="400px" align="center" /> |
|||
<el-table-column prop="ordertypekey" label="告警等级" align="center" /> |
|||
<el-table-column prop="orderdegree" :formatter="formatorderdegree" label="等级" align="center" /> |
|||
<el-table-column prop="receiveperson" label="现场联系人" align="center" /> |
|||
<el-table-column prop="receivetel" label="现场联系人电话" align="center" /> |
|||
</el-table> |
|||
</div> |
|||
<!-- End 项目列表 --> |
|||
<div class="pages"> |
|||
<div class="tit" /> |
|||
<!-- 翻页 --> |
|||
<pagination |
|||
v-show="dataList.length > 0" |
|||
:total="queryParams.total" |
|||
:page.sync="queryParams.current" |
|||
:limit.sync="queryParams.size" |
|||
class="pagination" |
|||
@pagination="loadList" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- End 查询和其列表部分 --> |
|||
<!-- 新增修改部分组件 --> |
|||
<div-add v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" /> |
|||
|
|||
<!-- 详情部分组件 --> |
|||
<div-info v-show="viewState == 4" ref="divinfo" @doback="resetState" /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/yxtdispatchcenter/dispatchorderinfo' |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import divAdd from './dispatchworkerAdd' |
|||
import divInfo from './dispatchworkerInfo' |
|||
|
|||
export default { |
|||
name: 'DispatchOrderinfoIndex', |
|||
components: { |
|||
ButtonBar, |
|||
Pagination, |
|||
pageye, |
|||
divAdd, |
|||
divInfo |
|||
}, |
|||
data() { |
|||
return { |
|||
btndisabled: false, |
|||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看 |
|||
isSearchShow: false, |
|||
tableLoading: false, |
|||
drawer: false, |
|||
dataList: [], |
|||
formobj:{ |
|||
id: '', |
|||
sid: '', |
|||
custid: '', // 客户ID |
|||
custname: '', // 客户名称 |
|||
supervisesid: '', // 监管公司id |
|||
orderno: '', // 工单编号 |
|||
ordername: '', // 工单名称 |
|||
orderdegree: '', // 描述:1-一般;2-重要; 3-紧急;4-督办。 |
|||
ordertype: '', // 描述:1-计划巡视; |
|||
orderdegreekey: '', |
|||
ordercontent: '', // 工单内容 |
|||
receiveperson: '', // 现场联系人 |
|||
receivetel: '', // 现场联系人电话 |
|||
workers:[] |
|||
}, |
|||
queryParams: { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
sids: [], // 用于导出的时候保存已选择SID |
|||
custid: '', // 客户ID |
|||
custname: '', // 客户名称 |
|||
orderno: '', // 工单编号 |
|||
ordername: '', // 工单名称 |
|||
orderdegree: '', // 描述:1-一般;2-重要; 3-紧急;4-督办。 |
|||
} |
|||
}, |
|||
arr:[{value:1,type:'计划巡视'},{value:2,type:'专项巡视'},{value:3,type:'告警巡视'}], |
|||
arrList:[{value:1,type:'一般'},{value:2,type:'重要'},{value:3,type:'紧急'},{value:4,type:'督办'}], |
|||
multipleSelection: [], |
|||
} |
|||
}, |
|||
mounted() { |
|||
// 初始化按钮 |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
}, |
|||
created() { |
|||
this.loadList() |
|||
}, |
|||
methods: { |
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
btnHandle(btnKey) { |
|||
switch (btnKey) { |
|||
case 'toAdd': |
|||
this.toAdd() |
|||
break |
|||
case 'doClose': // 关闭 |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
toAdd() { |
|||
// this.viewState = 2 |
|||
// this.$refs['divadd'].showAdd() |
|||
this.drawer=true |
|||
|
|||
}, |
|||
toEdit(row) { |
|||
this.viewState = 3 |
|||
this.$refs['divadd'].showEdit(row) |
|||
}, |
|||
doSubmit(row) { |
|||
// 提交的代码 |
|||
this.btndisabled = true |
|||
req |
|||
.doSubmit(this.queryParams.params) |
|||
.then(resp => { |
|||
console.log(resp) |
|||
this.btndisabled = false |
|||
if (resp.success) { |
|||
// 加提交后的逻辑 |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
this.btndisabled = false |
|||
}) |
|||
}, |
|||
saveOrUpdate() { |
|||
req.saveOrUpdate(this.formobj).then(resp => { |
|||
if (resp.success) { |
|||
this.$message({ showClose: true, type: 'success', message: resp.msg }) |
|||
this.drawer=false |
|||
this.formobj={ |
|||
id: '', |
|||
sid: '', |
|||
custid: '', // 客户ID |
|||
custname: '', // 客户名称 |
|||
supervisesid: '', // 监管公司id |
|||
orderno: '', // 工单编号 |
|||
ordername: '', // 工单名称 |
|||
orderdegree: '', // 描述:1-一般;2-重要; 3-紧急;4-督办。 |
|||
ordertype: '', // 描述:1-计划巡视; |
|||
orderdegreekey: '', |
|||
ordercontent: '', // 工单内容 |
|||
receiveperson: '', // 现场联系人 |
|||
receivetel: '', // 现场联系人电话 |
|||
workers:[]} |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
}, |
|||
doDel(row) { |
|||
const sids = [] |
|||
sids.push(row.sid) |
|||
const tip = '请确认是否是否删除该条记录?' |
|||
this.$confirm(tip, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}) |
|||
.then(() => { |
|||
req |
|||
.delBySids(sids) |
|||
.then(resp => { |
|||
if (resp.success) { |
|||
this.$message({ type: 'success', message: resp.msg, showClose: true }) |
|||
this.loadList() |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
}) |
|||
.catch(() => {}) |
|||
}, |
|||
dosearch() { |
|||
this.queryParams.current = 1 |
|||
this.loadList() |
|||
}, |
|||
resetQuery() { |
|||
this.queryParams.params = {} |
|||
this.queryParams.params.sid = '' // sid |
|||
this.queryParams.params.name = '' // 登录名 |
|||
this.dosearch() |
|||
}, |
|||
loadList() { |
|||
const _this = this |
|||
this.tableLoading = true |
|||
req |
|||
.listPage(this.queryParams) |
|||
.then(resp => { |
|||
_this.tableLoading = false |
|||
if (resp.success) { |
|||
const data = resp.data |
|||
_this.queryParams.total = data.total |
|||
_this.dataList = data.records |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
_this.tableLoading = false |
|||
}) |
|||
}, |
|||
handleSelectionChange(val) { |
|||
this.multipleSelection = val |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
toInfo(row) { |
|||
this.$refs['divinfo'].showInfo(row) |
|||
this.viewState = 4 |
|||
}, |
|||
doClose() { |
|||
this.$store.dispatch('tagsView/delView', this.$route) |
|||
this.$router.go(-1) |
|||
}, |
|||
formatorderdegree: function( row, column) { |
|||
if(row.orderdegree === '1'){ |
|||
return '一般' |
|||
} else if(row.orderdegree === '2') { |
|||
return '重要' |
|||
} else if (row.orderdegree === '3') { |
|||
return '紧急' |
|||
} else if(row.orderdegree === '4'){ |
|||
return '督办' |
|||
}else{ |
|||
return '' |
|||
} |
|||
}, |
|||
purchase(row){ |
|||
this.drawer=true |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
.item { |
|||
margin: 6px; |
|||
} |
|||
</style> |
Loading…
Reference in new issue