Compare commits

..

No commits in common. "dev" and "第二版" have entirely different histories.

62 changed files with 460 additions and 1967 deletions

View File

@ -13,9 +13,6 @@ VUE_APP_API_DEV = https://dev.api.linkwing.com/api/v1
VUE_APP_WS_URL = wss://dev.api.linkwing.com/wss
VUE_APP_WSS_URL = wss://dev.api.linkwing.com/wss
# SSE地址
VUE_APP_SSE_URL = https://dev.api.linkwing.com/sse/stream
# 本地端口
VUE_APP_PORT = 2801

View File

@ -17,6 +17,3 @@ VUE_APP_TITLE = 象纬云科
# VUE_APP_WS_URL = wss://prod.api.linkwing.com/wss
# VUE_APP_WSS_URL = wss://prod.api.linkwing.com/wss
# SSE地址
VUE_APP_SSE_URL = https://dev.api.linkwing.com/sse/stream

View File

@ -51,51 +51,8 @@ export default {
post: async function (params) {
return await http.post(this.url, params);
},
},
template:{
url: `${config.API_URL}/warning.management.import.template`,
name: "预计六个月用量导入模版",
post: async function (params) {
return await http.get(this.url,params,{responseType: 'arraybuffer'});
}
},
import:{
url: `${config.API_URL}/spare.parts.water.level.warning.batch.import`,
name: "预计六个月用量导入",
post: async function (params) {
return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
}
},
},
exclude:{
list:{
url: `${config.API_URL}/warning.exclude.list`,
name: "排除备件列表",
get: async function (params) {
return await http.post(this.url, params);
},
},
field:{
url: `${config.API_URL}/warning.exclude.field.list`,
name: "排除备件检索",
post: async function (params) {
return await http.post(this.url, params);
},
},
template:{
url: `${config.API_URL}/warning.exclude.import.template`,
name: "排除备件导入模版",
post: async function (params) {
return await http.get(this.url,params,{responseType: 'arraybuffer'});
}
},
import:{
url: `${config.API_URL}/warning.exclude.import`,
name: "排除备件导入",
post: async function (params) {
return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
}
},
}
}
};

View File

