增加缺失页面完善列表
This commit is contained in:
parent
11ef53e9e9
commit
2e4ffe7b48
@ -114,54 +114,23 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
sock: {
|
||||
list:{
|
||||
url: `${config.API_URL}/order.list`,
|
||||
name: "获取加工单列表",
|
||||
url: `${config.API_URL}/inventory.list`,
|
||||
name: "库存列表",
|
||||
get: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
}
|
||||
},
|
||||
add: {
|
||||
url: `${config.API_URL}/order.add`,
|
||||
name: "获取加工单添加",
|
||||
post: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
},
|
||||
delete: {
|
||||
url: `${config.API_URL}/order.delete`,
|
||||
name: "获取加工单删除",
|
||||
post: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
},
|
||||
cancel:{
|
||||
url: `${config.API_URL}/order.cancel`,
|
||||
name: "加工单撤回",
|
||||
post: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
},
|
||||
info:{
|
||||
url: `${config.API_URL}/order.info`,
|
||||
name: "加工单详情",
|
||||
post: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
},
|
||||
review: {
|
||||
url: `${config.API_URL}/order.review`,
|
||||
name: "加工单审核",
|
||||
post: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
},
|
||||
active: {
|
||||
url: `${config.API_URL}/order.active.list`,
|
||||
name: "已排期工单",
|
||||
out:{
|
||||
list:{
|
||||
url: `${config.API_URL}/out.stock.list`,
|
||||
name: "销售出库清单列表",
|
||||
get: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
14
src/api/model/shipment.js
Normal file
14
src/api/model/shipment.js
Normal file
@ -0,0 +1,14 @@
|
||||
import config from "@/config";
|
||||
import http from "@/utils/request";
|
||||
|
||||
export default {
|
||||
out:{
|
||||
list:{
|
||||
url: `${config.API_URL}/out.stock.list`,
|
||||
name: "销售出库清单列表",
|
||||
get: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
13
src/assets/icons/OrderConfirm.vue
Normal file
13
src/assets/icons/OrderConfirm.vue
Normal file
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<svg t="1724068831567" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4471" width="200" height="200"><path d="M384 896H159.971556a96.142222 96.142222 0 0 1-95.971556-96.028444V160.028444c0-52.906667 43.121778-95.971556 96.028444-95.971555h512c52.906667 0 95.971556 43.121778 95.971556 96.028444v191.943111a31.971556 31.971556 0 1 1-64 0V160.028444a32.085333 32.085333 0 0 0-32.028444-31.971555h-512a32.085333 32.085333 0 0 0-31.971556 32.028444v640c0 17.578667 14.392889 31.971556 32.028444 31.971556H384a31.971556 31.971556 0 1 1 0 64z" p-id="4472"></path><path d="M688.014222 960a269.880889 269.880889 0 0 1-192.284444-79.701333 269.824 269.824 0 0 1-79.758222-192.284445c0-72.704 28.330667-141.027556 79.701333-192.284444a269.880889 269.880889 0 0 1 192.284444-79.758222c72.760889 0 141.084444 28.330667 192.341334 79.701333a270.222222 270.222222 0 0 1 79.701333 192.284444 270.051556 270.051556 0 0 1-79.701333 192.341334 270.449778 270.449778 0 0 1-192.284445 79.701333z m0-480.028444a208.213333 208.213333 0 0 0-207.985778 208.042666 208.213333 208.213333 0 0 0 207.985778 207.985778 208.213333 208.213333 0 0 0 207.985778-207.985778 208.213333 208.213333 0 0 0-207.985778-207.985778z" p-id="4473"></path><path d="M800.028444 768h-128a31.971556 31.971556 0 0 1-32.028444-32.028444v-159.971556a31.971556 31.971556 0 1 1 64 0v128h96.028444a31.971556 31.971556 0 1 1 0 64zM608.028444 320h-384a31.971556 31.971556 0 1 1 0-64h384a31.971556 31.971556 0 1 1 0 64zM384 512H223.971556a31.971556 31.971556 0 1 1 0-64H384A31.971556 31.971556 0 1 1 384 512zM320 704H223.971556a31.971556 31.971556 0 1 1 0-64h96.028444a31.971556 31.971556 0 1 1 0 64z" p-id="4474"></path></svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "OrderConfirm"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
13
src/assets/icons/OrderLog.vue
Normal file
13
src/assets/icons/OrderLog.vue
Normal file
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<svg t="1724068865865" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4757" width="200" height="200"><path d="M897.251556 170.666667h-750.933334c-28.16 0-51.2 23.04-51.2 51.2v665.6c0 28.16 23.04 51.2 51.2 51.2h750.933334c28.16 0 51.2-23.04 51.2-51.2V221.866667c0-28.16-22.641778-51.2-51.2-51.2z m-17.066667 699.733333h-716.8V238.933333h716.8v631.466667z" p-id="4758"></path><path d="M744.96 699.733333H333.255111a32.881778 32.881778 0 0 1-32.824889-32.881777v-2.104889c0-18.318222 14.904889-32.881778 32.824889-32.881778h411.704889c18.375111 0 32.881778 14.961778 32.881778 32.881778v2.104889a32.881778 32.881778 0 0 1-32.881778 32.881777z m-1.251556-153.6h-221.866666c-18.773333 0-34.133333-15.36-34.133334-34.133333 0-18.773333 15.36-34.133333 34.133334-34.133333h221.866666c18.773333 0 34.133333 15.36 34.133334 34.133333 0 18.773333-14.904889 34.133333-34.133334 34.133333z m-25.6-238.933333c-18.773333 0-34.133333-15.36-34.133333-34.133333V119.466667c0-18.773333 15.36-34.133333 34.133333-34.133334 18.773333 0 34.133333 15.36 34.133334 34.133334v153.6c0 18.773333-14.961778 34.133333-34.133334 34.133333z m-392.533333 0c-18.773333 0-34.133333-15.36-34.133333-34.133333V119.466667c0-18.773333 15.36-34.133333 34.133333-34.133334 18.773333 0 34.133333 15.36 34.133333 34.133334v153.6c0 18.773333-14.904889 34.133333-34.133333 34.133333z" p-id="4759"></path></svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "OrderLog"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
13
src/assets/icons/OrderSee.vue
Normal file
13
src/assets/icons/OrderSee.vue
Normal file
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<svg t="1724068794052" class="icon" viewBox="0 0 1080 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4327" width="200" height="200"><path d="M437.76 750.023111a312.661333 312.661333 0 0 1-312.32-312.32 312.661333 312.661333 0 0 1 312.32-312.263111 312.661333 312.661333 0 0 1 312.263111 312.32 312.661333 312.661333 0 0 1-312.32 312.32z m519.338667 158.549333l-226.986667-226.929777a380.871111 380.871111 0 1 0-48.526222 48.469333l226.986666 226.986667a34.360889 34.360889 0 0 0 48.469334-48.526223" p-id="4328"></path><path d="M601.201778 477.752889H292.920889c-20.081778 0-36.465778-15.36-36.465778-34.247111 0-18.944 16.384-34.304 36.465778-34.304h308.280889c20.138667 0 36.522667 15.36 36.522666 34.304 0 18.944-16.384 34.247111-36.579555 34.247111z" p-id="4329"></path><path d="M446.976 634.083556c-18.944 0-34.247111-16.384-34.247111-36.522667V289.450667c0-20.138667 15.36-36.522667 34.247111-36.522667 18.944 0 34.304 16.384 34.304 36.522667v308.110222c0 20.138667-15.36 36.522667-34.304 36.522667z" p-id="4330"></path></svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "OrderSee"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
13
src/assets/icons/OrderSetup.vue
Normal file
13
src/assets/icons/OrderSetup.vue
Normal file
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<svg t="1724068857392" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4615" width="200" height="200"><path d="M196.266667 951.466667c-34.133333 0-64-12.8-85.333334-34.133334s-34.133333-55.466667-34.133333-85.333333 12.8-64 34.133333-85.333333l281.6-281.6c-21.333333-51.2-25.6-102.4-12.8-153.6 8.533333-59.733333 38.4-110.933333 81.066667-153.6 42.666667-42.666667 93.866667-68.266667 153.6-81.066667 59.733333-8.533333 115.2-4.266667 170.666667 21.333333 8.533333 4.266667 17.066667 12.8 17.066666 21.333334s0 21.333333-8.533333 29.866666l-162.133333 162.133334s-4.266667 4.266667-4.266667 8.533333 0 4.266667 4.266667 8.533333l68.266666 68.266667c4.266667 4.266667 8.533333 4.266667 12.8 0l162.133334-162.133333c8.533333-8.533333 17.066667-12.8 29.866666-8.533334 8.533333 0 17.066667 8.533333 21.333334 17.066667 25.6 55.466667 29.866667 110.933333 21.333333 170.666667-8.533333 59.733333-38.4 110.933333-81.066667 153.6-42.666667 42.666667-93.866667 68.266667-153.6 81.066666-51.2 8.533333-102.4 4.266667-149.333333-12.8l-281.6 281.6c-21.333333 21.333333-51.2 34.133333-85.333333 34.133334zM661.333333 136.533333c-12.8 0-25.6 0-38.4 4.266667-46.933333 8.533333-85.333333 29.866667-119.466666 64-34.133333 34.133333-55.466667 72.533333-64 119.466667-8.533333 46.933333-4.266667 89.6 17.066666 132.266666 4.266667 12.8 4.266667 25.6-8.533333 34.133334L153.6 785.066667c-12.8 12.8-17.066667 25.6-17.066667 42.666666s4.266667 29.866667 17.066667 42.666667c21.333333 21.333333 59.733333 21.333333 81.066667 0L529.066667 576c8.533333-8.533333 25.6-12.8 34.133333-8.533333 42.666667 17.066667 89.6 25.6 132.266667 17.066666 46.933333-8.533333 85.333333-29.866667 119.466666-64 34.133333-34.133333 55.466667-72.533333 64-119.466666a285.639111 285.639111 0 0 0 0-85.333334l-123.733333 123.733334c-29.866667 29.866667-76.8 25.6-106.666667 0l-68.266666-68.266667a78.734222 78.734222 0 0 1-21.333334-51.2c0-17.066667 8.533333-38.4 21.333334-51.2l123.733333-123.733333c-12.8-4.266667-25.6-8.533333-42.666667-8.533334z" p-id="4616"></path></svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "OrderSetup"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -62,6 +62,10 @@ export { default as AbilityAuthorization } from './AbilityAuthorization.vue'
|
||||
export { default as DataAuthorization } from './DataAuthorization.vue'
|
||||
export { default as UserList } from './UserList.vue'
|
||||
export { default as ShareBtn } from './ShareBtn.vue'
|
||||
export { default as OrderSee } from './OrderSee.vue'
|
||||
export { default as OrderConfirm } from './OrderConfirm.vue'
|
||||
export { default as OrderLog } from './OrderLog.vue'
|
||||
export { default as OrderSetup } from './OrderSetup.vue'
|
||||
|
||||
|
||||
export { default as Home } from './menu/Home.vue'
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
<script>
|
||||
import Sortable from 'sortablejs'
|
||||
|
||||
import {eventBus} from "@/utils/eventBus"
|
||||
export default {
|
||||
name: "tags",
|
||||
data() {
|
||||
@ -79,17 +79,23 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var menu = this.$router.sc_getMenu()
|
||||
var dashboardRoute = this.treeFind(menu, node => node.path==this.$CONFIG.DASHBOARD_URL)
|
||||
const menu = this.$router.sc_getMenu();
|
||||
const dashboardRoute = this.treeFind(menu, node => node.path == this.$CONFIG.DASHBOARD_URL);
|
||||
if(dashboardRoute){
|
||||
dashboardRoute.fullPath = dashboardRoute.path
|
||||
dashboardRoute.fullPath = dashboardRoute.path;
|
||||
this.addViewTags(dashboardRoute)
|
||||
this.addViewTags(this.$route)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 获取新消息
|
||||
eventBus.$on('tagClose', this.clickTagClose);
|
||||
|
||||
this.tagDrop();
|
||||
this.scrollInit()
|
||||
this.scrollInit();
|
||||
},
|
||||
unmounted() {
|
||||
eventBus.$off('tagClose', this.clickTagClose);
|
||||
},
|
||||
methods: {
|
||||
//查找树
|
||||
@ -182,15 +188,38 @@
|
||||
},
|
||||
//TAB 关闭
|
||||
closeTabs(){
|
||||
var nowTag = this.contextMenuItem;
|
||||
const nowTag = this.contextMenuItem;
|
||||
if(!nowTag.meta.affix){
|
||||
this.closeSelectedTag(nowTag)
|
||||
this.contextMenuVisible = false
|
||||
}
|
||||
},
|
||||
// 查看详情的类型
|
||||
clickTagClose(fullPath,params){
|
||||
const tags = [...this.tagList];
|
||||
const tagsData = tags.map(item=> {
|
||||
const end = item.fullPath.indexOf('?');
|
||||
return item.fullPath.slice(0,end);
|
||||
});
|
||||
if(tagsData.indexOf(fullPath) !=-1){
|
||||
tags.forEach((tag,index)=>{
|
||||
const end = tag.fullPath.indexOf('?');
|
||||
if(fullPath == tag.fullPath.slice(0,end)){
|
||||
tagsData.splice(index,1);
|
||||
this.closeSelectedTag(tag);
|
||||
}
|
||||
})
|
||||
}
|
||||
if(tagsData.indexOf(fullPath) ==-1){
|
||||
this.$router.push({
|
||||
path: fullPath,
|
||||
query: params
|
||||
})
|
||||
}
|
||||
},
|
||||
//TAB 关闭其他
|
||||
closeOtherTabs(){
|
||||
var nowTag = this.contextMenuItem;
|
||||
const nowTag = this.contextMenuItem;
|
||||
//判断是否当前路由,否的话跳转
|
||||
if(this.$route.fullPath != nowTag.fullPath){
|
||||
this.$router.push({
|
||||
@ -198,7 +227,7 @@
|
||||
query: nowTag.query
|
||||
})
|
||||
}
|
||||
var tags = [...this.tagList];
|
||||
const tags = [...this.tagList];
|
||||
tags.forEach(tag => {
|
||||
if(tag.meta && tag.meta.affix || nowTag.fullPath == tag.fullPath){
|
||||
return true
|
||||
|
||||
290
src/views/cost/shipmentStatistics/index.vue
Normal file
290
src/views/cost/shipmentStatistics/index.vue
Normal file
@ -0,0 +1,290 @@
|
||||
<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 #active_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>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
size:'small',
|
||||
dialog: {
|
||||
save: false,
|
||||
show: false,
|
||||
},
|
||||
list: {
|
||||
apiObj: {},
|
||||
column: [],
|
||||
},
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'生产日期',type:'date',code:'activation_date'},
|
||||
{name:'反厂日期',type:'date',code:'activation_date'},
|
||||
{name:'处理时间',type:'date',code:'activation_date'},
|
||||
{name:'客户名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:false},
|
||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",show:false},
|
||||
{name:'工单号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
|
||||
{name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false},
|
||||
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
|
||||
{name:'负责人',type:'text',code:['owner'],placeholder:"请输入负责人",isOpen:true,show:false},
|
||||
{name:'关键字',type:'text',code:['domain','name'],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>
|
||||
290
src/views/finance/feesStatistics/index.vue
Normal file
290
src/views/finance/feesStatistics/index.vue
Normal file
@ -0,0 +1,290 @@
|
||||
<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 #active_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>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
size:'small',
|
||||
dialog: {
|
||||
save: false,
|
||||
show: false,
|
||||
},
|
||||
list: {
|
||||
apiObj: {},
|
||||
column: [],
|
||||
},
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'生产日期',type:'date',code:'activation_date'},
|
||||
{name:'反厂日期',type:'date',code:'activation_date'},
|
||||
{name:'处理时间',type:'date',code:'activation_date'},
|
||||
{name:'客户名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:false},
|
||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",show:false},
|
||||
{name:'工单号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
|
||||
{name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false},
|
||||
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
|
||||
{name:'负责人',type:'text',code:['owner'],placeholder:"请输入负责人",isOpen:true,show:false},
|
||||
{name:'关键字',type:'text',code:['domain','name'],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>
|
||||
290
src/views/inventory/inoutRecord/index.vue
Normal file
290
src/views/inventory/inoutRecord/index.vue
Normal file
@ -0,0 +1,290 @@
|
||||
<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 #active_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>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
size:'small',
|
||||
dialog: {
|
||||
save: false,
|
||||
show: false,
|
||||
},
|
||||
list: {
|
||||
apiObj: {},
|
||||
column: [],
|
||||
},
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'生产日期',type:'date',code:'activation_date'},
|
||||
{name:'反厂日期',type:'date',code:'activation_date'},
|
||||
{name:'处理时间',type:'date',code:'activation_date'},
|
||||
{name:'客户名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:false},
|
||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",show:false},
|
||||
{name:'工单号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
|
||||
{name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false},
|
||||
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
|
||||
{name:'负责人',type:'text',code:['owner'],placeholder:"请输入负责人",isOpen:true,show:false},
|
||||
{name:'关键字',type:'text',code:['domain','name'],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>
|
||||
@ -170,6 +170,7 @@
|
||||
import columnSetting from '@/components/scTable/columnSetting'
|
||||
import emailSync from './emailSync'
|
||||
import config from "@/config/table";
|
||||
import {eventBus} from "@/utils/eventBus"
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -397,21 +398,16 @@ export default {
|
||||
},
|
||||
refreshDom(params){
|
||||
if(params.type == 16){
|
||||
this.refreshShow = params.current == params.limit?false:true;
|
||||
this.refreshShow = params.current != params.limit && params.status ==0?true:false;
|
||||
this.syncText = params.msg;
|
||||
if(params.status == 1){
|
||||
this.$message.success('您已成功同步邮件');
|
||||
this.$message.success(params.msg);
|
||||
this.getData();
|
||||
}
|
||||
}
|
||||
},
|
||||
seeEmail(){
|
||||
this.$router.push({
|
||||
path: '/order/view-mail',
|
||||
query: {
|
||||
id: this.emailId,
|
||||
}
|
||||
})
|
||||
eventBus.$emit('tagClose','/order/view-mail',{id:this.emailId});
|
||||
},
|
||||
|
||||
async getSelectData(item) {
|
||||
@ -475,9 +471,9 @@ export default {
|
||||
},
|
||||
selectable(row){
|
||||
if(row.is_confirm){
|
||||
return false; //不禁用
|
||||
return false;
|
||||
}else {
|
||||
return true; //禁用
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
290
src/views/order/inventoryList/index.vue
Normal file
290
src/views/order/inventoryList/index.vue
Normal file
@ -0,0 +1,290 @@
|
||||
<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 #active_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>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
size:'small',
|
||||
dialog: {
|
||||
save: false,
|
||||
show: false,
|
||||
},
|
||||
list: {
|
||||
apiObj: this.$API.orders.order.sock.list,
|
||||
column: [],
|
||||
},
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'生产日期',type:'date',code:'activation_date',show:true},
|
||||
{name:'反厂日期',type:'date',code:'activation_date',show:true},
|
||||
{name:'处理时间',type:'date',code:'activation_date',show:true},
|
||||
{name:'客户名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:false},
|
||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",show:false},
|
||||
{name:'工单号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
|
||||
{name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false},
|
||||
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
|
||||
{name:'负责人',type:'text',code:['owner'],placeholder:"请输入负责人",isOpen:true,show:false},
|
||||
{name:'关键字',type:'text',code:['domain','name'],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>
|
||||
290
src/views/order/inventoryStatistics/index.vue
Normal file
290
src/views/order/inventoryStatistics/index.vue
Normal file
@ -0,0 +1,290 @@
|
||||
<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 #active_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>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
size:'small',
|
||||
dialog: {
|
||||
save: false,
|
||||
show: false,
|
||||
},
|
||||
list: {
|
||||
apiObj: {},
|
||||
column: [],
|
||||
},
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'生产日期',type:'date',code:'activation_date'},
|
||||
{name:'反厂日期',type:'date',code:'activation_date'},
|
||||
{name:'处理时间',type:'date',code:'activation_date'},
|
||||
{name:'客户名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:false},
|
||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",show:false},
|
||||
{name:'工单号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
|
||||
{name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false},
|
||||
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
|
||||
{name:'负责人',type:'text',code:['owner'],placeholder:"请输入负责人",isOpen:true,show:false},
|
||||
{name:'关键字',type:'text',code:['domain','name'],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>
|
||||
@ -49,12 +49,11 @@
|
||||
<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-item @click="table_edit(scope.row, 'edit')" icon="sc-icon-Edit">编辑工单</el-dropdown-item>
|
||||
<el-dropdown-item @click="table_del(scope.row, 'delete')" icon="sc-icon-Delete">删除工单</el-dropdown-item>
|
||||
<el-dropdown-item @click="table_show(scope.row, 'see')" icon="sc-icon-See">工单详情</el-dropdown-item>
|
||||
<el-dropdown-item icon="sc-icon-OrderSetup" @click="table_empower(scope.row)" divided>执行维修</el-dropdown-item>
|
||||
<el-dropdown-item icon="sc-icon-OrderLog" @click="table_user_ist(scope.row)" divided>工单日志</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
@ -93,9 +92,9 @@ export default {
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'生产日期',type:'date',code:'activation_date'},
|
||||
{name:'反厂日期',type:'date',code:'activation_date'},
|
||||
{name:'处理时间',type:'date',code:'activation_date'},
|
||||
{name:'生产日期',type:'date',code:'activation_date',show:true},
|
||||
{name:'反厂日期',type:'date',code:'activation_date',show:true},
|
||||
{name:'处理时间',type:'date',code:'activation_date',show:true},
|
||||
{name:'客户名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:false},
|
||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",show:false},
|
||||
{name:'工单号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
|
||||
|
||||
290
src/views/reports/keepRepairReports/index.vue
Normal file
290
src/views/reports/keepRepairReports/index.vue
Normal file
@ -0,0 +1,290 @@
|
||||
<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 #active_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>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
size:'small',
|
||||
dialog: {
|
||||
save: false,
|
||||
show: false,
|
||||
},
|
||||
list: {
|
||||
apiObj: {},
|
||||
column: [],
|
||||
},
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'生产日期',type:'date',code:'activation_date'},
|
||||
{name:'反厂日期',type:'date',code:'activation_date'},
|
||||
{name:'处理时间',type:'date',code:'activation_date'},
|
||||
{name:'客户名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:false},
|
||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",show:false},
|
||||
{name:'工单号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
|
||||
{name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false},
|
||||
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
|
||||
{name:'负责人',type:'text',code:['owner'],placeholder:"请输入负责人",isOpen:true,show:false},
|
||||
{name:'关键字',type:'text',code:['domain','name'],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>
|
||||
290
src/views/reports/shipmentReports/index.vue
Normal file
290
src/views/reports/shipmentReports/index.vue
Normal file
@ -0,0 +1,290 @@
|
||||
<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 #active_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>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
size:'small',
|
||||
dialog: {
|
||||
save: false,
|
||||
show: false,
|
||||
},
|
||||
list: {
|
||||
apiObj: {},
|
||||
column: [],
|
||||
},
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'生产日期',type:'date',code:'activation_date'},
|
||||
{name:'反厂日期',type:'date',code:'activation_date'},
|
||||
{name:'处理时间',type:'date',code:'activation_date'},
|
||||
{name:'客户名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:false},
|
||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",show:false},
|
||||
{name:'工单号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
|
||||
{name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false},
|
||||
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
|
||||
{name:'负责人',type:'text',code:['owner'],placeholder:"请输入负责人",isOpen:true,show:false},
|
||||
{name:'关键字',type:'text',code:['domain','name'],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>
|
||||
290
src/views/setting/bom/index.vue
Normal file
290
src/views/setting/bom/index.vue
Normal file
@ -0,0 +1,290 @@
|
||||
<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 #active_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>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
size:'small',
|
||||
dialog: {
|
||||
save: false,
|
||||
show: false,
|
||||
},
|
||||
list: {
|
||||
apiObj: {},
|
||||
column: [],
|
||||
},
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'生产日期',type:'date',code:'activation_date'},
|
||||
{name:'反厂日期',type:'date',code:'activation_date'},
|
||||
{name:'处理时间',type:'date',code:'activation_date'},
|
||||
{name:'客户名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:false},
|
||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",show:false},
|
||||
{name:'工单号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
|
||||
{name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false},
|
||||
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
|
||||
{name:'负责人',type:'text',code:['owner'],placeholder:"请输入负责人",isOpen:true,show:false},
|
||||
{name:'关键字',type:'text',code:['domain','name'],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>
|
||||
@ -91,7 +91,8 @@ export default {
|
||||
user_id:this.id
|
||||
}
|
||||
const res = await this.$API.system.user.userPermission.post(params);
|
||||
this.user_roles = res.data.role;
|
||||
this.user_roles = res.data && res.data.role?res.data.role:[];
|
||||
if(res.data && res.data.menu && res.data.menu.length>0){
|
||||
res.data.menu.forEach(item=>{
|
||||
if(item.children){
|
||||
item.children.forEach(em=>{
|
||||
@ -112,6 +113,7 @@ export default {
|
||||
}
|
||||
})
|
||||
this.list = res.data.menu;
|
||||
}
|
||||
},
|
||||
allCheckChange(){
|
||||
return
|
||||
|
||||
290
src/views/shipment/shipmentDataConfirm/index.vue
Normal file
290
src/views/shipment/shipmentDataConfirm/index.vue
Normal file
@ -0,0 +1,290 @@
|
||||
<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 #active_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>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
size:'small',
|
||||
dialog: {
|
||||
save: false,
|
||||
show: false,
|
||||
},
|
||||
list: {
|
||||
apiObj: this.$API.shipment.out.list,
|
||||
column: [],
|
||||
},
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'生产日期',type:'date',code:'activation_date',show:true},
|
||||
{name:'反厂日期',type:'date',code:'activation_date',show:true},
|
||||
{name:'处理时间',type:'date',code:'activation_date',show:true},
|
||||
{name:'客户名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:false},
|
||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",show:false},
|
||||
{name:'工单号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
|
||||
{name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false},
|
||||
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
|
||||
{name:'负责人',type:'text',code:['owner'],placeholder:"请输入负责人",isOpen:true,show:false},
|
||||
{name:'关键字',type:'text',code:['domain','name'],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>
|
||||
290
src/views/shipment/shipmentList/index.vue
Normal file
290
src/views/shipment/shipmentList/index.vue
Normal file
@ -0,0 +1,290 @@
|
||||
<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 #active_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>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
size:'small',
|
||||
dialog: {
|
||||
save: false,
|
||||
show: false,
|
||||
},
|
||||
list: {
|
||||
apiObj: this.$API.shipment.out.list,
|
||||
column: [],
|
||||
},
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'生产日期',type:'date',code:'activation_date',show:true},
|
||||
{name:'反厂日期',type:'date',code:'activation_date',show:true},
|
||||
{name:'处理时间',type:'date',code:'activation_date',show:true},
|
||||
{name:'客户名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:false},
|
||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",show:false},
|
||||
{name:'工单号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
|
||||
{name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false},
|
||||
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
|
||||
{name:'负责人',type:'text',code:['owner'],placeholder:"请输入负责人",isOpen:true,show:false},
|
||||
{name:'关键字',type:'text',code:['domain','name'],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>
|
||||
290
src/views/shipment/shipmentStatistics/index.vue
Normal file
290
src/views/shipment/shipmentStatistics/index.vue
Normal file
@ -0,0 +1,290 @@
|
||||
<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 #active_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>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
size:'small',
|
||||
dialog: {
|
||||
save: false,
|
||||
show: false,
|
||||
},
|
||||
list: {
|
||||
apiObj: {},
|
||||
column: [],
|
||||
},
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'生产日期',type:'date',code:'activation_date'},
|
||||
{name:'反厂日期',type:'date',code:'activation_date'},
|
||||
{name:'处理时间',type:'date',code:'activation_date'},
|
||||
{name:'客户名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:false},
|
||||
{name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",show:false},
|
||||
{name:'工单号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
|
||||
{name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false},
|
||||
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
|
||||
{name:'负责人',type:'text',code:['owner'],placeholder:"请输入负责人",isOpen:true,show:false},
|
||||
{name:'关键字',type:'text',code:['domain','name'],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