增加维修
This commit is contained in:
parent
923a5f718d
commit
11ef53e9e9
@ -61,6 +61,29 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
repair:{
|
||||||
|
list:{
|
||||||
|
url: `${config.API_URL}/repair.order.list`,
|
||||||
|
name: "维修工单列表",
|
||||||
|
get: async function (params) {
|
||||||
|
return await http.post(this.url, params);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
confirm:{
|
||||||
|
url: `${config.API_URL}/repair.order.confirm`,
|
||||||
|
name: "维修工单确认",
|
||||||
|
post: async function (params) {
|
||||||
|
return await http.post(this.url, params);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
submit:{
|
||||||
|
url: `${config.API_URL}/repair.order.submit`,
|
||||||
|
name: "提交维修工单",
|
||||||
|
post: async function (params) {
|
||||||
|
return await http.post(this.url, params);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
maintenance:{
|
maintenance:{
|
||||||
list:{
|
list:{
|
||||||
url: `${config.API_URL}/maintenance.order.list`,
|
url: `${config.API_URL}/maintenance.order.list`,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="bottom-start"
|
placement="bottom"
|
||||||
title=""
|
title=""
|
||||||
trigger="click"
|
trigger="click"
|
||||||
content=""
|
content=""
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<span class="item part">部分确认</span>
|
<span class="item part">部分确认</span>
|
||||||
</span>
|
</span>
|
||||||
<emailSync @updateSync="refreshDom" :show="refreshShow" :text="syncText">
|
<emailSync @updateSync="refreshDom" :show="refreshShow" :text="syncText">
|
||||||
<span class="refreshEmail" @click="manualClick"><el-icon size="16px"><sc-icon-Refresh/></el-icon></span>
|
<span class="refreshEmail" @click="manualClick"><el-icon size="16px" :class="refreshShow?'refreshEmailIcon':''"><sc-icon-Refresh/></el-icon></span>
|
||||||
</emailSync>
|
</emailSync>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main class="nopadding" v-loading="listLoading" element-loading-text="加载中...">
|
<el-main class="nopadding" v-loading="listLoading" element-loading-text="加载中...">
|
||||||
@ -390,13 +390,17 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async manualClick() {
|
async manualClick() {
|
||||||
await this.$API.orders.order.mail.manual.post();
|
const res = await this.$API.orders.order.mail.manual.post();
|
||||||
|
if(res.code == 200){
|
||||||
|
this.$message.success('开始检查是否有需要同步的邮件');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
refreshDom(params){
|
refreshDom(params){
|
||||||
if(params.type == 16){
|
if(params.type == 16){
|
||||||
this.refreshShow = params.current == params.limit?false:true
|
this.refreshShow = params.current == params.limit?false:true;
|
||||||
this.syncText = params.msg;
|
this.syncText = params.msg;
|
||||||
if(params.status == 1){
|
if(params.status == 1){
|
||||||
|
this.$message.success('您已成功同步邮件');
|
||||||
this.getData();
|
this.getData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -563,6 +567,17 @@ export default {
|
|||||||
display: flex;align-items: center;color: var(--el-color-primary);
|
display: flex;align-items: center;color: var(--el-color-primary);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.refreshEmailIcon{
|
||||||
|
animation: rotate 0.6s infinite linear;
|
||||||
|
}
|
||||||
|
@keyframes rotate {
|
||||||
|
from {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
.refreshBox{
|
.refreshBox{
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
293
src/views/order/repairList/index.vue
Normal file
293
src/views/order/repairList/index.vue
Normal file
@ -0,0 +1,293 @@
|
|||||||
|
<template>
|
||||||
|
<el-container class="mainBox mainHeaderNoBorderPadding">
|
||||||
|
<el-header>
|
||||||
|
<div class="left-panel">
|
||||||
|
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button>
|
||||||
|
<scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess">
|
||||||
|
<template #header>
|
||||||
|
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||||
|
</template>
|
||||||
|
<template #download>
|
||||||
|
<div v-auth="'companyImportTemplate'" @click="importTemplate">下载导入模版</div>
|
||||||
|
</template>
|
||||||
|
</scImport>
|
||||||
|
</div>
|
||||||
|
<div class="right-panel">
|
||||||
|
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="11">
|
||||||
|
<el-button :size="size" icon="sc-icon-Download" @click="exportData">下载</el-button>
|
||||||
|
</scExport>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main class="nopadding">
|
||||||
|
<div class="searchMain searchMainNoTop">
|
||||||
|
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
|
||||||
|
|
||||||
|
<div class="searchItem searchBtn">
|
||||||
|
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
|
||||||
|
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
|
||||||
|
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe :size="size" @selection-change="selectionChange">
|
||||||
|
<el-table-column type="selection" align="center" width="40"></el-table-column>
|
||||||
|
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||||
|
<template #logo="scope">
|
||||||
|
<el-image class="logoCell" :src="scope.row.logo" preview-teleported :preview-src-list="[scope.row.logo]" fit="contain">
|
||||||
|
<template #error>
|
||||||
|
<div class="image-slot" style="text-align: center;font-size: 20px;">
|
||||||
|
<el-icon><el-icon-Picture /></el-icon>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-image>
|
||||||
|
</template>
|
||||||
|
<template #repair_status="scope">
|
||||||
|
<el-switch :size="size" v-model="scope.row.active_status" @change="changeSwitch($event, scope.row)" :loading="scope.row.$switch_status" :active-value="true" :inactive-value="false"></el-switch>
|
||||||
|
</template>
|
||||||
|
<el-table-column label="操作" fixed="right" align="center" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-dropdown>
|
||||||
|
<el-button class="noBorderBtn" icon="el-icon-more" :size="size"></el-button>
|
||||||
|
<template #dropdown>
|
||||||
|
<el-dropdown-menu>
|
||||||
|
<el-dropdown-item @click="table_show(scope.row, 'see')" icon="sc-icon-See">查看详情</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click="table_edit(scope.row, 'edit')" icon="sc-icon-Edit">编辑公司</el-dropdown-item>
|
||||||
|
<el-dropdown-item icon="sc-icon-AbilityAuthorization" @click="table_empower(scope.row)" divided>功能授权</el-dropdown-item>
|
||||||
|
<el-dropdown-item icon="sc-icon-DataAuthorization">数据授权</el-dropdown-item>
|
||||||
|
<el-dropdown-item icon="sc-icon-UserList" @click="table_user_ist(scope.row)" divided>用户列表</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click="table_del(scope.row, 'delete')" icon="sc-icon-Delete">删除公司</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
|
||||||
|
<!-- <save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>-->
|
||||||
|
<!-- <see-dialog v-if="dialog.show" ref="showDialog" @closed="dialog.show=false"></see-dialog>-->
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import saveDialog from './save'
|
||||||
|
// import seeDialog from './see'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
// saveDialog,
|
||||||
|
// seeDialog,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
size:'small',
|
||||||
|
dialog: {
|
||||||
|
save: false,
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
apiObj: this.$API.orders.order.repair.list,
|
||||||
|
column: [],
|
||||||
|
},
|
||||||
|
selection: [],
|
||||||
|
exportShow:false,
|
||||||
|
searchShow:false,
|
||||||
|
searchList:[
|
||||||
|
{name:'创建日期',type:'date',code:'activation_date'},
|
||||||
|
{name:'维修单号',type:'text',code:'repair_order_no', data:[], placeholder:"请输入维修单号",show:true},
|
||||||
|
{name:'故障类型',type:'select',code:'fault_type', data:[], placeholder:"请选择故障类型",show:true},
|
||||||
|
{name:'状态',type:'select',code:'repair_status', data:[], placeholder:"请选择状态",show:true},
|
||||||
|
{name:'故障描述',type:'text',code:['fault_description'],placeholder:"请输故障描述",isOpen:true,show:false},
|
||||||
|
{name:'整机SN',type:'text',code:['device_sn'],placeholder:"请输入整机SN",isOpen:true,show:false},
|
||||||
|
{name:'关键字',type:'text',code:['fault_description','device_sn'],keyword:true,show:true},
|
||||||
|
],
|
||||||
|
params: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
searchShowClick(){
|
||||||
|
this.searchShow = !this.searchShow;
|
||||||
|
this.searchList.forEach(item=>{
|
||||||
|
if(item.isOpen){
|
||||||
|
item.show = this.searchShow
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getSelectData(item){
|
||||||
|
let {data,params} = item;
|
||||||
|
this.params = params;
|
||||||
|
if(data.code == "id"){
|
||||||
|
this.getCompanyList(data,params)
|
||||||
|
}else if(data.code == "active_status"){
|
||||||
|
this.getStatusList(data,params);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async getCompanyList(data,params) {
|
||||||
|
const res = await this.$API.system.company.select.post(params);
|
||||||
|
if(res.data && res.data.length>0){
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
item.label = item.full_name;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(res.code == 200){
|
||||||
|
this.searchList.forEach(item=>{
|
||||||
|
if(item.code == data.code){
|
||||||
|
item.data = res.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getStatusList(data,params) {
|
||||||
|
const res = await this.$API.oss.status.post(params);
|
||||||
|
if(res.code == 200){
|
||||||
|
this.searchList.forEach(item=>{
|
||||||
|
if(item.code == data.code){
|
||||||
|
item.data = res.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//添加
|
||||||
|
add(){
|
||||||
|
this.dialog.save = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 批量导入
|
||||||
|
importFile(){
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$refs.scImport.importFile();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async importTemplate() {
|
||||||
|
const res = await this.$API.orders.order.maintenance.template.post();
|
||||||
|
const blob = new Blob([res]);
|
||||||
|
const text = new Date().getTime();
|
||||||
|
const eLink = document.createElement('a');
|
||||||
|
eLink.download = "维保导入模版_"+text+'.xlsx';
|
||||||
|
eLink.style.display = 'none';
|
||||||
|
eLink.href = URL.createObjectURL(blob);
|
||||||
|
document.body.appendChild(eLink);
|
||||||
|
eLink.click();
|
||||||
|
URL.revokeObjectURL(eLink.href);
|
||||||
|
document.body.removeChild(eLink);
|
||||||
|
},
|
||||||
|
async importUpload(params) {
|
||||||
|
const res = await this.$API.orders.order.maintenance.import.post(params);
|
||||||
|
if(res.code == 200){
|
||||||
|
this.$message.success('上传成功,开始导入数据');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
importSuccess(){
|
||||||
|
this.$refs.table.refresh()
|
||||||
|
},
|
||||||
|
|
||||||
|
//编辑
|
||||||
|
table_edit(row){
|
||||||
|
this.dialog.save = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open('edit').setData(row)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//查看
|
||||||
|
table_show(row){
|
||||||
|
this.dialog.show = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.showDialog.open('show').setData(row);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//删除
|
||||||
|
async table_del(row){
|
||||||
|
this.$confirm(`确定删除 ${row.name} 吗?`, '提示', {
|
||||||
|
type: 'warning'
|
||||||
|
}).then(async () => {
|
||||||
|
const reqData = {id: row.id};
|
||||||
|
const res = await this.$API.system.company.delete.post(reqData);
|
||||||
|
if(res.code == 200){
|
||||||
|
this.$refs.table.refresh()
|
||||||
|
this.$message.success("删除成功")
|
||||||
|
}else{
|
||||||
|
await this.$alert(res.message, "提示", {type: 'error'})
|
||||||
|
}
|
||||||
|
}).catch(()=>{})
|
||||||
|
},
|
||||||
|
// 功能授权
|
||||||
|
table_empower(row){
|
||||||
|
this.$router.push({
|
||||||
|
path: '/setting/company/add-permission',
|
||||||
|
query: {
|
||||||
|
id: row.id,
|
||||||
|
name:row.name
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 公司用户列表
|
||||||
|
table_user_ist(row){
|
||||||
|
this.$router.push({
|
||||||
|
path: '/setting/user/company-user-list',
|
||||||
|
query: {
|
||||||
|
id: row.id,
|
||||||
|
name:row.name
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//表格选择后回调事件
|
||||||
|
selectionChange(selection){
|
||||||
|
this.selection = selection;
|
||||||
|
},
|
||||||
|
// 状态
|
||||||
|
changeSwitch(val, row) {
|
||||||
|
row.$switch_yx = true;
|
||||||
|
setTimeout(async () => {
|
||||||
|
let params = {
|
||||||
|
id: row.id,
|
||||||
|
status: row.active_status,
|
||||||
|
};
|
||||||
|
const res = await this.$API.system.company.status.post(params);
|
||||||
|
if(res.code !=200){
|
||||||
|
row.active_status = !row.active_status;
|
||||||
|
}
|
||||||
|
delete row.$switch_status;
|
||||||
|
delete row.$switch_yx;
|
||||||
|
}, 500);
|
||||||
|
},
|
||||||
|
// 下载导出
|
||||||
|
exportChangeShow(params){
|
||||||
|
if(params.type == 11){
|
||||||
|
this.exportShow = params.status==0?true:false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async exportData() {
|
||||||
|
if(this.exportShow) return
|
||||||
|
const res = await this.$API.orders.order.maintenance.export.post(this.params);
|
||||||
|
if(res.code == 200){
|
||||||
|
this.$message.success('开始导出');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
upSearch(){
|
||||||
|
this.$refs.table.upData(this.params);
|
||||||
|
},
|
||||||
|
reset(){
|
||||||
|
this.params = {};
|
||||||
|
this.$refs.scSearch.reload();
|
||||||
|
this.$refs.table.reload();
|
||||||
|
},
|
||||||
|
handleSaveSuccess(){
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.logoCell{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 20px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user