@ -124,21 +124,7 @@ export default {
post: async function (params) {
return await http.post(this.url,params);
}
},
template:{
url: `${config.API_URL}/repair.order.import.template`,
name: "维修工单导入模版",
post: async function (params) {
return await http.get(this.url,params,{responseType: 'arraybuffer'});
}
},
import:{
url: `${config.API_URL}/repair.order.import`,
name: "维修工单导入",
post: async function (params) {
return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
}
},
}
},
maintenance:{
list:{

View File

@ -100,13 +100,6 @@ export default {
return await http.post(this.url, params);
},
},
record:{
url: `${config.API_URL}/download.record.list`,
name: "下载记录",
get: async function (params) {
return await http.post(this.url, params);
},
},
export:{
url: `${config.API_URL}/user.log.export`,
name: "用户日志导出",

View File

@ -1,13 +0,0 @@
<template>
<svg t="1754287674404" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5370" width="200" height="200"><path d="M800.64 66.56c44.25216 0 79.13984 34.34496 79.98464 78.36672l0.01536 1.63328V450.56c0 19.2-12.8 32-32 32-18.77504 0-31.42656-12.2368-31.97952-30.73024L816.64 450.56V152.96c0-12.42112-9.04192-21.83168-21.27872-22.3744l-1.12128-0.0256H202.24c-15.55456 0-25.0624 9.07264-25.57952 21.34016l-0.02048 1.05984V872.96c0 15.58016 9.10336 25.088 24.35072 25.57952l1.24928 0.02048h198.4c19.2 0 32 12.8 32 32 0 18.77504-12.2368 31.42656-30.73024 31.97952l-1.26976 0.02048H192.64c-44.25216 0-79.13984-34.34496-79.98464-78.36672l-0.01536-1.63328V146.56c0-44.25216 34.34496-79.13984 78.36672-79.98464l1.63328-0.01536h608z m-46.50496 539.39712l149.02272 148.992a32 32 0 0 1 0 45.28128L754.13504 949.248a32 32 0 0 1-45.25056-45.25056l94.40256-94.39744H464.53248a32 32 0 1 1 0-64h338.75456l-94.40256-94.40256a32 32 0 1 1 45.25056-45.24544zM467.84 418.56c16 0 28.8 12.8 28.8 28.8a28.672 28.672 0 0 1-27.66336 28.7744l-1.13664 0.0256h-166.4a28.68224 28.68224 0 0 1-28.8-28.8 28.672 28.672 0 0 1 27.66336-28.7744l1.13664-0.0256h166.4z m224-153.6c16 0 28.8 12.8 28.8 28.8a28.672 28.672 0 0 1-27.66336 28.7744l-1.13664 0.0256h-390.4a28.68224 28.68224 0 0 1-28.8-28.8 28.672 28.672 0 0 1 27.66336-28.7744l1.13664-0.0256h390.4z" p-id="5371"></path></svg>
</template>
<script>
export default {
name: "ExportLog"
}
</script>
<style scoped>
</style>

View File

@ -1,15 +0,0 @@
<template>
<svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg">
<path d="M0.65465 5.2335H13.0922C13.359 5.2335 13.599 5.07663 13.7003 4.82788C13.75 4.70924 13.7635 4.5785 13.7389 4.45222C13.7143 4.32594 13.6528 4.2098 13.5622 4.1185L9.63715 0.193503C9.5771 0.132237 9.50543 0.0835662 9.42634 0.05034C9.34724 0.0171138 9.26231 0 9.17653 0C9.09074 0 9.00581 0.0171138 8.92672 0.05034C8.84762 0.0835662 8.77595 0.132237 8.7159 0.193503C8.65463 0.253555 8.60596 0.325225 8.57274 0.404319C8.53951 0.483412 8.5224 0.568339 8.5224 0.654128C8.5224 0.739917 8.53951 0.824844 8.57274 0.903937C8.60596 0.983031 8.65463 1.0547 8.7159 1.11475L11.5259 3.92475H0.6634C0.304025 3.92475 0.00902528 4.21975 0.00902528 4.57913C0.0076121 4.66471 0.0232818 4.74972 0.0551176 4.82918C0.0869533 4.90864 0.134316 4.98095 0.194434 5.04188C0.254552 5.10281 0.326219 5.15115 0.405241 5.18405C0.484262 5.21695 0.569053 5.23376 0.65465 5.2335ZM13.0922 9.296H0.65465C0.387775 9.296 0.147775 9.45288 0.0465252 9.70163C0.0134536 9.78027 -0.00231958 9.8651 0.000275319 9.95038C0.000275319 10.116 0.0646503 10.291 0.194025 10.411L3.46465 13.691C3.5247 13.7523 3.59637 13.8009 3.67547 13.8342C3.75456 13.8674 3.83949 13.8845 3.92528 13.8845C4.01106 13.8845 4.09599 13.8674 4.17509 13.8342C4.25418 13.8009 4.32585 13.7523 4.3859 13.691C4.44717 13.631 4.49584 13.5593 4.52906 13.4802C4.56229 13.4011 4.5794 13.3162 4.5794 13.2304C4.5794 13.1446 4.56229 13.0597 4.52906 12.9806C4.49584 12.9015 4.44717 12.8298 4.3859 12.7698L2.23028 10.6141H13.0922C13.4515 10.6141 13.7465 10.3191 13.7465 9.95975C13.7459 9.60038 13.4515 9.296 13.0922 9.296Z" fill=""/>
</svg>
</template>
<script>
export default {
name: "SwitchQuery"
}
</script>
<style scoped>
</style>

View File

@ -20,7 +20,6 @@ export { default as Account } from './Account.vue'
export { default as Notice } from './Notice.vue'
export { default as Password } from './Password.vue'
export { default as Secure } from './Secure.vue'
export { default as ExportLog } from './ExportLog.vue'
export { default as UserLog } from './Log.vue'
export { default as WechartRound } from './WechartRound.vue'
export { default as Cost } from './Cost.vue'
@ -59,7 +58,6 @@ export { default as ComponentQuery } from './ComponentQuery.vue'
export { default as TermQuery } from './TermQuery.vue'
export { default as Feedback } from './Feedback.vue'
export { default as PartsMag } from './PartsMag.vue'
export { default as SwitchQuery } from './SwitchQuery.vue'
export { default as File7z } from './file/7z.vue'
export { default as FileBmp } from './file/Bmp.vue'

View File

@ -58,10 +58,7 @@ export default {
this.emitActivationDate();
},
emitActivationDate() {
let date = [];
if(this.localDatePicker && this.localDatePicker.length>0){
date = this.localDatePicker.map((date,index) => index===0? this.$TOOL.formatStartTime(date):this.$TOOL.formatEndTime(date));
}
let date = this.localDatePicker.map((date,index) => index===0? this.$TOOL.formatStartTime(date):this.$TOOL.formatEndTime(date));
this.$emit('update:activation_date', {
operator: this.activation_date.operator,
value: this.localDatePicker && this.localDatePicker.length > 0? date:[]

View File

@ -16,11 +16,7 @@
<div :class="list.length-1==index?'':'exportItem'" v-if="list.length>0 && type == item.type">
<div class="exportHeader">
<div class="name">{{item.type_desc}}</div>
<div class="status" v-if="item.status==0">
<el-tooltip effect="dark" :content="item.msg">
<span size="mini">{{item.msg}}</span>
</el-tooltip>
</div>
<div class="status" v-if="item.status==0">{{item.msg}}</div>
<div class="finish" v-if="item.status==1"><i class="icon"><sc-icon-Finish/></i> 文件生成完成</div>
</div>
<el-progress class="exportPopover" :text-inside="true" :stroke-width="12" :percentage="item.rate" />
@ -28,6 +24,27 @@
</div>
</template>
</el-popover>
<!-- <div class="customerPopover">-->
<!-- <div class="btnBox">-->
<!-- <slot></slot>-->
<!-- </div>-->
<!-- <div class="contentPopover" v-if="show">-->
<!-- <div class="bodyMain">-->
<!-- <span class="arrow"></span>-->
<!-- <div v-for="(item,index) in list" :key="item">-->
<!-- <div :class="list.length-1==index?'':'exportItem'" v-if="list.length>0 && type == item.type">-->
<!-- <div class="exportHeader">-->
<!-- <div class="name">{{item.type_desc}}</div>-->
<!-- <div class="status" v-if="item.status==0">{{item.msg}}</div>-->
<!-- <div class="finish" v-if="item.status==1"><i class="icon"><sc-icon-Finish/></i> 文件生成完成</div>-->
<!-- </div>-->
<!-- <el-progress class="exportPopover" :text-inside="true" :stroke-width="12" :percentage="item.rate" />-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</template>
<script>
@ -60,14 +77,10 @@ export default {
},
mounted() {
//
// eventBus.$on('sockBack', this.getWsResult);
eventBus.$on('sseBack', this.getWsResult);
eventBus.$on('sockBack', this.getWsResult);
},
unmounted() {
// eventBus.$off('sockBack', this.getWsResult);
eventBus.$off('sseBack', this.getWsResult);
eventBus.$off('sockBack', this.getWsResult);
},
methods:{
getWsResult(res){

View File

@ -6,28 +6,14 @@
<div class="contentPopover" v-if="show">
<div class="bodyMain">
<span class="arrow"></span>
<template v-if="listIsType">
<div v-for="item in list" :key="item">
<div v-if="list.length>0 && type == item.type">
<div class="exportHeader">
<div class="exportName">{{item.type_desc}}</div>
<div class="status" v-if="item.status==0">
<el-tooltip effect="dark" :content="item.msg">
<span size="mini">{{item.msg}}</span>
</el-tooltip>
</div>
<div class="finish" v-if="item.status==1"><i class="icon"><sc-icon-Finish/></i> 文件生成完成</div>
</div>
<el-progress class="exportPopover" :text-inside="true" :stroke-width="12" :percentage="item.rate" />
</div>
</div>
</template>
<div v-else>
<div>
<div v-for="item in list" :key="item">
<div v-if="list.length>0 && type == item.type">
<div class="exportHeader">
<div class="exportName">正在解析中...</div>
<div class="exportName">{{item.type_desc}}</div>
<div class="status" v-if="item.status==0">{{item.msg}}</div>
<div class="finish" v-if="item.status==1"><i class="icon"><sc-icon-Finish/></i> 文件生成完成</div>
</div>
<el-progress class="exportPopover" :text-inside="true" :stroke-width="12" percentage="0" />
<el-progress class="exportPopover" :text-inside="true" :stroke-width="12" :percentage="item.rate" />
</div>
</div>
</div>
@ -46,13 +32,6 @@ export default {
},
watch:{
},
computed:{
listIsType(){
let arr = this.$TOOL.objCopy(this.list);
arr = arr.filter(item => item.type && item.type == this.type);
return arr.length && arr.length > 0;
}
},
data(){
return{
@ -61,14 +40,10 @@ export default {
},
mounted() {
//
// eventBus.$on('sockBack', this.getWsResult);
// sse
eventBus.$on('sseBack', this.getWsResult);
eventBus.$on('sockBack', this.getWsResult);
},
unmounted() {
// eventBus.$off('sockBack', this.getWsResult);
eventBus.$off('sseBack', this.getWsResult);
eventBus.$off('sockBack', this.getWsResult);
},
methods:{
getWsResult(res){
@ -138,10 +113,6 @@ export default {
this.$emit('updateShow', item);
if(res.data.status==1){
this.list = this.list.map(item =>
item.type === res.data.type ? {} : item
);
this.down(res.data);
}
}

View File

@ -1,7 +1,7 @@
<template>
<slot name="header"></slot>
<el-dialog v-bind="$attrs" :title="title" v-model="visible" :width="560" destroy-on-close draggable @closed="closeVisible">
<el-dialog v-bind="$attrs" :title="title" v-model="visible" :width="560" destroy-on-close draggable @closed="visible=false">
<div class="importBody">
<el-upload
class="upload"
@ -26,7 +26,7 @@
<div class="el-upload__text">
<el-icon class="trueIcon el-icon&#45;&#45;upload">
<sc-icon-FormXls />
<div class="deleteFile" @click="deleteFile" v-if="!progressTrue"><el-icon class="icon"><el-icon-Close/></el-icon></div>
<div class="deleteFile" @click="deleteFile"><el-icon class="icon"><el-icon-Close/></el-icon></div>
</el-icon>
<div class="el-upload__text">{{text}}</div>
</div>
@ -42,17 +42,13 @@
<slot name="download"></slot>
</span>
</div>
<div class="importBox" v-if="progressShow">
<div class="name">导入进度</div>
<el-progress class="exportPopover" :text-inside="true" :stroke-width="12" :percentage="importInfo.rate" />
</div>
<div class="primaryText" v-if="analysisShow">
<div class="text success">正在解析...</div>
</div>
<div class="errText" v-if="errorShow">
<div class="deleteErr" @click="errorClick"><el-icon class="icon"><el-icon-Close/></el-icon></div>
<el-scrollbar ref="scrollbar" max-height="120px">
<el-scrollbar max-height="120px">
<div v-for="em in errorList" :key="em">
<div :class="em.status==0?'text danger':'text success'" v-html="em.msg"></div>
</div>
@ -62,8 +58,8 @@
</el-upload>
</div>
<template #footer>
<el-button @click="closeVisible"> </el-button>
<el-button type="primary" :disabled="!importTrue || progressTrue || httpDisabled" @click="save">确定导入</el-button>
<el-button @click="visible=false"> </el-button>
<el-button type="primary" :disabled="!importTrue || progressShow || httpDisabled" @click="save">确定导入</el-button>
</template>
</el-dialog>
</template>
@ -78,7 +74,7 @@ export default {
size:{type:String, default:'small'},
title:{type:String, default: ""},
type:{type:[String, Number], default: ""},
httpDisabled:{type:Boolean, default:false},
httpDisabled:{type:Boolean, default:false}
},
data(){
return{
@ -92,11 +88,9 @@ export default {
fileShow:false,
params:{},
analysisShow:false,
importDis:false,
importTrue:false,
progressShow:false,
progressTrue:false,
errorShow:false,
importInfo:{},
errorList:[],
@ -111,46 +105,30 @@ export default {
},
mounted() {
// eventBus.$on('sockBack', this.getWsResult);
eventBus.$on('sseBack', this.getWsResult);
eventBus.$on('sockBack', this.getWsResult);
},
unmounted() {
// eventBus.$off('sockBack', this.getWsResult);
eventBus.$off('sseBack', this.getWsResult);
eventBus.$off('sockBack', this.getWsResult);
},
methods:{
getWsResult(res){
if(res.data && (res.data.type == 4 || res.data.type == 5 || res.data.type == 10 || res.data.type == 17 || res.data.type == 18 || res.data.type == 27 || res.data.type == 28 || res.data.type == 31 || res.data.type == 42 || res.data.type == 44 || res.data.type == 45 || res.data.type == 48 || res.data.type == 49 || res.data.type == 50 || res.data.type == 51)){
if(res.data && (res.data.type == 4 || res.data.type == 5 || res.data.type == 10 || res.data.type == 17 || res.data.type == 18 || res.data.type == 27 || res.data.type == 28 || res.data.type == 31 || res.data.type == 42 || res.data.type == 44 || res.data.type == 45 || res.data.type == 48)){
if(this.type == res.data.type){
this.analysisShow = false;
this.importInfo = res.data;
this.progressShow = true;
this.progressTrue = true;
this.importTrue = true;
if(res.data.status == 0 || res.data.status == 1){
this.errorShow = true;
let text = res.data;
this.errorList.push(text);
this.scrollDown();
}
if(res.data.rate == 100){
// this.progressShow = false;
this.importDis = false;
this.progressTrue = false;
this.progressShow = false;
this.$emit('importSuccess');
}
}
}
},
setAnalysisShow(params){
this.analysisShow = params;
},
//
importFile(){
this.visible = true;
@ -175,7 +153,6 @@ export default {
this.params = formData;
this.importTrue = true;
this.importDis = true;
this.progressShow = false;
} catch (error) {
console.log(error)
}
@ -184,7 +161,6 @@ export default {
this.importTrue = false;
setTimeout(()=>{
this.importDis = false;
this.$emit('importSuccess',{refresh:false});
this.errorClick();
},100)
},
@ -192,11 +168,6 @@ export default {
this.errorShow= false;
this.errorList= []
},
closeVisible(){
this.visible = false;
this.progressShow = false;
this.importTrue = false;
},
save(){
this.errorClick();
this.$emit('parentParams',this.params);
@ -208,19 +179,7 @@ export default {
//
handleError(){
this.$message.warning('上传失败请重新上传');
},
scrollDown() {
this.$nextTick(() => {
const wrap = this.$refs.scrollbar;
if(wrap){
const e = wrap.$el.querySelector('.el-scrollbar__wrap')
if(e){
e.scrollTop = e.scrollHeight;
}
}
})
},
}
}
}
</script>
@ -285,20 +244,6 @@ export default {
font-size: 10px;
}
}
.primaryText{
margin: 15px 0 0 0;
padding: 10px;
border-radius: 6px;
background: var(--el-color-primary-light-9);
::v-deep .text{
font-size: 12px;
line-height: 20px;
text-align: left;
}
.text{
color: var(--el-color-primary)
}
}
.errText{
margin: 15px 0 0 0;
padding: 10px;

View File

@ -26,7 +26,7 @@ export default {
watch:{
activation_text:{
handler(val){
if(val && typeof val.value === 'string'){
if(val){
this.localText = val.value.replace(/%/g, "");
}
},

View File

@ -47,9 +47,8 @@ export default {
},
methods:{
getDataList(visible){
if(!visible) return
this.$emit('fetchData',visible);
getDataList(val){
this.$emit('fetchData',val);
},
selectChange(e){
this.localData = e;

View File

@ -51,7 +51,7 @@ export default {
searchList:{
handler(val){
if(val && val.length>0){
this.columnList = this.sortData(val.filter(em=> !em.hide && em.is_search));
this.columnList = val.filter(em=> !em.hide && em.is_search);
this.params = this.groupByType(val);
}
},
@ -123,26 +123,6 @@ export default {
}
}
},
//
sortData(list){
const sortedArray = list.sort((a, b) => {
const priority = ['date_range', 'date'];
// absearch_type
const aPriority = priority.indexOf(a.search_type);
const bPriority = priority.indexOf(b.search_type);
// aba
if (aPriority !== -1 && bPriority === -1) return -1;
// bab
if (bPriority !== -1 && aPriority === -1) return 1;
//
if (aPriority !== -1 && bPriority !== -1) return aPriority - bPriority;
//
return 0;
});
return sortedArray;
},
groupByType(list){
const grouped = {};

View File

@ -1,165 +0,0 @@
<template>
<div class="scTableSearch" v-if="fieldsShow">
<div class="searchBody">
<div class="searchBox searchConditionItem">
<div class="leftBox">
<el-radio-group v-model="params.type">
<el-radio :label="item.prop" :size="size" v-for="(item,index) in fieldsList" :key="index">{{item.label}}</el-radio>
</el-radio-group>
</div>
<div class="rightBox" @click="fieldsSwitch">
<el-icon class="icon"><sc-icon-SwitchQuery /></el-icon>
<span class="name">切换查询方式</span>
</div>
</div>
<div class="searchBox searchTextItem">
<el-input class="text" v-model="params.message" type="textarea" placeholder="请输入检索条件,用空格、换行区分"></el-input>
<div class="operateBox">
<el-button type="primary" :size="size" @click="save">批量查询</el-button>
<el-button type="info" :size="size" @click="reset">重置</el-button>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "herderMultipleInput",
props:{
searchList:{
type:[Object,Array],
},
fieldsShow:{
type:Boolean,
default:false
}
},
watch:{
searchList:{
handler(val){
let list = [];
for(let i in val){
list.push({prop:i,label:val[i]})
}
this.fieldsList = list;
if(this.fieldsList && this.fieldsList.length>0){
this.params.type = this.params.type===""?this.fieldsList[0].prop:this.params.type;
}
},
immediate:true,
deep:true
},
},
data(){
return{
size:"small",
fieldsList:[],
params:{
type:"",
message:""
},
fieldsData:{}
}
},
mounted() {
},
methods:{
fieldsSwitch(){
this.$emit('fieldsSwitch',false);
},
setData(){
const str = this.params.message;
if(str === ""){
return []
}
const list = str.split(/\s+/);
return list.filter(em=>em!=="");
},
save(){
this.fieldsData[this.params.type] = {
operator:"in",
value:this.setData()
}
this.$emit('fieldsSearch',this.fieldsData)
},
reset(){
this.params.message = "";
if(this.fieldsList && this.fieldsList.length>0){
this.fieldsList.forEach((item,index)=>{
if(index===0){
this.params.type = item.prop;
}
if(this.fieldsData[item.prop]){
this.fieldsData[item.prop].value = [];
}
})
}
if(this.fieldsData[this.params.type]){
this.fieldsData[this.params.type].value = [];
}
this.$emit('fieldsSearch',this.fieldsData);
}
}
}
</script>
<style scoped lang="scss">
.scTableSearch{
width: 100%;
margin-top: 0;
.searchBody{
width: 100%;
padding: 5px 10px 10px 10px;
display: flex;
flex-direction: column;
align-items: center;
.searchBox{
width: 100%;
}
.searchConditionItem{
display: flex;
align-items: center;
margin-bottom: 5px;
.leftBox{
flex: 1;
}
.rightBox{
flex-basis: 100px;
display: flex;
align-items: center;
justify-content: flex-end;
cursor: pointer;
.icon{
color: var(--el-color-primary);
}
.name{
color: var(--el-color-primary);
margin-left: 6px;
}
}
}
.searchTextItem{
flex: 1;
display: flex;
align-items: center;
border-radius: 4px;
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
padding: 1px;
background: var(--el-color-white);
.text{
font-size: 12px;
::v-deep .el-textarea__inner{
box-shadow: none;
}
}
.operateBox{
padding: 10px;
display: flex;
align-items: center;
}
}
}
}
</style>

View File

@ -262,8 +262,7 @@
}
if(response.data.columnConfig){
this.userColumn = response.data.columnConfig; //
const fieldsData = response.data.bachSelectFields;
this.$emit('columnBack',this.userColumn, fieldsData);
this.$emit('columnBack',this.userColumn);
}
if(response.data.tableConfig && response.data.tableConfig.size){
this.config = response.data.tableConfig;

View File

@ -23,8 +23,6 @@ const DEFAULT_CONFIG = {
? process.env.VUE_APP_WS_URL
: process.env.VUE_APP_WSS_URL,
// SSE接口地址
SSE_URL:process.env.VUE_APP_SSE_URL,
//请求超时
TIMEOUT: 10000000,

View File

@ -6,5 +6,5 @@
export default {
//是否显示第三方授权登录
MY_SHOW_LOGIN_OAUTH: false
MY_SHOW_LOGIN_OAUTH: true
}

View File

@ -244,7 +244,6 @@
}
},
created() {
console.log('layout 再一次进入')
this.onLayoutResize();
window.addEventListener('resize', this.onLayoutResize);
const menu = this.$router.sc_getMenu();
@ -262,14 +261,9 @@
}
},
mounted() {
let token = this.$TOOL.cookie.get('TOKEN');
if(token && token !== null){
this.$seeApi.default.connect();
}
},
unmounted() {
this.$seeApi.default.close();
eventBus.$off('sockBack', this.getWsResult);
},
watch: {

View File

@ -6,9 +6,9 @@
<div class="router-err__content">
<h2>无权限或找不到页面</h2>
<p>当前页面无权限访问或者打开了一个不存在的链接请检查当前账户权限和链接的可访问性</p>
<el-button type="primary" plain round @click="goHome">返回首页</el-button>
<el-button type="primary" plain round @click="goLogin">重新登录</el-button>
<el-button type="primary" round @click="goBack">返回上一页</el-button>
<el-button type="primary" plain round @click="gohome">返回首页</el-button>
<el-button type="primary" plain round @click="gologin">重新登录</el-button>
<el-button type="primary" round @click="goback">返回上一页</el-button>
</div>
</div>
</template>
@ -16,15 +16,15 @@
<script>
export default {
methods: {
goHome(){
gohome(){
location.href="#/"
},
goLogin(){
this.$router.push("/login");
},
goBack(){
goback(){
this.$router.go(-1);
},
gologin(){
this.$router.push("/login");
}
}
}
</script>

View File

@ -27,7 +27,6 @@ import scInput from "./components/scInput";
import scVgInput from "./components/scInput/inputVague";
import scSearch from "./components/scSearch";
import scTableSearch from "./components/scTable/components/headerSearch";
import herderMultipleSearch from "./components/scTable/components/herderMultipleInput";
import scExport from "./components/scExport";
import scExportList from "./components/scExport/exportList";
import scImport from "./components/scImport";
@ -51,7 +50,6 @@ import errorHandler from './utils/errorHandler'
import * as elIcons from '@element-plus/icons-vue'
import * as scIcons from './assets/icons'
import * as socketApi from "@/utils/websocket";
import * as sseApi from "@/utils/sseService";
export default {
install(app) {
@ -63,7 +61,6 @@ export default {
app.config.globalProperties.$AUTH = permission;
app.config.globalProperties.$ROLE = rolePermission;
app.config.globalProperties.$socketApi = socketApi;
app.config.globalProperties.$seeApi = sseApi;
//注册全局组件
app.component('scTable', scTable);
@ -91,7 +88,6 @@ export default {
app.component('scVgInput', scVgInput);
app.component('scSearch', scSearch);
app.component('scTableSearch', scTableSearch);
app.component('herderMultipleSearch', herderMultipleSearch);
app.component('scExport', scExport);
app.component('scExportList', scExportList);
app.component('scImport', scImport);

View File

@ -114,13 +114,9 @@
/** 列表上面的检索 */
.el-main.nopadding .searchMain{position: relative;display: flex;flex-wrap: wrap;align-items: self-end;padding-bottom: 10px;margin: 15px 0 0 0; border-bottom: 1px solid var(--el-border-color-light);}
.el-main.nopadding .searchMain.searchMainMarginNone{margin-top: 5px;}
.el-main.nopadding .searchMain.logSearchMain{min-height: 50px;}
.el-main.nopadding .searchMain.emptySearchMain{margin: 0;padding-bottom: 0;border-bottom: 0;}
.el-main.nopadding .fieldsSwitchBox{margin: 0 10px;}
.el-main.nopadding .searchMainNoTop{margin-top: 0;}
.el-main.nopadding .searchMainNoTop.searchMainMarginNone{margin: 0;}
.el-main.nopadding .searchMainNoTop.searchMainBodyMarginNone .scTableSearch .searchBody{padding-left: 0 !important;padding-right: 0 !important;}
.el-main.nopadding .searchMain .searchItem{display: flex;flex-direction: column;align-items: flex-start;margin-right: 20px;margin-bottom: 10px;}
.el-main.nopadding .searchMain .searchItem .name{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;color: #303133;padding-bottom: 5px;text-align: right;}
.el-main.nopadding .searchMain .searchItem .input{width: 230px;height: 28px;}
@ -128,29 +124,6 @@
.el-main.nopadding .searchMain .searchItem.searchBtn{display: flex;flex-direction: row;}
.el-main.nopadding .searchMain .exportBtn{position: absolute;bottom: 20px;right: 0;}
.searchConditionItem{
display: flex;
align-items: center;
margin-bottom: 5px;
.leftBox{
flex: 1;
}
.rightBox{
flex-basis: 100px;
display: flex;
align-items: center;
justify-content: flex-end;
cursor: pointer;
.icon{
color: var(--el-color-primary);
}
.name{
color: var(--el-color-primary);
margin-left: 6px;
}
}
}
.el-drawer__body {overflow: auto;padding:0;}
.el-popconfirm__main {margin: 14px 0;}
.el-card__header {border-bottom: 0;font-size: 17px;font-weight: bold;padding:15px 20px 0px 20px;}

View File

@ -1,133 +0,0 @@
// src/utils/sse.js
// import store from "../store";
import tool from "@/utils/tool";
import systemConfig from '@/config';
import {eventBus} from "@/utils/eventBus";
let eventSource = null;
let reconnectTimer = null;
const reconnectDelay = 5000;
let isConnected = false;
let lockReconnect = false;
const callbacks = new Map();
const url = systemConfig.SSE_URL;
// 改进的连接管理
function createSSE(token) {
if (isConnected && eventSource) return;
closeSSE();
try {
let reToken = token === undefined ? tool.cookie.get('TOKEN') : token;
if(!reToken) return;
eventSource = new EventSource(`${url}?token=${reToken}`);
// 使用具名函数以便于移除监听器
eventSource.onopen = onOpen;
eventSource.onmessage = onMessage;
eventSource.onerror = onError;
} catch (error) {
console.error('创建SSE连接失败:', error);
handleDisconnect();
}
}
// 具名事件处理函数
function onOpen() {
isConnected = true;
console.log('SSE连接已建立');
}
function onMessage(event) {
try {
const res = JSON.parse(event.data);
// store.commit('set_sse_msg', data);
if(res && res.data){
eventBus.$emit('sseBack',res.data);
}
} catch (error) {
console.error('解析SSE数据失败:', error);
}
}
function onError() {
// error
// console.error('SSE连接错误:', error);
handleDisconnect();
}
// 改进的注册方法
function registerCallback(callback, identifier = 'default') {
// 清理同名的旧回调
if (callbacks.has(identifier)) {
callbacks.delete(identifier);
}
callbacks.set(identifier, {
fn: callback,
// 存储调用栈信息便于调试
_debug: new Error().stack.split('\n').slice(1, 4).join('\n')
});
return () => {
callbacks.delete(identifier);
console.log(`SSE回调 ${identifier} 已取消注册`);
};
}
function handleDisconnect() {
if (!isConnected) return;
isConnected = false;
// console.log('SSE连接断开尝试重连...');
if (!lockReconnect) {
lockReconnect = true;
clearTimeout(reconnectTimer);
reconnectTimer = setTimeout(() => {
lockReconnect = false;
// 重连时保留现有回调
createSSE();
}, reconnectDelay);
}
}
function restartSSE(token) {
closeSSE();
createSSE(token);
}
function closeSSE() {
if (eventSource) {
// 移除所有监听器
eventSource.onopen = null;
eventSource.onmessage = null;
eventSource.onerror = null;
eventSource.close();
eventSource = null;
}
isConnected = false;
clearTimeout(reconnectTimer);
console.log('SSE连接已关闭');
}
// 添加调试方法
function debugCallbacks() {
callbacks.forEach((value, key) => {
console.log(`回调标识: ${key}`);
});
console.groupEnd();
}
export default {
connect: createSSE,
onMessage: registerCallback,
close: closeSSE,
restart: restartSSE,
debug: debugCallbacks,
get isConnected() {
return isConnected;
}
};

View File

@ -13,7 +13,7 @@ let global_callback = function () {};
let timeoutObj = null;
let timeout = 28 * 1000; //30秒一次心跳
let serverTimeoutObj = 60; //心跳倒计时
let timeOutNum = 60; // 断开 重连倒计时
let timeOutNum = 60; //断开 重连倒计时
let lockReconnect = false; //是否真正建立连接
const wsUri = systemConfig.WS_URL;
let showNot = null;
@ -46,8 +46,7 @@ function startHeartbeat() {
start();
}
//开启心跳
function start() {
function start() {//开启心跳
timeoutObj && clearTimeout(timeoutObj);
serverTimeoutObj && clearTimeout(serverTimeoutObj);
timeoutObj = setTimeout(function () {
@ -66,16 +65,7 @@ function start() {
}
function createWebSocket(callback, token) {
// websocket.readyState 0 (CONNECTING) 1 (OPEN) 2 (CLOSING) 3 (CLOSED)
// 0 连接正在建立中,尚未连接
// 1 已经建立,可以进行通信
// 2 关闭握手过程,即将关闭
// 3 闭或者根本没有建立‌
if(websocket && websocket.readyState === 1){
return
}
if (websocket === null || websocket.readyState === 3) {
if (websocket == null || typeof websocket !== WebSocket) {
initWebSocket(callback, token);
}
}
@ -131,6 +121,7 @@ function closeSock(active) {
function webSocketOnMessage(msg) {
// 收到信息为Blob类型时
let result = null;
// debugger
// 二进制文件
if (msg.data instanceof Blob) {
const reader = new FileReader();

View File

@ -234,15 +234,12 @@ export default {
this.httpDisabled = true;
const res = await this.$API.finance.cost.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
importSuccess(){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
this.$refs.table.refresh()
},
//
@ -300,7 +297,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.finance.cost.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -247,7 +247,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.finance.cost.summaryExport.post(this.reqParams);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -1,290 +0,0 @@
<template>
<el-container class="mainBox mainBoxHeaderNoBorder">
<el-header class="header">
<div class="left-panel">
<scImport ref="scImport" :size="size" type="51" :httpDisabled="httpDisabled" title="批量导入指定预警清单" @parentParams="importUpload" @importSuccess="importSuccess">
<template #header>
<el-button v-auth="'warningExcludeImport'" type="primary" :size="size" plain @click="importFile" style="margin-right: 12px;">批量导入</el-button>
</template>
<template #download>
<div v-auth="'warningExcludeImportTemplate'" @click="importTemplate">下载导入模版</div>
</template>
</scImport>
</div>
<div class="right-panel">
</div>
</el-header>
<el-main class="nopadding">
<div class="searchMain searchMainMarginNone">
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn" v-if="searchHeaderShow">
<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" @selection-change="selectionChange" @columnBack="columnBack" border stripe :size="size">
<template #region_name="scope">
<span v-if="scope.row.region_info">{{scope.row.region_info.region_name}}</span>
</template>
</scTable>
</el-main>
</el-container>
</template>
<script>
import {eventBus} from "@/utils/eventBus";
export default {
name: 'exclude',
components: {
},
data() {
return {
fieldsShow:false,
size:'small',
httpDisabled:false,
dialog: {
save: false,
usageSave:false,
permission: false
},
exportShow:false,
list:{
apiObj: this.$API.early.exclude.list,
column:[],
fields:{}
},
searchShow:false,
searchHeaderShow:false,
filterMap:{
data:{}
},
selection: [],
params: {},
importParams:{
is_save_repeat:false
}
}
},
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
methods: {
/**
* 表格检索开始
* */
searchClick(){
this.fieldsShow = true;
},
fieldsSwitch(val){
this.fieldsShow = val;
},
fieldsSearch(params){
this.params = params;
this.upSearch();
},
columnBack(val, fieldsData){
this.list.column = val;
this.list.fields = fieldsData;
},
async filterClick(item) {
let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams);
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){
this.searchShow = !this.searchShow;
eventBus.$emit('close-all-popovers');
},
getHeaderData(params){
this.params = params;
this.filterMap.data = params;
},
async getSelectData(item) {
let {data, params} = item;
this.params = params; //
this.filterMap.data = params; //
let searchParams = this.$TOOL.objCopy(params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams);
}
},
async getField(data,searchParams) {
const res = await this.$API.early.exclude.field.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.prop];
item.value = item[data.prop];
})
}
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
}
},
/** 表格检索结束 */
//
async table_del(row){
const reqData = {ids: [row.id]};
const res = await this.$API.early.earlyWarn.delete.post(reqData);
if(res.code == 200){
this.$refs.table.refresh();
this.$message.success("删除成功");
}
},
//
async batch_del(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning'
}).then(async () => {
const loading = this.$loading();
const params = {ids: this.selection.map(em => em.id)}
const res = await this.$API.early.earlyWarn.delete.post(params);
if (res.code == 200) {
this.$refs.table.refresh()
loading.close();
this.$message.success("操作成功")
}
}).catch(() => {
})
},
//
importFile(){
this.$nextTick(()=>{
this.$refs.scImport.importFile();
})
},
async importTemplate() {
const res = await this.$API.early.exclude.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 updateOrAppend = (formData, key, value) => {
let found = false;
for (let [k] of formData.entries()) {
if (k === key) {
formData.set(k, value); //
found = true;
break;
}
}
if (!found) {
formData.append(key, value); //
}
};
updateOrAppend(params, 'is_save_repeat', this.importParams.is_save_repeat);
this.httpDisabled = true;
const res = await this.$API.early.exclude.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
},
//
selectionChange(selection){
this.selection = selection;
},
//
upSearch(){
this.$refs.table.upData(this.params);
},
reset(){
this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload();
},
//
handleSaveSuccess(){
this.$refs.table.refresh()
},
}
}
</script>
<style lang="scss" scoped>
.mainBox{
padding: 0;
}
.danger{
color: var(--el-color-danger);
}
.warning{
color: var(--el-color-warning);
}
.success{
color: var(--el-color-success);
}
</style>

View File

@ -1,38 +1,312 @@
<template>
<el-main class="tabsMain">
<el-tabs tab-position="top" class="tabsPadding" v-model="tabsTrue">
<el-tab-pane label="预警列表" name="list">
<list v-if="tabsTrue == 'list'"></list>
</el-tab-pane>
<el-container class="mainBox mainBoxHeaderNoBorder">
<el-header class="header">
<div class="left-panel">
<el-button type="primary" v-auth="'sparePartsWaterLevelWarningEdit'" :size="size" icon="el-icon-plus" @click="add">新增预警</el-button>
<el-button type="primary" v-auth="'sparePartsWaterLevelWarningBatchEdit'" :size="size" plain :disabled="selection.length==0" @click="usage">批量修改预计用量</el-button>
<el-button type="danger" v-auth="'sparePartsWaterLevelWarningDelete'" plain :size="size" icon="el-icon-Delete" :disabled="selection.length==0" @click="batch_del"></el-button>
</div>
<div class="right-panel">
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="43">
<el-button :size="size" v-auth="'sparePartsWaterLevelWarningExport'" icon="sc-icon-Download" :disabled="exportShow" @click="exportData">导出</el-button>
</scExport>
</div>
</el-header>
<el-main class="nopadding">
<div class="searchMain" :class="!searchHeaderShow?'emptySearchMain':''">
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<el-tab-pane label="指定预警清单" name="exclude">
<exclude v-if="tabsTrue == 'exclude'"></exclude>
</el-tab-pane>
</el-tabs>
</el-main>
<div class="searchItem searchBtn" v-if="searchHeaderShow">
<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" @selection-change="selectionChange" @columnBack="columnBack" border stripe :size="size">
<el-table-column type="selection" align="center" width="40"></el-table-column>
<template #region_name="scope">
<span v-if="scope.row.region_info">{{scope.row.region_info.region_name}}</span>
</template>
<template #risk_level="scope">
<span :class="{'success':scope.row.risk_level==1,'warning':scope.row.risk_level==2,'danger':scope.row.risk_level==3}">{{scope.row['risk_level']}}</span>
</template>
<template #risk_description="scope">
<span :class="{'success':scope.row.risk_level==1,'warning':scope.row.risk_level==2,'danger':scope.row.risk_level==3}">{{scope.row['risk_description']}}</span>
</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>
<span v-auth="'sparePartsWaterLevelWarningEdit'">
<el-dropdown-item @click="table_edit(scope.row, 'edit')" icon="sc-icon-Edit">编辑</el-dropdown-item>
</span>
<span v-auth="'sparePartsWaterLevelWarningDelete'">
<el-dropdown-item @click="table_del(scope.row, 'delete')" divided icon="sc-icon-Delete">删除</el-dropdown-item>
</span>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
<usageDialog v-if="dialog.usageSave" ref="usageDialog" @success="handleSaveSuccess" @closed="dialog.usageSave=false"></usageDialog>
</template>
<script>
import list from './list'
import exclude from './exclude'
import saveDialog from "./save"
import usageDialog from "./usage"
import {eventBus} from "@/utils/eventBus";
export default {
name: 'earlyManager',
components: {
list,
exclude
saveDialog,
usageDialog
},
data() {
return {
size:'small',
tabsTrue:'list',
dialog: {
save: false,
usageSave:false,
permission: false
},
exportShow:false,
list:{
apiObj: this.$API.early.earlyWarn.list,
column:[]
},
searchShow:false,
searchHeaderShow:false,
filterMap:{
data:{}
},
selection: [],
params: {}
}
},
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
methods: {
/**
* 表格检索开始
* */
columnBack(val){
this.list.column = val;
},
async filterClick(item) {
let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
if(data.prop === "region_name"){
await this.getRegionName(data, searchParams);
}else{
await this.getField(data,searchParams);
}
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){
this.searchShow = !this.searchShow;
eventBus.$emit('close-all-popovers');
},
getHeaderData(params){
this.params = params;
this.filterMap.data = params;
},
async getSelectData(item) {
let {data, params} = item;
this.params = params; //
this.filterMap.data = params; //
let searchParams = this.$TOOL.objCopy(params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
if(data.prop === "region_name"){
await this.getRegionName(data, searchParams);
}else{
await this.getField(data,searchParams)
}
}
},
async getField(data,searchParams) {
const res = await this.$API.early.earlyWarn.field.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.prop];
item.value = item[data.prop];
})
}
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
}
},
async getRegionName(data,searchParams) {
const res = await this.$API.setup.regional.regionalConstList.post(searchParams);
if(res.code == 200){
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.prop];
item.value = item[data.prop];
})
}
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
}
},
/** 表格检索结束 */
//
usage(){
this.dialog.usageSave = true
const reqData = {ids: this.selection.map(em=>em.id)};
this.$nextTick(() => {
this.$refs.usageDialog.open('edit').setData(reqData)
})
},
//
add(){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open()
})
},
//
table_edit(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('edit').setData(row)
})
},
//
table_show(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('show').setData(row)
})
},
//
async table_del(row){
const reqData = {ids: [row.id]};
const res = await this.$API.early.earlyWarn.delete.post(reqData);
if(res.code == 200){
this.$refs.table.refresh();
this.$message.success("删除成功");
}
},
//
async batch_del(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning'
}).then(async () => {
const loading = this.$loading();
const params = {ids: this.selection.map(em => em.id)}
const res = await this.$API.early.earlyWarn.delete.post(params);
if (res.code == 200) {
this.$refs.table.refresh()
loading.close();
this.$message.success("操作成功")
}
}).catch(() => {
})
},
//
selectionChange(selection){
this.selection = selection;
},
//
upSearch(){
this.$refs.table.upData(this.params);
},
reset(){
this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload();
},
//
handleSaveSuccess(){
this.$refs.table.refresh()
},
//
exportChangeShow(params){
if(params.type == 43){
this.exportShow = params.status==0?true:false
}
},
async exportData() {
if(this.exportShow) return
const res = await this.$API.early.earlyWarn.export.post(this.params);
if(res.code == 200){
this.$message.success('开始导出');
}
},
}
}
</script>
<style lang="scss" scoped>
.danger{
color: var(--el-color-danger);
}
.warning{
color: var(--el-color-warning);
}
.success{
color: var(--el-color-success);
}
</style>

View File

@ -1,402 +0,0 @@
<template>
<el-container class="mainBox mainBoxHeaderNoBorder">
<el-header class="header">
<div class="left-panel">
<el-button type="primary" v-auth="'sparePartsWaterLevelWarningEdit'" :size="size" icon="el-icon-plus" @click="add">新增预警</el-button>
<el-button type="primary" v-auth="'sparePartsWaterLevelWarningBatchEdit'" :size="size" plain :disabled="selection.length==0" @click="usage">批量修改预计用量</el-button>
<el-button type="danger" v-auth="'sparePartsWaterLevelWarningDelete'" plain :size="size" icon="el-icon-Delete" :disabled="selection.length==0" @click="batch_del"></el-button>
<scImport ref="scImport" :size="size" type="50" :httpDisabled="httpDisabled" title="批量导入预计六个月用量" @parentParams="importUpload" @importSuccess="importSuccess">
<template #header>
<el-button v-auth="'sparePartsWaterLevelWarningBatchImport'" type="primary" :size="size" plain @click="importFile" style="margin-right: 12px;">批量导入</el-button>
</template>
<template #download>
<div v-auth="'warningManagementImportTemplate'" @click="importTemplate">下载导入模版</div>
</template>
</scImport>
</div>
<div class="right-panel">
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="43">
<el-button :size="size" v-auth="'sparePartsWaterLevelWarningExport'" icon="sc-icon-Download" :disabled="exportShow" @click="exportData">导出</el-button>
</scExport>
</div>
</el-header>
<el-main class="nopadding">
<div class="fieldsSwitchBox searchConditionItem" style="margin-top: 10px;" v-if="!fieldsShow">
<div class="leftBox"></div>
<div class="rightBox" @click="searchClick">
<el-icon class="icon"><sc-icon-SwitchQuery /></el-icon>
<span class="name">切换查询方式</span>
</div>
</div>
<div class="searchMain searchMainMarginNone" :class="!searchHeaderShow?'emptySearchMain':''" v-if="!fieldsShow">
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn" v-if="searchHeaderShow">
<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>
<div class="searchMain searchMainMarginNone searchMainBodyMarginNone searchMainNoTop" v-if="fieldsShow">
<herderMultipleSearch @fieldsSwitch="fieldsSwitch" @fieldsSearch="fieldsSearch" :fieldsShow="fieldsShow" :searchList="list.fields"></herderMultipleSearch>
</div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" @selection-change="selectionChange" @columnBack="columnBack" border stripe :size="size">
<el-table-column type="selection" align="center" width="40"></el-table-column>
<template #region_name="scope">
<span v-if="scope.row.region_info">{{scope.row.region_info.region_name}}</span>
</template>
<template #risk_level="scope">
<span :class="{'success':scope.row.risk_level==1,'warning':scope.row.risk_level==2,'danger':scope.row.risk_level==3}">{{scope.row['risk_level']}}</span>
</template>
<template #risk_description="scope">
<span :class="{'success':scope.row.risk_level==1,'warning':scope.row.risk_level==2,'danger':scope.row.risk_level==3}">{{scope.row['risk_description']}}</span>
</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>
<span v-auth="'sparePartsWaterLevelWarningEdit'">
<el-dropdown-item @click="table_edit(scope.row, 'edit')" icon="sc-icon-Edit">编辑</el-dropdown-item>
</span>
<span v-auth="'sparePartsWaterLevelWarningDelete'">
<el-dropdown-item @click="table_del(scope.row, 'delete')" divided icon="sc-icon-Delete">删除</el-dropdown-item>
</span>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
<usageDialog v-if="dialog.usageSave" ref="usageDialog" @success="handleSaveSuccess" @closed="dialog.usageSave=false"></usageDialog>
</template>
<script>
import saveDialog from "./save"
import usageDialog from "./usage"
import {eventBus} from "@/utils/eventBus";
export default {
name: 'list',
components: {
saveDialog,
usageDialog
},
data() {
return {
fieldsShow:false,
size:'small',
httpDisabled:false,
dialog: {
save: false,
usageSave:false,
permission: false
},
exportShow:false,
list:{
apiObj: this.$API.early.earlyWarn.list,
column:[],
fields:{}
},
searchShow:false,
searchHeaderShow:false,
filterMap:{
data:{}
},
selection: [],
params: {},
importParams:{
is_save_repeat:false
}
}
},
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
methods: {
/**
* 表格检索开始
* */
searchClick(){
this.fieldsShow = true;
},
fieldsSwitch(val){
this.fieldsShow = val;
},
fieldsSearch(params){
this.params = params;
this.upSearch();
},
columnBack(val, fieldsData){
this.list.column = val;
this.list.fields = fieldsData;
},
async filterClick(item) {
let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
if(data.prop === "region_name"){
await this.getRegionName(data, searchParams);
}else{
await this.getField(data,searchParams);
}
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){
this.searchShow = !this.searchShow;
eventBus.$emit('close-all-popovers');
},
getHeaderData(params){
this.params = params;
this.filterMap.data = params;
},
async getSelectData(item) {
let {data, params} = item;
this.params = params; //
this.filterMap.data = params; //
let searchParams = this.$TOOL.objCopy(params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
if(data.prop === "region_name"){
await this.getRegionName(data, searchParams);
}else{
await this.getField(data,searchParams)
}
}
},
async getField(data,searchParams) {
const res = await this.$API.early.earlyWarn.field.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.prop];
item.value = item[data.prop];
})
}
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
}
},
async getRegionName(data,searchParams) {
const res = await this.$API.setup.regional.regionalConstList.post(searchParams);
if(res.code == 200){
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.prop];
item.value = item[data.prop];
})
}
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
}
},
/** 表格检索结束 */
//
usage(){
this.dialog.usageSave = true
const reqData = {ids: this.selection.map(em=>em.id)};
this.$nextTick(() => {
this.$refs.usageDialog.open('edit').setData(reqData)
})
},
//
add(){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open()
})
},
//
table_edit(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('edit').setData(row)
})
},
//
table_show(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('show').setData(row)
})
},
//
async table_del(row){
const reqData = {ids: [row.id]};
const res = await this.$API.early.earlyWarn.delete.post(reqData);
if(res.code == 200){
this.$refs.table.refresh();
this.$message.success("删除成功");
}
},
//
async batch_del(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning'
}).then(async () => {
const loading = this.$loading();
const params = {ids: this.selection.map(em => em.id)}
const res = await this.$API.early.earlyWarn.delete.post(params);
if (res.code == 200) {
this.$refs.table.refresh()
loading.close();
this.$message.success("操作成功")
}
}).catch(() => {
})
},
//
importFile(){
this.$nextTick(()=>{
this.$refs.scImport.importFile();
})
},
async importTemplate() {
const res = await this.$API.early.earlyWarn.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 updateOrAppend = (formData, key, value) => {
let found = false;
for (let [k] of formData.entries()) {
if (k === key) {
formData.set(k, value); //
found = true;
break;
}
}
if (!found) {
formData.append(key, value); //
}
};
updateOrAppend(params, 'is_save_repeat', this.importParams.is_save_repeat);
this.httpDisabled = true;
const res = await this.$API.early.earlyWarn.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
},
//
selectionChange(selection){
this.selection = selection;
},
//
upSearch(){
this.$refs.table.upData(this.params);
},
reset(){
this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload();
},
//
handleSaveSuccess(){
this.$refs.table.refresh()
},
//
exportChangeShow(params){
if(params.type == 43){
this.exportShow = params.status==0?true:false
}
},
async exportData() {
if(this.exportShow) return
const res = await this.$API.early.earlyWarn.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},
}
}
</script>
<style lang="scss" scoped>
.mainBox{
padding: 0;
}
.danger{
color: var(--el-color-danger);
}
.warning{
color: var(--el-color-warning);
}
.success{
color: var(--el-color-success);
}
</style>

View File

@ -176,7 +176,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.orders.order.maintenance.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -175,15 +175,11 @@ export default {
async importUpload(params) {
const res = await this.$API.orders.order.maintenance.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
importSuccess(){
this.$refs.table.refresh()
},
//
@ -265,7 +261,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.orders.order.maintenance.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -220,15 +220,12 @@ export default {
this.httpDisabled = true;
const res = await this.$API.orders.order.sock.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
importSuccess(){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
this.$refs.table.refresh()
},
//
@ -290,7 +287,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.orders.order.sock.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -176,15 +176,11 @@ export default {
async importUpload(params) {
const res = await this.$API.orders.order.maintenance.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
importSuccess(){
this.$refs.table.refresh()
},
//
@ -266,7 +262,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.orders.order.maintenance.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -28,17 +28,12 @@
</template>
<template v-else>
<sc-table ref="table" :data="repair_records" style="width: 100%;" :hidePagination="true" :hideDo="true" :hideEmpty="true" :size="size">
<sc-table-column align="center" prop="work_order_number" label="维修单号" :show-overflow-tooltip="true" width="160"></sc-table-column>
<sc-table-column align="center" prop="machine_sn" label="整机SN" :show-overflow-tooltip="true" width="160"></sc-table-column>
<sc-table-column align="center" prop="fault_type" label="故障类型" :show-overflow-tooltip="true" width="160"></sc-table-column>
<sc-table-column align="center" prop="part_sn_two" label="新件SN" :show-overflow-tooltip="true" width="130"></sc-table-column>
<sc-table-column align="center" prop="part_mpn_two" label="新件MPN" :show-overflow-tooltip="true" width="130"></sc-table-column>
<sc-table-column align="center" prop="part_sn_one" label="旧件SN" :show-overflow-tooltip="true" width="130"></sc-table-column>
<sc-table-column align="center" prop="part_mpn_one" label="旧件MPN" :show-overflow-tooltip="true" width="130"></sc-table-column>
<sc-table-column align="center" prop="part_mpn" label="部件MPN" :show-overflow-tooltip="true" width="160"></sc-table-column>
<sc-table-column align="center" prop="part_sn" label="部件SN" :show-overflow-tooltip="true" width="130"></sc-table-column>
<sc-table-column align="center" prop="sla" label="部件SLA" :show-overflow-tooltip="true" width="160"></sc-table-column>
<sc-table-column align="center" prop="confirmed_defects" label="不良现象" :show-overflow-tooltip="true" width="150"></sc-table-column>
<sc-table-column align="center" prop="analysis_steps" label="现场步骤分析" :show-overflow-tooltip="true" width="120"></sc-table-column>
<sc-table-column align="center" prop="sla_non_compliance_reason" label="SLA不达标原因" :show-overflow-tooltip="true" width="120"></sc-table-column>
<sc-table-column align="center" prop="remark" label="备注" :show-overflow-tooltip="true" ></sc-table-column>
<sc-table-column align="center" prop="analysis_steps" label="现场步骤分析" :show-overflow-tooltip="true" width="120"></sc-table-column>
</sc-table>
</template>
</div>
@ -96,25 +91,8 @@ export default {
}
]
}
// res.data.business_status>4
if(res.data.repair_records && res.data.repair_records.length>0){
// m_ascription 1, 2
res.data.repair_records.forEach(item=>{
item.fault_type = res.data.fault_type;
})
let m_ascription_one = res.data.repair_records.filter(item=>item.m_ascription === 1).pop();
let m_ascription_two = res.data.repair_records.filter(item=>item.m_ascription === 2).pop();
if(m_ascription_one){
m_ascription_one.part_sn_one = m_ascription_one.part_sn;
m_ascription_one.part_mpn_one = m_ascription_one.part_mpn;
}
if(m_ascription_two){
m_ascription_one.part_sn_two = m_ascription_two.part_sn;
m_ascription_one.part_mpn_two = m_ascription_two.part_mpn;
}
this.repair_records = [m_ascription_one].filter(item=>item);
if(res.data.business_status>4){
this.repair_records = res.data.repair_records;
}
}
this.loading = false;

View File

@ -25,14 +25,7 @@
<div class="flowPath">
<flow :list="flowList"/>
</div>
<div class="fieldsSwitchBox searchConditionItem" v-if="!fieldsShow">
<div class="leftBox"></div>
<div class="rightBox" @click="searchClick">
<el-icon class="icon"><sc-icon-SwitchQuery /></el-icon>
<span class="name">切换查询方式</span>
</div>
</div>
<div class="searchMain searchMainNoTop" v-if="!fieldsShow">
<div class="searchMain searchMainNoTop">
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn" v-if="searchHeaderShow">
@ -41,9 +34,6 @@
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div>
</div>
<div class="searchMain searchMainMarginNone searchMainNoTop" v-if="fieldsShow">
<herderMultipleSearch @fieldsSwitch="fieldsSwitch" @fieldsSearch="fieldsSearch" :fieldsShow="fieldsShow" :searchList="list.fields"></herderMultipleSearch>
</div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe :size="size" border highlightCurrentRow :hideTotal="false" @selection-change="selectionChange" @columnBack="columnBack">
<el-table-column type="selection" align="center" width="40"></el-table-column>
<template #business_status="scope">
@ -109,7 +99,6 @@ export default {
},
data() {
return {
fieldsShow:false,
size:'small',
httpDisabled:false,
flowList:[
@ -128,7 +117,6 @@ export default {
list: {
apiObj: this.$API.orders.order.maintenance.list,
column: [],
fields:{}
},
selection: [],
exportShow:false,
@ -182,25 +170,13 @@ export default {
/**
* 表格检索开始
* */
searchClick(){
this.fieldsShow = true;
},
fieldsSwitch(val){
this.fieldsShow = val;
},
fieldsSearch(params){
this.params = params;
this.upSearch();
},
columnBack(val,fieldsData){
columnBack(val){
val.forEach(item=>{
if(item.prop === "business_status"){
item.data = this.setMap.statusList;
}
})
this.list.column = val;
this.list.fields = fieldsData;
},
async filterClick(item) {
let {data, params} = item;
@ -302,16 +278,13 @@ export default {
async importUpload(params) {
this.httpDisabled = true;
const res = await this.$API.orders.order.maintenance.import.post(params);
if(res.code === 200){
this.$refs.scImport.setAnalysisShow(true);
if(res.code == 200){
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
importSuccess(){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
this.$refs.table.refresh()
},
//
@ -440,7 +413,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.orders.order.maintenance.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -9,14 +9,7 @@
<div class="flowPath">
<flow :list="flowList"/>
</div>
<div class="fieldsSwitchBox searchConditionItem" v-if="!fieldsShow">
<div class="leftBox"></div>
<div class="rightBox" @click="searchClick">
<el-icon class="icon"><sc-icon-SwitchQuery /></el-icon>
<span class="name">切换查询方式</span>
</div>
</div>
<div class="searchMain searchMainNoTop" v-if="!fieldsShow">
<div class="searchMain searchMainNoTop">
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn" v-if="searchHeaderShow">
@ -25,18 +18,15 @@
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div>
</div>
<div class="searchMain searchMainMarginNone searchMainNoTop" v-if="fieldsShow">
<herderMultipleSearch @fieldsSwitch="fieldsSwitch" @fieldsSearch="fieldsSearch" :fieldsShow="fieldsShow" :searchList="list.fields"></herderMultipleSearch>
</div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" :params="params" row-key="id" stripe border :size="size" @selection-change="selectionChange" @columnBack="columnBack">
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @selection-change="selectionChange" @columnBack="columnBack">
<el-table-column type="selection" align="center" width="40"></el-table-column>
<template #repair_date="scope">{{scope.row.repair_order && scope.row.repair_order.repair_date?scope.row.repair_order.repair_date:''}}</template>
<template #schedule_date="scope">{{scope.row.repair_order && scope.row.repair_order.schedule_date?scope.row.repair_order.schedule_date:''}}</template>
<template #business_status="scope">
<span v-if="scope.row.business_status">
<template #repair_status="scope">
<span v-if="scope.row.repair_order && scope.row.repair_order.repair_status">
<span v-for="(item,ind) in setMap.statusList" :key="ind">
<span :style="{color:item.value==1?`var(--el-order-color-1)`:item.value==2?`var(--el-order-color-2)`:item.value==3?`var(--el-order-color-3)`:item.value==4?`var(--el-order-color-4)`:`var(--el-order-color-100)`}"
v-if="item.value == scope.row.business_status">{{item.label}}</span>
v-if="item.value == scope.row.repair_order.repair_status">{{item.label}}</span>
</span>
</span>
<span v-else :style="{color:`var(--el-order-color-1)`}">待确认</span>
@ -79,7 +69,6 @@ export default {
},
data() {
return {
fieldsShow:false,
size:'small',
flowList:[
{name:'确认工单',left:false,right:true},
@ -95,7 +84,6 @@ export default {
list: {
apiObj: this.$API.orders.order.plan.list,
column: [],
fields:{}
},
selection: [],
exportShow:false,
@ -104,12 +92,7 @@ export default {
filterMap:{
data:{}
},
params: {
business_status:{
operator:"in",
value:[3]
}
},
params: {},
}
},
provide(){
@ -139,31 +122,19 @@ export default {
},
methods: {
async getStatusList() {
const res = await this.$API.orders.order.maintenance.status.post();
const res = await this.$API.orders.order.repair.status.post();
if (res.code == 200) {
this.setMap.statusList = res.data;
}
},
/** 检索开始 */
searchClick(){
this.fieldsShow = true;
},
fieldsSwitch(val){
this.fieldsShow = val;
},
fieldsSearch(params){
this.params = params;
this.upSearch();
},
columnBack(val,fieldsData){
columnBack(val){
val.forEach(item=>{
if(item.prop === "business_status"){
if(item.prop === "repair_status"){
item.data = this.setMap.statusList;
}
})
this.list.column = val;
this.list.fields = fieldsData;
},
async filterClick(item) {
let {data, params} = item;
@ -217,7 +188,7 @@ export default {
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
if (data.prop === 'business_status') {
if (data.prop === 'repair_status') {
this.setMap.statusList.forEach(em => {
if (em.value === item[data.prop]) {
item.label = em.label;
@ -264,16 +235,11 @@ export default {
this.$refs.table.upData(this.params);
},
reset(){
this.params = {
business_status:{
operator:"in",
value:[3]
}
};
this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload(this.params);
this.$refs.table.reload();
},
handleSaveSuccess(){
this.$refs.table.refresh();

View File

@ -73,8 +73,8 @@
<span class="name">维修动作</span>
<span class="text">
<el-radio-group v-model="item.repair_action" @change="repairAction" :size="size" :disabled="info.repair_order && info.repair_order.repair_status=== 4">
<el-radio :value="1" :label="1">修复</el-radio>
<el-radio :value="2" :label="2">更换</el-radio>
<el-radio :value="1" :label="1">更换</el-radio>
<el-radio :value="2" :label="2">修复</el-radio>
<el-radio :value="3" :label="3">无需修复</el-radio>
</el-radio-group>
</span>
@ -82,23 +82,23 @@
</el-row>
<el-row :gutter="24" style="margin: 0" v-if="item.repair_action != 3 && index==0">
<el-col :span="6" :lg="6" :md="8" :xs="24">
<span class="name" :class="item.repair_action==2?'required':''">不良现象</span>
<span class="name" :class="item.repair_action==1?'required':''">不良现象</span>
<div class="text">
<el-input :size="size" v-model="item.confirmed_defects" placeholder="不良现象"></el-input>
</div>
</el-col>
<el-col :span="6" :lg="6" :md="8" :xs="24">
<span class="name" :class="item.repair_action==1 || item.repair_action==2?'required':''">SLA不达标原因</span>
<span class="name">SLA不达标原因</span>
<div class="text">
<el-input :size="size" v-model="params.sla_reason"
<el-input :size="size" v-model="item.sla_non_compliance_reason"
placeholder="SLA不达标原因"></el-input>
</div>
</el-col>
</el-row>
<el-row :gutter="24" style="margin: 0" v-if="item.repair_action != 3 && index==0">
<el-col :span="12" :lg="12" :md="12" :xs="24">
<span class="name" :class="item.repair_action==2?'required':''">现场步骤分析</span>
<span class="name" :class="item.repair_action==1?'required':''">现场步骤分析</span>
<div class="text">
<el-input type="textarea" :size="size" v-model="item.analysis_steps"
placeholder="现场步骤分析"></el-input>
@ -114,20 +114,14 @@
{{scope.row.m_ascription===1?'旧部件':'新部件'}}
</template>
</el-table-column>
<el-table-column prop="part_mpn" label="部件MPN" :show-overflow-tooltip="false" width="250">
<el-table-column prop="part_mpn" label="部件MPN" :show-overflow-tooltip="true" width="240">
<template #default="scope">
<div class="flexBox">
<span class="requiredText" v-if="item.repair_action==2">*</span>
<el-input :size="size" v-model="scope.row.part_mpn" placeholder="部件MPN" style="width: 230px;"></el-input>
</div>
<el-input :size="size" v-model="scope.row.part_mpn" placeholder="部件MPN"></el-input>
</template>
</el-table-column>
<el-table-column prop="part_sn" label="部件SN" :show-overflow-tooltip="false" width="250">
<el-table-column prop="part_sn" label="部件SN" :show-overflow-tooltip="true" width="240">
<template #default="scope">
<div class="flexBox">
<span class="requiredText" v-if="item.repair_action==2">*</span>
<el-input :size="size" v-model="scope.row.part_sn" placeholder="部件SN" style="width: 230px;"></el-input>
</div>
<el-input :size="size" v-model="scope.row.part_sn" placeholder="部件SN"></el-input>
</template>
</el-table-column>
</sc-table>
@ -160,7 +154,6 @@
params: {
order_id: Number(this.$route.query.order_id),
repair_id: Number(this.$route.query.id),
sla_reason:"",
repair_info: [
{
m_ascription:1, // 1 2
@ -221,7 +214,7 @@
await this.$API.orders.order.repair.repairing.post(params);
},
repairAction(e){
if(e===2){
if(e===1){
const un_repair_action = this.params.repair_info.find(em=>em.m_ascription===2);
if(!un_repair_action){
this.params.repair_info.push({
@ -234,7 +227,7 @@
repair_action: 3
})
}
}else if(e===1){
}else if(e===2){
this.params.repair_info = this.params.repair_info.filter(em=>em.m_ascription===1);
}
},
@ -249,11 +242,11 @@
em.confirmed_defects = data.repair_info[0].confirmed_defects;
em.sla_non_compliance_reason = data.repair_info[0].sla_non_compliance_reason;
})
// const repair_action_num = data.repair_info[0].repair_action;
data.repair_info.forEach((item) => {
// if(repair_action_num===1 && index===0){
// data.repair_info.splice(index,1);
// }
const repair_action_num = data.repair_info[0].repair_action;
data.repair_info.forEach((item,index) => {
if(repair_action_num!=1 && index!==0){
data.repair_info.splice(index,1);
}
if (item.repair_action === 3) {
delete item.part_mpn
delete item.part_sn
@ -263,7 +256,7 @@
}
});
const row = data.repair_info.find(em=>em.m_ascription === 1);
if(row && row.repair_action===2){
if(row && row.repair_action===1){
if(row.confirmed_defects == ''){
this.$message.warning('不良现象不能为空');
return
@ -334,17 +327,7 @@
color: var(--el-color-danger);
}
}
.flexBox{
display: flex;
align-items: center;
.requiredText{
height: 100%;
display: flex;
align-items: center;
color: var(--el-color-danger);
margin-right: 4px;
}
}
.btnBox {
text-align: right;
}

View File

@ -3,14 +3,6 @@
<el-header class="header">
<div class="left-panel">
<el-button type="primary" :disabled="selection.length!==1" :size="size" icon="sc-icon-MaintenanceSetup" @click="upkeep">执行维修</el-button>
<scImport ref="scImport" :size="size" type="49" :httpDisabled="httpDisabled" title="批量导入维修工单" @parentParams="importUpload" @importSuccess="importSuccess">
<template #header>
<el-button v-auth="'repairOrderImport'" type="primary" :size="size" plain @click="importFile" style="margin-right: 12px;">批量导入</el-button>
</template>
<template #download>
<div v-auth="'repairOrderImportTemplate'" @click="importTemplate">下载导入模版</div>
</template>
</scImport>
</div>
<div class="right-panel">
@ -20,14 +12,7 @@
<div class="flowPath">
<flow :list="flowList"/>
</div>
<div class="fieldsSwitchBox searchConditionItem" v-if="!fieldsShow">
<div class="leftBox"></div>
<div class="rightBox" @click="searchClick">
<el-icon class="icon"><sc-icon-SwitchQuery /></el-icon>
<span class="name">切换查询方式</span>
</div>
</div>
<div class="searchMain searchMainNoTop" v-if="!fieldsShow">
<div class="searchMain searchMainNoTop">
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn" v-if="searchHeaderShow">
@ -36,10 +21,7 @@
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div>
</div>
<div class="searchMain searchMainMarginNone searchMainNoTop" v-if="fieldsShow">
<herderMultipleSearch @fieldsSwitch="fieldsSwitch" @fieldsSearch="fieldsSearch" :fieldsShow="fieldsShow" :searchList="list.fields"></herderMultipleSearch>
</div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" :params="params" row-key="id" stripe border :size="size" :hideTotal="false" @selection-change="selectionChange" @columnBack="columnBack">
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" :hideTotal="false" @selection-change="selectionChange" @columnBack="columnBack">
<el-table-column type="selection" align="center" width="40"></el-table-column>
<template #repair_status="scope">
<span v-for="(item,ind) in setMap.statusList" :key="ind">
@ -86,9 +68,7 @@ export default {
},
data() {
return {
fieldsShow:false,
size:'small',
httpDisabled:false,
flowList:[
{name:'维修确认',left:false,right:true},
{name:'维修中',left:true,right:true},
@ -104,7 +84,6 @@ export default {
list: {
apiObj: this.$API.orders.order.repair.list,
column: [],
fields:{}
},
selection: [],
exportShow:false,
@ -113,12 +92,7 @@ export default {
filterMap:{
data:{}
},
params: {
repair_status:{
operator:"in",
value:[2,3]
}
},
params: {},
countParams:this.$store.state.msg.repair_count
}
},
@ -171,24 +145,12 @@ export default {
/**
* 表格检索开始
* */
searchClick(){
this.fieldsShow = true;
},
fieldsSwitch(val){
this.fieldsShow = val;
},
fieldsSearch(params){
this.params = params;
this.upSearch();
},
columnBack(val, fieldsData){
columnBack(val){
val.forEach(item=>{
if(item.prop === "repair_status"){
item.data = this.setMap.statusList;
}
})
this.list.fields = fieldsData;
this.list.column = val;
},
async filterClick(item) {
@ -239,14 +201,6 @@ export default {
}
},
async getField(data,searchParams) {
this.params.repair_status = {
operator:"in",
value:[2,3]
};
searchParams.repair_status = {
operator:"in",
value:[2,3]
};
const res = await this.$API.orders.order.repair.field.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
@ -280,40 +234,6 @@ export default {
this.$refs.saveDialog.open()
})
},
//
importFile(){
this.$nextTick(()=>{
this.$refs.scImport.importFile();
})
},
async importTemplate() {
const res = await this.$API.orders.order.repair.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) {
this.httpDisabled = true;
const res = await this.$API.orders.order.repair.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
},
upkeep(){
const row = this.selection[0];
eventBus.$emit('tagClose','/order/repair-action',{id:row.id,order_id:row.order_id});
@ -351,23 +271,14 @@ export default {
this.selection = selection;
},
upSearch(){
this.params.repair_status = {
operator:"in",
value:[2,3]
};
this.$refs.table.upData(this.params);
},
reset(){
this.params = {
repair_status:{
operator:"in",
value:[2,3]
}
};
this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload(this.params);
this.$refs.table.reload();
},
handleSaveSuccess(){
this.$refs.table.refresh();

View File

@ -1,17 +1,18 @@
<template>
<el-container class="mainBox mainHeaderNoBorderPadding">
<el-header class="header">
<div class="left-panel">
<el-button type="primary" :disabled="selection.length!==1" :size="size" icon="sc-icon-MaintenanceSetup" @click="upkeep">执行维修</el-button>
</div>
<div class="right-panel">
</div>
</el-header>
<el-main class="nopadding">
<div class="flowPath">
<flow :list="flowList"/>
</div>
<div class="fieldsSwitchBox searchConditionItem" v-if="!fieldsShow">
<div class="leftBox"></div>
<div class="rightBox" @click="searchClick">
<el-icon class="icon"><sc-icon-SwitchQuery /></el-icon>
<span class="name">切换查询方式</span>
</div>
</div>
<div class="searchMain searchMainNoTop" v-if="!fieldsShow">
<div class="searchMain searchMainNoTop">
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn" v-if="searchHeaderShow">
@ -20,10 +21,8 @@
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div>
</div>
<div class="searchMain searchMainMarginNone searchMainNoTop" v-if="fieldsShow">
<herderMultipleSearch @fieldsSwitch="fieldsSwitch" @fieldsSearch="fieldsSearch" :fieldsShow="fieldsShow" :searchList="list.fields"></herderMultipleSearch>
</div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" :params="params" row-key="id" stripe border :size="size" @selection-change="selectionChange" @columnBack="columnBack">
<el-table-column type="selection" align="center" width="40"></el-table-column>
<template #repair_status="scope">
<span v-for="(item,ind) in setMap.statusList" :key="ind">
<span :style="{color:item.value==1?`var(--el-order-color-1)`:item.value==2?`var(--el-order-color-2)`:item.value==3?`var(--el-order-color-3)`:item.value==4?`var(--el-order-color-4)`:`var(--el-order-color-100)`}"
@ -36,6 +35,7 @@
<el-button class="noBorderBtn" icon="el-icon-more" :size="size"></el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item icon="sc-icon-MaintenanceSetup" @click="table_upkeep(scope.row)">执行维修</el-dropdown-item>
<el-dropdown-item icon="sc-icon-See" @click="table_show(scope.row, 'see')">工单详情</el-dropdown-item>
<el-dropdown-item icon="sc-icon-OrderLog" @click="table_logs(scope.row)" divided>工单日志</el-dropdown-item>
</el-dropdown-menu>
@ -60,7 +60,6 @@ export default {
},
data() {
return {
fieldsShow:false,
size:'small',
flowList:[
{name:'维修确认',left:false,right:true},
@ -77,7 +76,6 @@ export default {
list: {
apiObj: this.$API.orders.order.repair.list,
column: [],
fields:{}
},
selection: [],
exportShow:false,
@ -144,24 +142,12 @@ export default {
/**
* 表格检索开始
* */
searchClick(){
this.fieldsShow = true;
},
fieldsSwitch(val){
this.fieldsShow = val;
},
fieldsSearch(params){
this.params = params;
this.upSearch();
},
columnBack(val, fieldsData){
columnBack(val){
val.forEach(item=>{
if(item.prop === "repair_status"){
item.data = this.setMap.statusList;
}
})
this.list.fields = fieldsData;
this.list.column = val;
},
async filterClick(item) {
@ -212,15 +198,6 @@ export default {
}
},
async getField(data,searchParams) {
// params searchParams
this.params.repair_status = {
operator:"in",
value:[4]
};
searchParams.repair_status = {
operator:"in",
value:[4]
};
const res = await this.$API.orders.order.repair.field.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
@ -291,10 +268,6 @@ export default {
this.selection = selection;
},
upSearch(){
this.params.repair_status = {
operator:"in",
value:[4]
};
this.$refs.table.upData(this.params);
},
reset(){
@ -330,9 +303,6 @@ export default {
padding: 0 10px;
}
}
.mainHeaderNoBorderPadding{
padding-top: 10px;
}
.logoCell{
display: flex;
align-items: center;

View File

@ -175,15 +175,11 @@ export default {
async importUpload(params) {
const res = await this.$API.orders.order.maintenance.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
importSuccess(){
this.$refs.table.refresh()
},
//
@ -265,7 +261,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.orders.order.maintenance.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -175,15 +175,11 @@ export default {
async importUpload(params) {
const res = await this.$API.orders.order.maintenance.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
importSuccess(){
this.$refs.table.refresh()
},
//
@ -265,7 +261,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.orders.order.maintenance.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -13,8 +13,8 @@
<div class="name">维修数据确认模式</div>
<div class="boxView">
<el-radio-group :size="size" v-model="mail.is_auto_repair">
<el-radio label="false">手动确认</el-radio>
<el-radio label="true">自动确认</el-radio>
<el-radio :value="false">手动确认</el-radio>
<el-radio :value="true">自动确认</el-radio>
</el-radio-group>
</div>
</div>

View File

@ -111,15 +111,12 @@ export default {
this.httpDisabled = true;
const res = await this.$API.setup.material.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
importSuccess(){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
this.$refs.table.refresh()
},
//

View File

@ -128,15 +128,12 @@ export default {
this.httpDisabled = true;
const res = await this.$API.setup.regional.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
importSuccess(){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
this.$refs.table.refresh()
},
//

View File

@ -22,11 +22,6 @@
<el-table-column type="selection" align="center" width="40"></el-table-column>
<el-table-column width="200" label="备件类别" prop="spare_parts_category"></el-table-column>
<el-table-column width="200" label="故障率" prop="failure_rate"></el-table-column>
<el-table-column width="200" label="故障率计算时长" prop="duration">
<template #default="scope">
<span>{{scope.row.duration && scope.row.duration>0?scope.row.duration+'个月':scope.row.duration}}</span>
</template>
</el-table-column>
<el-table-column width="200" label="配置人" prop="creator_name"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="160">
<template #default="scope">
@ -111,15 +106,12 @@ export default {
this.httpDisabled = true;
const res = await this.$API.setup.spare.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
importSuccess(){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
this.$refs.table.refresh()
},
//
selectionChange(selection){

View File

@ -208,15 +208,12 @@ export default {
this.httpDisabled = true;
const res = await this.$API.setup.bom.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
importSuccess(){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
this.$refs.table.refresh()
},
//
@ -277,7 +274,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.setup.bom.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -282,15 +282,12 @@ export default {
this.httpDisabled = true;
const res = await this.$API.system.company.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
importSuccess(){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
this.$refs.table.refresh()
},
//
@ -372,7 +369,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.system.company.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -189,14 +189,13 @@ export default {
//
exportChangeShow(params){
if(params.type == 8){
this.exportShow = params.status==0?true:false;
this.exportShow = params.status==0?true:false
}
},
async exportData() {
if(this.exportShow) return
const res = await this.$API.system.log.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -70,7 +70,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.system.log.commandExport.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -244,15 +244,12 @@ export default {
this.httpDisabled = true;
const res = await this.$API.system.spareInfo.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
importSuccess(){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
this.$refs.table.refresh()
},
//
table_edit(row){
@ -317,7 +314,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.system.spareInfo.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -21,14 +21,7 @@
</div>
</el-header>
<el-main class="nopadding">
<div class="fieldsSwitchBox searchConditionItem" v-if="!fieldsShow">
<div class="leftBox"></div>
<div class="rightBox" @click="searchClick">
<el-icon class="icon"><sc-icon-SwitchQuery /></el-icon>
<span class="name">切换查询方式</span>
</div>
</div>
<div class="searchMain searchMainNoTop" v-if="!fieldsShow">
<div class="searchMain searchMainNoTop">
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn" v-if="searchHeaderShow">
@ -37,9 +30,6 @@
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div>
</div>
<div class="searchMain searchMainMarginNone searchMainNoTop" v-if="fieldsShow">
<herderMultipleSearch @fieldsSwitch="fieldsSwitch" @fieldsSearch="fieldsSearch" :fieldsShow="fieldsShow" :searchList="list.fields"></herderMultipleSearch>
</div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" @selection-change="selectionChange" @columnBack="columnBack" stripe border :size="size">
<el-table-column type="selection" align="center" width="40"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150">
@ -80,7 +70,6 @@ export default {
},
data(){
return{
fieldsShow:false,
size:'small',
httpDisabled:false,
setMap:{
@ -92,8 +81,7 @@ export default {
},
list:{
apiObj: this.$API.system.spare.list,
column:[],
fields:{}
column:[]
},
selection: [],
exportShow:false,
@ -132,24 +120,13 @@ export default {
},
methods:{
/** 检索开始 */
searchClick(){
this.fieldsShow = true;
},
fieldsSwitch(val){
this.fieldsShow = val;
},
fieldsSearch(params){
this.params = params;
this.upSearch();
},
columnBack(val,fieldsData){
columnBack(val){
val.forEach(item=>{
if(item.prop === "company_type"){
item.data = this.setMap.companyType;
}
})
this.list.column = val;
this.list.fields = fieldsData;
},
async filterClick(item) {
let {data, params} = item;
@ -246,15 +223,12 @@ export default {
this.httpDisabled = true;
const res = await this.$API.system.spare.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
importSuccess(){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
this.$refs.table.refresh()
},
//
@ -321,7 +295,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.system.spare.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -300,15 +300,12 @@
this.httpDisabled = true;
const res = await this.$API.system.user.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
importSuccess(){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
this.$refs.table.refresh()
},
//
@ -439,7 +436,6 @@
if(this.exportShow) return
const res = await this.$API.system.user.export.post();
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -43,7 +43,7 @@
<el-input v-model="form.mobile" placeholder="请填写联系电话" clearable></el-input>
</el-form-item>
<el-form-item label="电子邮件" prop="email">
<el-input v-model="form.email" :disabled="mode!=='add'" placeholder="请填写电子邮件" clearable></el-input>
<el-input v-model="form.email" placeholder="请填写电子邮件" clearable></el-input>
</el-form-item>
</div>

View File

@ -176,15 +176,11 @@ export default {
async importUpload(params) {
const res = await this.$API.orders.order.maintenance.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
importSuccess(){
this.$refs.table.refresh()
},
//
@ -266,7 +262,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.orders.order.maintenance.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -182,7 +182,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.shipment.out.bomExport.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -1,14 +1,7 @@
<template>
<el-container class="mainBox mainBoxHeaderNoBorder">
<el-main class="nopadding">
<div class="fieldsSwitchBox searchConditionItem" style="margin-top: 10px" v-if="!fieldsShow">
<div class="leftBox"></div>
<div class="rightBox" @click="searchClick">
<el-icon class="icon"><sc-icon-SwitchQuery /></el-icon>
<span class="name">切换查询方式</span>
</div>
</div>
<div class="searchMain searchMainMarginNone" v-if="!fieldsShow">
<div class="searchMain">
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn" v-if="searchHeaderShow">
@ -32,9 +25,6 @@
</scExport>
</div>
</div>
<div class="searchMain searchMainMarginNone searchMainBodyMarginNone searchMainNoTop" v-if="fieldsShow">
<herderMultipleSearch @fieldsSwitch="fieldsSwitch" @fieldsSearch="fieldsSearch" :fieldsShow="fieldsShow" :searchList="list.fields"></herderMultipleSearch>
</div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @selection-change="selectionChange" @columnBack="columnBack">
<el-table-column type="selection" align="center" width="40"></el-table-column>
<template #logo="scope">
@ -63,7 +53,6 @@ export default {
},
data() {
return {
fieldsShow:false,
size:'small',
httpDisabled:false,
dialog: {
@ -73,7 +62,6 @@ export default {
list: {
apiObj: this.$API.shipment.out.stockImport,
column: [],
fields:{}
},
selection: [],
exportShow:false,
@ -112,20 +100,8 @@ export default {
},
methods: {
/** 检索开始 */
searchClick(){
this.fieldsShow = true;
},
fieldsSwitch(val){
this.fieldsShow = val;
},
fieldsSearch(params){
this.params = params;
this.upSearch();
},
columnBack(val, fieldsData){
columnBack(val){
this.list.column = val;
this.list.fields = fieldsData;
},
async filterClick(item) {
let {data, params} = item;
@ -235,18 +211,13 @@ export default {
};
updateOrAppend(params, 'is_save_repeat', this.importParams.is_save_repeat);
this.httpDisabled = true;
const res = await this.$API.shipment.out.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
importSuccess(){
this.$refs.table.refresh()
},
//
batch_del(){
@ -277,7 +248,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.shipment.out.stockExport.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -176,15 +176,11 @@ export default {
async importUpload(params) {
const res = await this.$API.orders.order.maintenance.import.post(params);
if(res.code == 200){
this.$refs.scImport.setAnalysisShow(true);
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(refresh){
this.httpDisabled = false;
if(!refresh){
this.$refs.table.refresh()
}
importSuccess(){
this.$refs.table.refresh()
},
//
@ -266,7 +262,6 @@ export default {
if(this.exportShow) return
const res = await this.$API.orders.order.maintenance.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},

View File

@ -52,7 +52,6 @@
logs: defineAsyncComponent(() => import('./user/logs')),
upToEnterprise: defineAsyncComponent(() => import('./user/upToEnterprise')),
bind: defineAsyncComponent(() => import('./user/bind')),
ExportLog: defineAsyncComponent(() => import('./user/exportLog')),
},
data() {
return {
@ -85,11 +84,6 @@
{
groupName: "数据管理",
list: [
{
icon: "sc-icon-ExportLog",
title: "导出记录",
component: "exportLog"
},
{
icon: "sc-icon-UserLog",
title: "操作日志",

View File

@ -21,7 +21,7 @@
</div>
</el-form-item>
<el-form-item label="邮箱地址" prop="email">
<el-input v-model="form.email" disabled></el-input>
<el-input v-model="form.email"></el-input>
</el-form-item>
<el-form-item label="个性签名" prop="about">
<el-input v-model="form.about" type="textarea"></el-input>

View File

@ -1,190 +0,0 @@
<template>
<el-card class="logCard" shadow="never" header="导出记录">
<el-main class="nopadding">
<div class="searchMain logSearchMain">
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn" v-if="searchHeaderShow">
<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 class="exportBtn">
</div>
</div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @row-click="rowClick" @columnBack="columnBack">
<template #file_url="scope">
<span class="tableColor primary" @click="linkExcel(scope.row)"><el-icon><sc-icon-Excel/></el-icon> </span>
</template>
</scTable>
</el-main>
</el-card>
</template>
<script>
import {eventBus} from "@/utils/eventBus";
export default {
name: 'exportLog',
components:{
},
data() {
return {
size:"small",
setMap:{
},
list:{
apiObj: this.$API.user.record,
column: [],
},
exportShow:false,
searchShow:false,
searchHeaderShow:false,
filterMap:{
data:{}
},
params: {},
}
},
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
mounted() {
},
methods:{
/**
* 表格检索开始
* */
columnBack(val){
val.forEach(item=>{
if(item.prop === "type"){
item.data = this.setMap.typeList;
}
})
this.list.column = val;
},
async filterClick(item) {
let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.creator_id = {
operator:"in",
value:[this.$TOOL.data.get('USER_INFO').id]
};
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams);
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){
this.searchShow = !this.searchShow;
eventBus.$emit('close-all-popovers');
},
getHeaderData(params){
this.params = params;
this.filterMap.data = params;
},
async getSelectData(item) {
let {data, params} = item;
this.params = params;
this.filterMap.data = params;
let searchParams = this.$TOOL.objCopy(params);
searchParams.creator_id = {
operator:"in",
value:[this.$TOOL.data.get('USER_INFO').id]
};
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams)
}
},
async getField(data,searchParams) {
const res = await this.$API.system.log.operation.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
if (data.prop === 'type') {
item.label = item[data.prop+'_text'];
item.value = item[data.prop];
} else {
item.label = item[data.prop];
item.value = item[data.prop];
}
})
}
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
}
},
/** 表格检索结束 */
linkExcel(row){
window.open(row.file_url,'_blank');
},
upSearch(){
this.$refs.table.upData(this.params);
},
reset(){
this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload();
},
rowClick(){
}
}
}
</script>
<style lang="scss" scoped>
.logCard :deep(.el-card__body){padding: 0 !important;}
.tableColor.primary{color: var(--el-color-primary);cursor: pointer;display: flex;align-items: center;}
.tableColor .el-icon{margin-right: 8px;}
</style>

View File

@ -200,7 +200,6 @@
if(this.exportShow) return
const res = await this.$API.user.export.post(this.params);
if(res.code == 200){
this.exportShow = true;
this.$message.success('开始导出');
}
},