feat: Add import and update basic functions
This commit is contained in:
parent
925999f822
commit
88b081af32
156
config/index.js
156
config/index.js
|
@ -1,78 +1,78 @@
|
|||
"use strict";
|
||||
// Template version: 1.3.1
|
||||
// see http://vuejs-templates.github.io/webpack for documentation.
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
dev: {
|
||||
// Paths
|
||||
assetsSubDirectory: "static",
|
||||
assetsPublicPath: "/",
|
||||
proxyTable: {
|
||||
"/gyhl": {
|
||||
// target: "/gyhl", //8889
|
||||
target: "http://36.137.58.70:52/gyhl",
|
||||
// // target:"http://192.168.1.194:21925", //lj-local
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
"^/gyhl": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: "localhost", // can be overwritten by process.env.HOST
|
||||
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||
autoOpenBrowser: true,
|
||||
errorOverlay: true,
|
||||
notifyOnErrors: true,
|
||||
poll: false,
|
||||
// https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
// https://webpack.js.org/configuration/devtool/#development
|
||||
devtool: "cheap-module-eval-source-map",
|
||||
|
||||
// If you have problems debugging vue-files in devtools,
|
||||
// set this to false - it *may* help
|
||||
// https://vue-loader.vuejs.org/en/options.html#cachebusting
|
||||
cacheBusting: true,
|
||||
|
||||
cssSourceMap: true
|
||||
},
|
||||
|
||||
build: {
|
||||
// Template for index.html
|
||||
index: path.resolve(__dirname, "../gyhl/index.html"),
|
||||
|
||||
// Paths
|
||||
assetsRoot: path.resolve(__dirname, "../gyhl"),
|
||||
assetsSubDirectory: "static",
|
||||
assetsPublicPath: "/",
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
productionSourceMap: false,
|
||||
// https://webpack.js.org/configuration/devtool/#production
|
||||
devtool: "#source-map",
|
||||
|
||||
// Gzip off by default as many popular static hosts such as
|
||||
// Surge or Netlify already gzip all static assets for you.
|
||||
// Before setting to `true`, make sure to:
|
||||
// npm install --save-dev compression-webpack-plugin
|
||||
productionGzip: false,
|
||||
productionGzipExtensions: ["js", "css"],
|
||||
|
||||
// Run the build command with an extra argument to
|
||||
// View the bundle analyzer report after build finishes:
|
||||
// `npm run build --report`
|
||||
// Set to `true` or `false` to always turn it on or off
|
||||
bundleAnalyzerReport: process.env.npm_config_report
|
||||
}
|
||||
};
|
||||
"use strict";
|
||||
// Template version: 1.3.1
|
||||
// see http://vuejs-templates.github.io/webpack for documentation.
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
dev: {
|
||||
// Paths
|
||||
assetsSubDirectory: "static",
|
||||
assetsPublicPath: "/",
|
||||
proxyTable: {
|
||||
"/gyhl": {
|
||||
// target: "/gyhl", //8889
|
||||
target: "http://36.139.25.238:52/gyhl",
|
||||
// // target:"http://192.168.1.194:21925", //lj-local
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
"^/gyhl": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: "localhost", // can be overwritten by process.env.HOST
|
||||
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||
autoOpenBrowser: true,
|
||||
errorOverlay: true,
|
||||
notifyOnErrors: true,
|
||||
poll: false,
|
||||
// https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
// https://webpack.js.org/configuration/devtool/#development
|
||||
devtool: "cheap-module-eval-source-map",
|
||||
|
||||
// If you have problems debugging vue-files in devtools,
|
||||
// set this to false - it *may* help
|
||||
// https://vue-loader.vuejs.org/en/options.html#cachebusting
|
||||
cacheBusting: true,
|
||||
|
||||
cssSourceMap: true
|
||||
},
|
||||
|
||||
build: {
|
||||
// Template for index.html
|
||||
index: path.resolve(__dirname, "../gyhl/index.html"),
|
||||
|
||||
// Paths
|
||||
assetsRoot: path.resolve(__dirname, "../gyhl"),
|
||||
assetsSubDirectory: "static",
|
||||
assetsPublicPath: "/",
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
productionSourceMap: false,
|
||||
// https://webpack.js.org/configuration/devtool/#production
|
||||
devtool: "#source-map",
|
||||
|
||||
// Gzip off by default as many popular static hosts such as
|
||||
// Surge or Netlify already gzip all static assets for you.
|
||||
// Before setting to `true`, make sure to:
|
||||
// npm install --save-dev compression-webpack-plugin
|
||||
productionGzip: false,
|
||||
productionGzipExtensions: ["js", "css"],
|
||||
|
||||
// Run the build command with an extra argument to
|
||||
// View the bundle analyzer report after build finishes:
|
||||
// `npm run build --report`
|
||||
// Set to `true` or `false` to always turn it on or off
|
||||
bundleAnalyzerReport: process.env.npm_config_report
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,155 +1,186 @@
|
|||
/**
|
||||
*销售订单
|
||||
*/
|
||||
import base from './base'; // 导入接口域名列表
|
||||
import axios from '@/request'; // 导入http中创建的axios实例
|
||||
|
||||
const salesAPI = {
|
||||
// 获取销售订单列表
|
||||
listSalesContract(param) {
|
||||
return axios.get(`${base.url}/apis/salesContractApi/salesContractList`, { params: param })
|
||||
},
|
||||
productionTraceabilityListSalesContract(param) {
|
||||
return axios.get(`${base.url}/apis/productionTraceability/salesContractList`, { params: param })
|
||||
},
|
||||
// 获取销售订单导出列表
|
||||
listForExport(param) {
|
||||
return axios.get(`${base.url}/apis/salesContractApi/salesContractListForExport`, { params: param })
|
||||
},
|
||||
// 查询合同类型
|
||||
listContractType(param) {
|
||||
return axios.post(`${base.url}/apis/dict/getDictsByType`, param)
|
||||
},
|
||||
// 查询审核状态
|
||||
listAauditSign(param) {
|
||||
return axios.post(`${base.url}/apis/dict/getDictsByType`, param)
|
||||
},
|
||||
// 删除合同
|
||||
removeContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContractApi/batchRemove`, param)
|
||||
},
|
||||
// 暂存合同
|
||||
saveContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContractApi/addOrUpdate`, param)
|
||||
},
|
||||
/** 地磅生成销售 */
|
||||
saveContractFormTruck(param){
|
||||
return axios.post(`${base.url}/apis/salesContractApi/submitScalesContract`,param)
|
||||
},
|
||||
// 提交审批
|
||||
submitContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContractApi/submitContract`, param)
|
||||
},
|
||||
// 获取合同详细信息
|
||||
getContractDetail(param) {
|
||||
return axios.get(`${base.url}/apis/salesContractApi/detail`, { params: param })
|
||||
},
|
||||
// 审核合同
|
||||
auditContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContract/audit`, param)
|
||||
},
|
||||
// 反审核合同
|
||||
reverseAuditContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContract/reverseAudit`, param)
|
||||
},
|
||||
// 关闭合同
|
||||
closeContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContract/close`, param)
|
||||
},
|
||||
// 反关闭合同
|
||||
reverseClose(param) {
|
||||
return axios.post(`${base.url}/apis/salesContract/reverseClose`, param)
|
||||
},
|
||||
// 变更合同
|
||||
changeContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContractApi/edit`, param)
|
||||
},
|
||||
// 获取变更销售订单列表
|
||||
getAlterationList(param) {
|
||||
return axios.get(`${base.url}/apis/salesContractApi/alterationList`, { params: param })
|
||||
},
|
||||
// 获取变更销售订单详情
|
||||
getAlterationDetail(param) {
|
||||
return axios.get(`${base.url}/apis/salesContractApi/alterationDetail`, { params: param })
|
||||
},
|
||||
// 导出销售退货
|
||||
exportExcel(param) {
|
||||
return axios.get(`${base.url}/apis/exportExcel/salesContract`, { params: param ,responseType: "blob"})
|
||||
},
|
||||
// 销售订单导入单据
|
||||
getSalesContractList(param) {
|
||||
return axios.get(`${base.url}/apis/salesContractApi/dialog`, { params: param })
|
||||
},
|
||||
// 行关闭
|
||||
closeLine(param) {
|
||||
return axios.post(`${base.url}/apis/salesContractApi/closeLine`, param)
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
// 自定义文件名称文件下载
|
||||
downloadByCusName(param) {
|
||||
return axios.get(`${base.url}/apis/document/downloadByCusName`, { params: param })
|
||||
},
|
||||
// 单文件下载
|
||||
down(param) {
|
||||
return axios.get(`${base.url}/apis/file/down`, { params: param })
|
||||
},
|
||||
// 下载薪资档案模板
|
||||
downLoadSalaryArchives(param) {
|
||||
return axios.get(`${base.url}/apis/exportExcel/downLoadSalaryArchives`, { params: param ,responseType: "blob"})
|
||||
},
|
||||
// 下载社保模板
|
||||
downLoadSocialSecurity(param) {
|
||||
return axios.get(`${base.url}/apis/exportExcel/downLoadSocialSecurity`, { params: param ,responseType: "blob"})
|
||||
},
|
||||
// 下载个税模板
|
||||
downLoadTax(param) {
|
||||
return axios.get(`${base.url}/apis/exportExcel/downLoadTax`, { params: param ,responseType: "blob"})
|
||||
},
|
||||
// 导出薪资记录
|
||||
downLoadRecord(param) {
|
||||
return axios.get(`${base.url}/apis/exportExcel/downLoadRecord`, { params: param ,responseType: "blob"})
|
||||
},
|
||||
|
||||
// 查询合同类型
|
||||
associatedBill(param) {
|
||||
return axios({
|
||||
url:`${base.url}/apis/associatedBill/salesOrder`,
|
||||
method: 'post',
|
||||
data: param,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 获取字典列表信息
|
||||
list(param) {
|
||||
return axios.post(`${base.url}/apis/dictionary/list`, param)
|
||||
},
|
||||
|
||||
}
|
||||
export default salesAPI;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*销售订单
|
||||
*/
|
||||
import base from './base'; // 导入接口域名列表
|
||||
import axios from '@/request'; // 导入http中创建的axios实例
|
||||
|
||||
const salesAPI = {
|
||||
// 导入
|
||||
importAllFile(param,type) {
|
||||
let url = "";
|
||||
switch (type) {
|
||||
case "sales":
|
||||
url = "/apis/standard/importExcel/sales";
|
||||
break;
|
||||
case 'wlps':
|
||||
url ="/apis/mdh/shfw/importExcel";
|
||||
break;
|
||||
case 'patrolPlan':
|
||||
url ="/apis/patrolPlan/importExcel";
|
||||
break;
|
||||
case 'project':
|
||||
url ="/apis/project/importExcel";
|
||||
break;
|
||||
case 'upkeepPlan':
|
||||
url ="/apis/upkeepPlan/importExcel";
|
||||
break;
|
||||
case 'xqgl':
|
||||
url ="/apis/mdh/xqgl/importExcel";
|
||||
break;
|
||||
default:''
|
||||
}
|
||||
return axios.post(`${base.url}${url}`, param, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 获取销售订单列表
|
||||
listSalesContract(param) {
|
||||
return axios.get(`${base.url}/apis/salesContractApi/salesContractList`, { params: param })
|
||||
},
|
||||
productionTraceabilityListSalesContract(param) {
|
||||
return axios.get(`${base.url}/apis/productionTraceability/salesContractList`, { params: param })
|
||||
},
|
||||
// 获取销售订单导出列表
|
||||
listForExport(param) {
|
||||
return axios.get(`${base.url}/apis/salesContractApi/salesContractListForExport`, { params: param })
|
||||
},
|
||||
// 查询合同类型
|
||||
listContractType(param) {
|
||||
return axios.post(`${base.url}/apis/dict/getDictsByType`, param)
|
||||
},
|
||||
// 查询审核状态
|
||||
listAauditSign(param) {
|
||||
return axios.post(`${base.url}/apis/dict/getDictsByType`, param)
|
||||
},
|
||||
// 删除合同
|
||||
removeContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContractApi/batchRemove`, param)
|
||||
},
|
||||
// 暂存合同
|
||||
saveContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContractApi/addOrUpdate`, param)
|
||||
},
|
||||
/** 地磅生成销售 */
|
||||
saveContractFormTruck(param){
|
||||
return axios.post(`${base.url}/apis/salesContractApi/submitScalesContract`,param)
|
||||
},
|
||||
// 提交审批
|
||||
submitContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContractApi/submitContract`, param)
|
||||
},
|
||||
// 获取合同详细信息
|
||||
getContractDetail(param) {
|
||||
return axios.get(`${base.url}/apis/salesContractApi/detail`, { params: param })
|
||||
},
|
||||
// 审核合同
|
||||
auditContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContract/audit`, param)
|
||||
},
|
||||
// 反审核合同
|
||||
reverseAuditContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContract/reverseAudit`, param)
|
||||
},
|
||||
// 关闭合同
|
||||
closeContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContract/close`, param)
|
||||
},
|
||||
// 反关闭合同
|
||||
reverseClose(param) {
|
||||
return axios.post(`${base.url}/apis/salesContract/reverseClose`, param)
|
||||
},
|
||||
// 变更合同
|
||||
changeContract(param) {
|
||||
return axios.post(`${base.url}/apis/salesContractApi/edit`, param)
|
||||
},
|
||||
// 获取变更销售订单列表
|
||||
getAlterationList(param) {
|
||||
return axios.get(`${base.url}/apis/salesContractApi/alterationList`, { params: param })
|
||||
},
|
||||
// 获取变更销售订单详情
|
||||
getAlterationDetail(param) {
|
||||
return axios.get(`${base.url}/apis/salesContractApi/alterationDetail`, { params: param })
|
||||
},
|
||||
// 导出销售退货
|
||||
exportExcel(param) {
|
||||
return axios.get(`${base.url}/apis/exportExcel/salesContract`, { params: param ,responseType: "blob"})
|
||||
},
|
||||
// 销售订单导入单据
|
||||
getSalesContractList(param) {
|
||||
return axios.get(`${base.url}/apis/salesContractApi/dialog`, { params: param })
|
||||
},
|
||||
// 行关闭
|
||||
closeLine(param) {
|
||||
return axios.post(`${base.url}/apis/salesContractApi/closeLine`, param)
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
// 自定义文件名称文件下载
|
||||
downloadByCusName(param) {
|
||||
return axios.get(`${base.url}/apis/document/downloadByCusName`, { params: param })
|
||||
},
|
||||
// 单文件下载
|
||||
down(param) {
|
||||
return axios.get(`${base.url}/apis/file/down`, { params: param })
|
||||
},
|
||||
// 下载薪资档案模板
|
||||
downLoadSalaryArchives(param) {
|
||||
return axios.get(`${base.url}/apis/exportExcel/downLoadSalaryArchives`, { params: param ,responseType: "blob"})
|
||||
},
|
||||
// 下载社保模板
|
||||
downLoadSocialSecurity(param) {
|
||||
return axios.get(`${base.url}/apis/exportExcel/downLoadSocialSecurity`, { params: param ,responseType: "blob"})
|
||||
},
|
||||
// 下载个税模板
|
||||
downLoadTax(param) {
|
||||
return axios.get(`${base.url}/apis/exportExcel/downLoadTax`, { params: param ,responseType: "blob"})
|
||||
},
|
||||
// 导出薪资记录
|
||||
downLoadRecord(param) {
|
||||
return axios.get(`${base.url}/apis/exportExcel/downLoadRecord`, { params: param ,responseType: "blob"})
|
||||
},
|
||||
|
||||
// 查询合同类型
|
||||
associatedBill(param) {
|
||||
return axios({
|
||||
url:`${base.url}/apis/associatedBill/salesOrder`,
|
||||
method: 'post',
|
||||
data: param,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 获取字典列表信息
|
||||
list(param) {
|
||||
return axios.post(`${base.url}/apis/dictionary/list`, param)
|
||||
},
|
||||
|
||||
}
|
||||
export default salesAPI;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,169 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
width="500px"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="uploadForm" :model="form" label-width="80px">
|
||||
<el-form-item label="选择文件">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action="#"
|
||||
drag
|
||||
:http-request="customUpload"
|
||||
:headers="uploadHeaders"
|
||||
:data="uploadData"
|
||||
:before-upload="beforeUpload"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:on-change="handleChange"
|
||||
:auto-upload="false"
|
||||
:file-list="fileList"
|
||||
accept=".xlsx,.xls"
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
只能上传Excel文件,且不超过10MB
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
<el-button type="primary" @click="submitUpload" :loading="uploading">
|
||||
{{ uploading ? '上传中...' : '确 定' }}
|
||||
</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DialogImportFile',
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: '导入Excel文件'
|
||||
},
|
||||
uploadData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
uploadHeaders: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
source: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: this.visible,
|
||||
fileList: [],
|
||||
uploading: false,
|
||||
form: {}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
visible(newVal) {
|
||||
this.dialogVisible = newVal;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose() {
|
||||
this.$emit('update:visible', false);
|
||||
this.$emit('close');
|
||||
this.$refs.upload.clearFiles();
|
||||
this.fileList = [];
|
||||
},
|
||||
|
||||
handleChange(file, fileList) {
|
||||
this.fileList = fileList.slice(-1);
|
||||
},
|
||||
|
||||
beforeUpload(file) {
|
||||
const isExcel =
|
||||
file.type === 'application/vnd.ms-excel' ||
|
||||
file.type ===
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
||||
const isLt10M = file.size / 1024 / 1024 < 10;
|
||||
|
||||
if (!isExcel) {
|
||||
this.$message.error('只能上传Excel文件!');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isLt10M) {
|
||||
this.$message.error('上传文件大小不能超过10MB!');
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
// 自定义上传方法
|
||||
async customUpload(options) {
|
||||
const { file, onSuccess, onError } = options;
|
||||
try {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
this.$api.salesAPI.importAllFile(formData,this.source).then(response => {
|
||||
console.log('上传成功', response);
|
||||
}).catch(error => {
|
||||
console.error('上传失败', error);
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
onError(error);
|
||||
}
|
||||
},
|
||||
|
||||
submitUpload() {
|
||||
if (this.fileList.length === 0) {
|
||||
this.$message.warning('请先选择文件');
|
||||
return;
|
||||
}
|
||||
|
||||
this.uploading = true;
|
||||
this.$refs.upload.submit();
|
||||
},
|
||||
|
||||
handleSuccess(response, file, fileList) {
|
||||
this.uploading = false;
|
||||
this.$message.success('文件上传成功');
|
||||
const _self = this;
|
||||
setTimeout(() => {
|
||||
_self.$emit('success', response, file, fileList);
|
||||
_self.handleClose();
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
handleError(error, file, fileList) {
|
||||
this.uploading = false;
|
||||
this.$message.error('文件上传失败');
|
||||
this.$emit('error', error, file, fileList);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.upload-demo {
|
||||
width: 100%;
|
||||
}
|
||||
.dialog-footer{
|
||||
padding-right: 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
|
@ -1,297 +1,297 @@
|
|||
<template>
|
||||
<div class="home rflex">
|
||||
<nav-bar :navCollapse.sync="thisCollapse"></nav-bar>
|
||||
<div class="menu_right wflex" ref="menu_right">
|
||||
<div class="menu_right_box">
|
||||
<div class="menu_right_header">
|
||||
<!--<header-bar></header-bar>
|
||||
<tag-nav></tag-nav>-->
|
||||
<header-box
|
||||
:isCollapse.sync="thisCollapse"
|
||||
:notRedNum.sync="thisNotRedNum"
|
||||
></header-box>
|
||||
</div>
|
||||
<el-scrollbar
|
||||
style="height: 100%;"
|
||||
wrap-class="default-scrollbar__wrap"
|
||||
>
|
||||
<div class="menu_content" ref="menu_content">
|
||||
<!-- <transition mode="out-in">-->
|
||||
<!-- <keep-alive-->
|
||||
<!-- exclude=""-->
|
||||
<!-- >-->
|
||||
<!-- <router-view :key="key" :notreadnum.sync='notreadnum'></router-view>-->
|
||||
<!-- </keep-alive>-->
|
||||
<!-- </transition>-->
|
||||
<!-- <div class="goGo" v-if="isZx">
|
||||
<img
|
||||
src="../../assets/在线客服.png"
|
||||
alt=""
|
||||
@mouseenter="changeMenu"
|
||||
/>
|
||||
</div> -->
|
||||
<!-- <div class="goGo2" v-if="isShow" @mouseleave="changeMenuBack">
|
||||
<div @mouseleave="changeTop" style="position:relative">
|
||||
<img
|
||||
src="../../assets/QQ客服.png"
|
||||
alt=""
|
||||
@mouseenter="changeImg(1)"
|
||||
/>
|
||||
|
||||
<img
|
||||
src="../../assets/微信客服.png"
|
||||
alt=""
|
||||
@mouseenter="changeImg(2)"
|
||||
/>
|
||||
<img
|
||||
src="../../assets/在线课堂.png"
|
||||
alt=""
|
||||
@mouseenter="changeImg(3)"
|
||||
/>
|
||||
<img
|
||||
src="../../assets/QQ客服号.png"
|
||||
alt=""
|
||||
:class="imgShow == 1 ? 'active-one' : ''"
|
||||
v-if="imgShow == 1"
|
||||
/>
|
||||
<img
|
||||
src="../../assets/erweima.png"
|
||||
alt=""
|
||||
:class="imgShow == 2 ? 'active-two' : ''"
|
||||
class="img-show"
|
||||
v-if="imgShow == 2"
|
||||
/>
|
||||
<img
|
||||
src="../../assets/video.png"
|
||||
alt=""
|
||||
:class="imgShow == 3 ? 'active-two' : ''"
|
||||
class="img-show"
|
||||
v-if="imgShow == 3"
|
||||
/>
|
||||
</div>
|
||||
<img
|
||||
src="../../assets/返回首页.png"
|
||||
alt=""
|
||||
@click="$router.push('/')"
|
||||
/>
|
||||
</div> -->
|
||||
|
||||
<keep-alive>
|
||||
<router-view
|
||||
:notreadnum.sync="notreadnum"
|
||||
:key="key"
|
||||
></router-view>
|
||||
</keep-alive>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
<!-- <FooteBar></FooteBar> -->
|
||||
<!-- <backTop :ele="$refs.menu_content"></backTop> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderBar from "./headerBar";
|
||||
import HeaderBox from "./headBox.vue";
|
||||
import NavBar from "./navBar";
|
||||
import TagNav from "./tagNav";
|
||||
import FooteBar from "./footerBar.vue";
|
||||
import backTop from "../BackTop";
|
||||
import { mapActions } from "vuex";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
thisCollapse: false,
|
||||
thisNotRedNum: 0,
|
||||
notreadnum: "",
|
||||
isShow: false,
|
||||
isZx: true,
|
||||
imgShow: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
//重要。相同路由页面跳转时,query不同,可以刷新页面
|
||||
key() {
|
||||
if (this.$route.query.t) {
|
||||
this.$store.state.tagNav.openedPageList.forEach(item => {
|
||||
if (item.path == this.$route.path) {
|
||||
item.lastTime = this.$route.query.t;
|
||||
}
|
||||
});
|
||||
return this.$route.fullPath;
|
||||
} else {
|
||||
// let re=""
|
||||
// this.$store.state.tagNav.openedPageList.forEach(item=>{
|
||||
// if(item.path==this.$route.path){
|
||||
// re=item.lastTime
|
||||
// }
|
||||
// })
|
||||
// return re
|
||||
}
|
||||
},
|
||||
tagNavList() {
|
||||
// console.log("缓存页面");
|
||||
// console.log(this.$store.state.tagNav.cachedPageName);
|
||||
return this.$store.state.tagNav.cachedPageName;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getLogoUrl();
|
||||
this.getNotReadCount();
|
||||
},
|
||||
components: {
|
||||
HeaderBar,
|
||||
NavBar,
|
||||
TagNav,
|
||||
FooteBar,
|
||||
backTop,
|
||||
HeaderBox
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
getLogoUrl: "common/getLogoUrl"
|
||||
}),
|
||||
// 切换侧边在线客服菜单
|
||||
changeMenu() {
|
||||
this.isShow = true;
|
||||
this.isZx = false;
|
||||
},
|
||||
changeMenuBack() {
|
||||
this.isZx = true;
|
||||
this.isShow = false;
|
||||
},
|
||||
changeImg(num) {
|
||||
this.imgShow = num;
|
||||
},
|
||||
changeTop() {
|
||||
this.imgShow = 0;
|
||||
},
|
||||
getNotReadCount() {
|
||||
this.$api.notificationAPI
|
||||
.countNotRead()
|
||||
.then(res => {
|
||||
this.thisNotRedNum = res.notReadCount;
|
||||
|
||||
// if(res.notReadCount ===0){
|
||||
//
|
||||
// this.hasNotRead = false;
|
||||
// }else{
|
||||
// this.hasNotRead = true;
|
||||
// }
|
||||
})
|
||||
.catch(r => {
|
||||
this.pictLoading = false;
|
||||
console.log(r);
|
||||
});
|
||||
}
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
if (to.query.t) {
|
||||
next(vm => {
|
||||
vm.$store.state.tagNav.openedPageList.forEach(item => {
|
||||
if (item.path == to.path) {
|
||||
item.lastTime = to.fullPath;
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
next(vm => {});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
thisCollapse(newv, oldv) {
|
||||
// console.log(newv)
|
||||
},
|
||||
notreadnum(newv) {
|
||||
this.thisNotRedNum = newv;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.home,
|
||||
.menu_right {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.menu_right {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.menu_right_box {
|
||||
// padding-bottom: 41px;
|
||||
padding-bottom: 25px;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.menu_right_header {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
z-index: 999;
|
||||
}
|
||||
.menu_content {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
padding-top: 90px;
|
||||
box-sizing: border-box;
|
||||
/*overflow: hidden;*/
|
||||
}
|
||||
|
||||
.page-component__scroll {
|
||||
height: 100%;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.el-scrollbar__wrap {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.el-scrollbar {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.goGo {
|
||||
width: 42px;
|
||||
position: fixed;
|
||||
bottom: 45%;
|
||||
right: 0;
|
||||
z-index: 3000;
|
||||
transform: scale(0.7);
|
||||
}
|
||||
.goGo2 {
|
||||
width: 62px;
|
||||
position: fixed;
|
||||
bottom: 40%;
|
||||
right: 10px;
|
||||
z-index: 3000;
|
||||
}
|
||||
.active {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
// display: block;
|
||||
}
|
||||
.active-one {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 65px;
|
||||
}
|
||||
.active-two {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
right: 65px;
|
||||
}
|
||||
.img-show {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.home .el-scrollbar__view {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="home rflex">
|
||||
<nav-bar :navCollapse.sync="thisCollapse"></nav-bar>
|
||||
<div class="menu_right wflex" ref="menu_right">
|
||||
<div class="menu_right_box">
|
||||
<div class="menu_right_header">
|
||||
<!--<header-bar></header-bar>
|
||||
<tag-nav></tag-nav>-->
|
||||
<header-box
|
||||
:isCollapse.sync="thisCollapse"
|
||||
:notRedNum.sync="thisNotRedNum"
|
||||
></header-box>
|
||||
</div>
|
||||
<el-scrollbar
|
||||
style="height: 100%;"
|
||||
wrap-class="default-scrollbar__wrap"
|
||||
>
|
||||
<div class="menu_content" ref="menu_content">
|
||||
<!-- <transition mode="out-in">-->
|
||||
<!-- <keep-alive-->
|
||||
<!-- exclude=""-->
|
||||
<!-- >-->
|
||||
<!-- <router-view :key="key" :notreadnum.sync='notreadnum'></router-view>-->
|
||||
<!-- </keep-alive>-->
|
||||
<!-- </transition>-->
|
||||
<!-- <div class="goGo" v-if="isZx">
|
||||
<img
|
||||
src="../../assets/在线客服.png"
|
||||
alt=""
|
||||
@mouseenter="changeMenu"
|
||||
/>
|
||||
</div> -->
|
||||
<!-- <div class="goGo2" v-if="isShow" @mouseleave="changeMenuBack">
|
||||
<div @mouseleave="changeTop" style="position:relative">
|
||||
<img
|
||||
src="../../assets/QQ客服.png"
|
||||
alt=""
|
||||
@mouseenter="changeImg(1)"
|
||||
/>
|
||||
|
||||
<img
|
||||
src="../../assets/微信客服.png"
|
||||
alt=""
|
||||
@mouseenter="changeImg(2)"
|
||||
/>
|
||||
<img
|
||||
src="../../assets/在线课堂.png"
|
||||
alt=""
|
||||
@mouseenter="changeImg(3)"
|
||||
/>
|
||||
<img
|
||||
src="../../assets/QQ客服号.png"
|
||||
alt=""
|
||||
:class="imgShow == 1 ? 'active-one' : ''"
|
||||
v-if="imgShow == 1"
|
||||
/>
|
||||
<img
|
||||
src="../../assets/erweima.png"
|
||||
alt=""
|
||||
:class="imgShow == 2 ? 'active-two' : ''"
|
||||
class="img-show"
|
||||
v-if="imgShow == 2"
|
||||
/>
|
||||
<img
|
||||
src="../../assets/video.png"
|
||||
alt=""
|
||||
:class="imgShow == 3 ? 'active-two' : ''"
|
||||
class="img-show"
|
||||
v-if="imgShow == 3"
|
||||
/>
|
||||
</div>
|
||||
<img
|
||||
src="../../assets/返回首页.png"
|
||||
alt=""
|
||||
@click="$router.push('/')"
|
||||
/>
|
||||
</div> -->
|
||||
|
||||
<keep-alive>
|
||||
<router-view
|
||||
:notreadnum.sync="notreadnum"
|
||||
:key="key"
|
||||
></router-view>
|
||||
</keep-alive>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
<!-- <FooteBar></FooteBar> -->
|
||||
<!-- <backTop :ele="$refs.menu_content"></backTop> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderBar from "./headerBar";
|
||||
import HeaderBox from "./headBox.vue";
|
||||
import NavBar from "./navBar";
|
||||
import TagNav from "./tagNav";
|
||||
import FooteBar from "./footerBar.vue";
|
||||
import backTop from "../BackTop";
|
||||
import { mapActions } from "vuex";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
thisCollapse: false,
|
||||
thisNotRedNum: 0,
|
||||
notreadnum: "",
|
||||
isShow: false,
|
||||
isZx: true,
|
||||
imgShow: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
//重要。相同路由页面跳转时,query不同,可以刷新页面
|
||||
key() {
|
||||
if (this.$route.query.t) {
|
||||
this.$store.state.tagNav.openedPageList.forEach(item => {
|
||||
if (item.path == this.$route.path) {
|
||||
item.lastTime = this.$route.query.t;
|
||||
}
|
||||
});
|
||||
return this.$route.fullPath;
|
||||
} else {
|
||||
// let re=""
|
||||
// this.$store.state.tagNav.openedPageList.forEach(item=>{
|
||||
// if(item.path==this.$route.path){
|
||||
// re=item.lastTime
|
||||
// }
|
||||
// })
|
||||
// return re
|
||||
}
|
||||
},
|
||||
tagNavList() {
|
||||
// console.log("缓存页面");
|
||||
// console.log(this.$store.state.tagNav.cachedPageName);
|
||||
return this.$store.state.tagNav.cachedPageName;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getLogoUrl();
|
||||
this.getNotReadCount();
|
||||
},
|
||||
components: {
|
||||
HeaderBar,
|
||||
NavBar,
|
||||
TagNav,
|
||||
FooteBar,
|
||||
backTop,
|
||||
HeaderBox
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
getLogoUrl: "common/getLogoUrl"
|
||||
}),
|
||||
// 切换侧边在线客服菜单
|
||||
changeMenu() {
|
||||
this.isShow = true;
|
||||
this.isZx = false;
|
||||
},
|
||||
changeMenuBack() {
|
||||
this.isZx = true;
|
||||
this.isShow = false;
|
||||
},
|
||||
changeImg(num) {
|
||||
this.imgShow = num;
|
||||
},
|
||||
changeTop() {
|
||||
this.imgShow = 0;
|
||||
},
|
||||
getNotReadCount() {
|
||||
this.$api.notificationAPI
|
||||
.countNotRead()
|
||||
.then(res => {
|
||||
this.thisNotRedNum = res.notReadCount;
|
||||
|
||||
// if(res.notReadCount ===0){
|
||||
//
|
||||
// this.hasNotRead = false;
|
||||
// }else{
|
||||
// this.hasNotRead = true;
|
||||
// }
|
||||
})
|
||||
.catch(r => {
|
||||
this.pictLoading = false;
|
||||
console.log(r);
|
||||
});
|
||||
}
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
if (to.query.t) {
|
||||
next(vm => {
|
||||
vm.$store.state.tagNav.openedPageList.forEach(item => {
|
||||
if (item.path == to.path) {
|
||||
item.lastTime = to.fullPath;
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
next(vm => {});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
thisCollapse(newv, oldv) {
|
||||
// console.log(newv)
|
||||
},
|
||||
notreadnum(newv) {
|
||||
this.thisNotRedNum = newv;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.home,
|
||||
.menu_right {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.menu_right {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.menu_right_box {
|
||||
// padding-bottom: 41px;
|
||||
padding-bottom: 25px;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.menu_right_header {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
z-index: 999;
|
||||
}
|
||||
.menu_content {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
padding-top: 90px;
|
||||
box-sizing: border-box;
|
||||
/*overflow: hidden;*/
|
||||
}
|
||||
|
||||
.page-component__scroll {
|
||||
height: 100%;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.el-scrollbar__wrap {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.el-scrollbar {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.goGo {
|
||||
width: 42px;
|
||||
position: fixed;
|
||||
bottom: 45%;
|
||||
right: 0;
|
||||
z-index: 3000;
|
||||
transform: scale(0.7);
|
||||
}
|
||||
.goGo2 {
|
||||
width: 62px;
|
||||
position: fixed;
|
||||
bottom: 40%;
|
||||
right: 10px;
|
||||
z-index: 3000;
|
||||
}
|
||||
.active {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
// display: block;
|
||||
}
|
||||
.active-one {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 65px;
|
||||
}
|
||||
.active-two {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
right: 65px;
|
||||
}
|
||||
.img-show {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.home .el-scrollbar__view {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,371 +1,378 @@
|
|||
<template>
|
||||
<!-- 圆盘 -->
|
||||
<div class="disc-wrap">
|
||||
<!-- <div class="disc">
|
||||
<div class="inner"></div>
|
||||
<div class="outer"></div>
|
||||
<div class="conent">
|
||||
<div class="item1">
|
||||
<div class="icon1"></div>
|
||||
<div class="title1">
|
||||
<span class="point"></span>
|
||||
<span class="text">物料信息</span>
|
||||
<span class="point"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item2">
|
||||
<div class="icon2"></div>
|
||||
<div class="title2">
|
||||
<span class="point"></span>
|
||||
<span class="text">设备信息</span>
|
||||
<span class="point"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item3">
|
||||
<div class="icon3"></div>
|
||||
<div class="title3">
|
||||
<span class="point"></span>
|
||||
<span class="text">生产信息</span>
|
||||
<span class="point"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item4">
|
||||
<div class="icon4"></div>
|
||||
<div class="title4">
|
||||
<span class="point"></span>
|
||||
<span class="text">任务信息</span>
|
||||
<span class="point"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import "../../../../utils/flexble";
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.disc-wrap {
|
||||
width: 100%;
|
||||
height: 60%;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
background: url("../../../../assets/sc_bg.png");
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
|
||||
.disc {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
transform: translateY(39px) scale(1);
|
||||
|
||||
.text {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.inner {
|
||||
position: absolute;
|
||||
width: 58rem;
|
||||
height: 43rem;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
background: url("../../../../assets/longscreen2/house.png");
|
||||
background-size: 108% 108%;
|
||||
background-position: center center;
|
||||
animation: rotate-in 70s linear infinite;
|
||||
// transform: rotateX(65deg);
|
||||
// @keyframes rotate-in {
|
||||
// 0% {
|
||||
// transform: rotateX(65deg) rotateZ(0deg);
|
||||
// }
|
||||
// 100% {
|
||||
// transform: rotateX(65deg) rotateZ(360deg);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
.outer {
|
||||
position: absolute;
|
||||
width: 48rem;
|
||||
height: 48rem;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
background: url("../../../../assets/longscreen2/out.png");
|
||||
background-size: 100% 100%;
|
||||
background-position: center center;
|
||||
animation: rotate-out 70s linear infinite;
|
||||
transform: rotateX(65deg);
|
||||
|
||||
@keyframes rotate-out {
|
||||
0% {
|
||||
transform: rotateX(65deg) rotateZ(100deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotateX(65deg) rotateZ(-360deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.conent {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 19.2rem;
|
||||
width: 17.7rem;
|
||||
height: 19rem;
|
||||
transform: translateX(-50%);
|
||||
// background: url("../../../../assets/longscreen2/mall_content.png");
|
||||
background-position: center center;
|
||||
background-size: 100% 100%;
|
||||
z-index: 3;
|
||||
|
||||
@keyframes moveDown {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: translateY(-2rem);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes moveUp {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
transform: translateY(-2rem);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.item1 {
|
||||
width: 18rem;
|
||||
height: 18rem;
|
||||
top: 70%;
|
||||
left: -120%;
|
||||
position: absolute;
|
||||
background-image: url("../../../../assets/longscreen2/1.png");
|
||||
background-size: 100% 100%;
|
||||
|
||||
.icon1 {
|
||||
width: 10rem;
|
||||
height: 10rem;
|
||||
position: absolute;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 60% 60%;
|
||||
left: 4rem;
|
||||
top: -1.9rem;
|
||||
background-image: url("../../../../assets/longscreen2/mall_内部贸易公司.svg");
|
||||
z-index: 2;
|
||||
animation: moveUp 4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.title1 {
|
||||
width: 158px;
|
||||
height: 44px;
|
||||
color: #e1e9e9;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: -98px;
|
||||
background-image: url("../../../../assets/longscreen2/mall_title.png");
|
||||
background-size: 100% 99%;
|
||||
z-index: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.text {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.point {
|
||||
display: block;
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: #c2fefa;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 左上
|
||||
.item2 {
|
||||
width: 18rem;
|
||||
height: 18rem;
|
||||
background-image: url("../../../../assets/longscreen2/2.png");
|
||||
background-size: 100% 100%;
|
||||
top: -80%;
|
||||
left: -120%;
|
||||
position: absolute;
|
||||
|
||||
.icon2 {
|
||||
width: 10rem;
|
||||
height: 10rem;
|
||||
position: absolute;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 60% 60%;
|
||||
left: 4.1rem;
|
||||
top: -1.9rem;
|
||||
background-image: url("../../../../assets/longscreen2/mall_外部卖家.svg");
|
||||
z-index: 2;
|
||||
animation: moveDown 4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.title2 {
|
||||
width: 158px;
|
||||
height: 44px;
|
||||
color: #e1e9e9;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: -98px;
|
||||
background-image: url("../../../../assets/longscreen2/mall_title.png");
|
||||
background-size: 100% 99%;
|
||||
z-index: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.text {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.point {
|
||||
display: block;
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: #c2fefa;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//右下
|
||||
.item3 {
|
||||
width: 18rem;
|
||||
height: 18rem;
|
||||
background-image: url("../../../../assets/longscreen2/3.png");
|
||||
background-size: 100% 100%;
|
||||
top: 60%;
|
||||
left: 120%;
|
||||
position: absolute;
|
||||
|
||||
.title3 {
|
||||
width: 158px;
|
||||
height: 44px;
|
||||
color: #e1e9e9;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
right: -92px;
|
||||
background-image: url("../../../../assets/longscreen2/mall_title.png");
|
||||
background-size: 100% 99%;
|
||||
z-index: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.text {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.point {
|
||||
display: block;
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: #c2fefa;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.icon3 {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
position: absolute;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 60% 60%;
|
||||
left: 40px;
|
||||
top: -24px;
|
||||
background-image: url("../../../../assets/longscreen2/mall_内部项目.svg");
|
||||
z-index: 2;
|
||||
animation: moveDown 4s ease-in-out infinite;
|
||||
}
|
||||
}
|
||||
|
||||
// 右上
|
||||
.item4 {
|
||||
width: 18rem;
|
||||
height: 18rem;
|
||||
background-image: url("../../../../assets/longscreen2/1.png");
|
||||
background-size: 100% 100%;
|
||||
top: -90%;
|
||||
left: 120%;
|
||||
position: absolute;
|
||||
|
||||
.icon4 {
|
||||
width: 10rem;
|
||||
height: 10rem;
|
||||
position: absolute;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 60% 60%;
|
||||
right: 4.1rem;
|
||||
top: -1.9rem;
|
||||
background-image: url("../../../../assets/longscreen2/mall_外部材料供应商.svg");
|
||||
z-index: 2;
|
||||
animation: moveUp 4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.title4 {
|
||||
width: 158px;
|
||||
height: 44px;
|
||||
color: #e1e9e9;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
right: -106px;
|
||||
background-image: url("../../../../assets/longscreen2/mall_title.png");
|
||||
background-size: 100% 99%;
|
||||
z-index: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.text {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.point {
|
||||
display: block;
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: #c2fefa;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<!-- 圆盘 -->
|
||||
<div class="disc-wrap" >
|
||||
<img :src="companyInfo.zp" style="width:100%;height:100%;" alt="">
|
||||
<!-- <div class="disc">
|
||||
<div class="inner"></div>
|
||||
<div class="outer"></div>
|
||||
<div class="conent">
|
||||
<div class="item1">
|
||||
<div class="icon1"></div>
|
||||
<div class="title1">
|
||||
<span class="point"></span>
|
||||
<span class="text">物料信息</span>
|
||||
<span class="point"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item2">
|
||||
<div class="icon2"></div>
|
||||
<div class="title2">
|
||||
<span class="point"></span>
|
||||
<span class="text">设备信息</span>
|
||||
<span class="point"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item3">
|
||||
<div class="icon3"></div>
|
||||
<div class="title3">
|
||||
<span class="point"></span>
|
||||
<span class="text">生产信息</span>
|
||||
<span class="point"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item4">
|
||||
<div class="icon4"></div>
|
||||
<div class="title4">
|
||||
<span class="point"></span>
|
||||
<span class="text">任务信息</span>
|
||||
<span class="point"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import "../../../../utils/flexble";
|
||||
import { mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
companyInfo: state => state.common.companyInfo
|
||||
}),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.disc-wrap {
|
||||
width: 100%;
|
||||
height: 60%;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
// background: url("../../../../assets/sc_bg.png");
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
.disc {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
transform: translateY(39px) scale(1);
|
||||
|
||||
.text {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.inner {
|
||||
position: absolute;
|
||||
width: 58rem;
|
||||
height: 43rem;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
background: url("../../../../assets/longscreen2/house.png");
|
||||
background-size: 108% 108%;
|
||||
background-position: center center;
|
||||
animation: rotate-in 70s linear infinite;
|
||||
// transform: rotateX(65deg);
|
||||
// @keyframes rotate-in {
|
||||
// 0% {
|
||||
// transform: rotateX(65deg) rotateZ(0deg);
|
||||
// }
|
||||
// 100% {
|
||||
// transform: rotateX(65deg) rotateZ(360deg);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
.outer {
|
||||
position: absolute;
|
||||
width: 48rem;
|
||||
height: 48rem;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
background: url("../../../../assets/longscreen2/out.png");
|
||||
background-size: 100% 100%;
|
||||
background-position: center center;
|
||||
animation: rotate-out 70s linear infinite;
|
||||
transform: rotateX(65deg);
|
||||
|
||||
@keyframes rotate-out {
|
||||
0% {
|
||||
transform: rotateX(65deg) rotateZ(100deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotateX(65deg) rotateZ(-360deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.conent {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 19.2rem;
|
||||
width: 17.7rem;
|
||||
height: 19rem;
|
||||
transform: translateX(-50%);
|
||||
// background: url("../../../../assets/longscreen2/mall_content.png");
|
||||
background-position: center center;
|
||||
background-size: 100% 100%;
|
||||
z-index: 3;
|
||||
|
||||
@keyframes moveDown {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: translateY(-2rem);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes moveUp {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
transform: translateY(-2rem);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.item1 {
|
||||
width: 18rem;
|
||||
height: 18rem;
|
||||
top: 70%;
|
||||
left: -120%;
|
||||
position: absolute;
|
||||
background-image: url("../../../../assets/longscreen2/1.png");
|
||||
background-size: 100% 100%;
|
||||
|
||||
.icon1 {
|
||||
width: 10rem;
|
||||
height: 10rem;
|
||||
position: absolute;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 60% 60%;
|
||||
left: 4rem;
|
||||
top: -1.9rem;
|
||||
background-image: url("../../../../assets/longscreen2/mall_内部贸易公司.svg");
|
||||
z-index: 2;
|
||||
animation: moveUp 4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.title1 {
|
||||
width: 158px;
|
||||
height: 44px;
|
||||
color: #e1e9e9;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: -98px;
|
||||
background-image: url("../../../../assets/longscreen2/mall_title.png");
|
||||
background-size: 100% 99%;
|
||||
z-index: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.text {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.point {
|
||||
display: block;
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: #c2fefa;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 左上
|
||||
.item2 {
|
||||
width: 18rem;
|
||||
height: 18rem;
|
||||
background-image: url("../../../../assets/longscreen2/2.png");
|
||||
background-size: 100% 100%;
|
||||
top: -80%;
|
||||
left: -120%;
|
||||
position: absolute;
|
||||
|
||||
.icon2 {
|
||||
width: 10rem;
|
||||
height: 10rem;
|
||||
position: absolute;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 60% 60%;
|
||||
left: 4.1rem;
|
||||
top: -1.9rem;
|
||||
background-image: url("../../../../assets/longscreen2/mall_外部卖家.svg");
|
||||
z-index: 2;
|
||||
animation: moveDown 4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.title2 {
|
||||
width: 158px;
|
||||
height: 44px;
|
||||
color: #e1e9e9;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: -98px;
|
||||
background-image: url("../../../../assets/longscreen2/mall_title.png");
|
||||
background-size: 100% 99%;
|
||||
z-index: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.text {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.point {
|
||||
display: block;
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: #c2fefa;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//右下
|
||||
.item3 {
|
||||
width: 18rem;
|
||||
height: 18rem;
|
||||
background-image: url("../../../../assets/longscreen2/3.png");
|
||||
background-size: 100% 100%;
|
||||
top: 60%;
|
||||
left: 120%;
|
||||
position: absolute;
|
||||
|
||||
.title3 {
|
||||
width: 158px;
|
||||
height: 44px;
|
||||
color: #e1e9e9;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
right: -92px;
|
||||
background-image: url("../../../../assets/longscreen2/mall_title.png");
|
||||
background-size: 100% 99%;
|
||||
z-index: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.text {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.point {
|
||||
display: block;
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: #c2fefa;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.icon3 {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
position: absolute;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 60% 60%;
|
||||
left: 40px;
|
||||
top: -24px;
|
||||
background-image: url("../../../../assets/longscreen2/mall_内部项目.svg");
|
||||
z-index: 2;
|
||||
animation: moveDown 4s ease-in-out infinite;
|
||||
}
|
||||
}
|
||||
|
||||
// 右上
|
||||
.item4 {
|
||||
width: 18rem;
|
||||
height: 18rem;
|
||||
background-image: url("../../../../assets/longscreen2/1.png");
|
||||
background-size: 100% 100%;
|
||||
top: -90%;
|
||||
left: 120%;
|
||||
position: absolute;
|
||||
|
||||
.icon4 {
|
||||
width: 10rem;
|
||||
height: 10rem;
|
||||
position: absolute;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 60% 60%;
|
||||
right: 4.1rem;
|
||||
top: -1.9rem;
|
||||
background-image: url("../../../../assets/longscreen2/mall_外部材料供应商.svg");
|
||||
z-index: 2;
|
||||
animation: moveUp 4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.title4 {
|
||||
width: 158px;
|
||||
height: 44px;
|
||||
color: #e1e9e9;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
right: -106px;
|
||||
background-image: url("../../../../assets/longscreen2/mall_title.png");
|
||||
background-size: 100% 99%;
|
||||
z-index: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.text {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.point {
|
||||
display: block;
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: #c2fefa;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
<template>
|
||||
<div id="center">
|
||||
<!-- 圆盘 -->
|
||||
<Disc></Disc>
|
||||
<!-- 直采商城 -->
|
||||
<!-- <ZhicaiMall></ZhicaiMall> -->
|
||||
<!-- 大宗贸易商城 -->
|
||||
<TradeMall style="z-index:9999"></TradeMall>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Disc from "./components/disc";
|
||||
// import ZhicaiMall from "./components/zhicaiMall";
|
||||
import TradeMall from "./components/tradeMall";
|
||||
export default {
|
||||
name: "LongScreen",
|
||||
components: { Disc, TradeMall },
|
||||
data() {
|
||||
return {};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
#center {
|
||||
color: #fff;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div id="center">
|
||||
<!-- 圆盘 -->
|
||||
<Disc></Disc>
|
||||
<!-- 直采商城 -->
|
||||
<!-- <ZhicaiMall></ZhicaiMall> -->
|
||||
<!-- 大宗贸易商城 -->
|
||||
<TradeMall style="z-index:9999"></TradeMall>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Disc from "./components/disc";
|
||||
// import ZhicaiMall from "./components/zhicaiMall";
|
||||
import TradeMall from "./components/tradeMall";
|
||||
export default {
|
||||
name: "LongScreen",
|
||||
components: { Disc, TradeMall },
|
||||
data() {
|
||||
return {};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
#center {
|
||||
color: #fff;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="header-wrap">
|
||||
<div class="myheader">
|
||||
<p class="header-title">
|
||||
江西心诚药业互联网平台数字化展示中心
|
||||
{{ companyInfo.screenName }}
|
||||
</p>
|
||||
<div class="time">{{ time }}</div>
|
||||
<!-- <div class="weather">{{ "🌤晴 22℃" }}</div> -->
|
||||
|
@ -51,6 +51,7 @@ import model3d from "./screen-3d";
|
|||
import model3dsb from "./screen-3d-sb";
|
||||
import model3dhcl from "./screen-3d-hcl";
|
||||
import model3dfq from "./screen-3d-fq";
|
||||
import { mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "LongScreen",
|
||||
|
@ -70,6 +71,11 @@ export default {
|
|||
show: "cj"
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
companyInfo: state => state.common.companyInfo
|
||||
}),
|
||||
},
|
||||
mounted() {
|
||||
this.timeSelse = setInterval(() => {
|
||||
this.getTime();
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,9 +1,8 @@
|
|||
<template>
|
||||
<div class="sys-login" style="overflow: hidden;">
|
||||
<div class="login-logo" style="display:flex;">
|
||||
<img style="width:50px;height:50px;" src="../../assets/logo_xc.jpg" alt />
|
||||
<h2 style="margin-left:10px;color:#fff">江西心诚药业有限公司</h2>
|
||||
<!-- <img src="../../assets/logo1.png" alt /> -->
|
||||
<img style="width:50px;height:50px;" :src="companyInfo.logoUrl" alt />
|
||||
<h2 style="margin-left:10px;color:#fff">{{ companyInfo.name }}</h2>
|
||||
</div>
|
||||
<!-- <div class="login-slogan">
|
||||
赋能万物 连接未来
|
||||
|
@ -48,15 +47,20 @@ export default {
|
|||
name: [{ required: true, message: "用户名不能为空", trigger: "blur" }],
|
||||
password: [{ required: true, message: "密码不能为空", trigger: "blur" }]
|
||||
},
|
||||
sysMsg: ""
|
||||
sysMsg: "",
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
computed: {
|
||||
...mapState({
|
||||
companyInfo: state => state.common.companyInfo
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
login: "auth/loginByUser",
|
||||
getNavList: "auth/getNavList"
|
||||
getNavList: "auth/getNavList",
|
||||
}),
|
||||
|
||||
submitForm() {
|
||||
var self = this;
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,377 +1,377 @@
|
|||
<template>
|
||||
<div class="sys-box plan-box">
|
||||
<div class="sys-operate">
|
||||
<el-button type="primary" @click="gotoAdd" v-has="'basic:process:add'">新增</el-button>
|
||||
<el-button type="primary" @click="remove" :disabled="btnDelDisabled" v-has="'basic:process:delete'">删除</el-button>
|
||||
<el-button type="primary" @click="audit" :disabled="btnDelDisabled" v-has="'basic:process:audit'">批量审核</el-button>
|
||||
<el-button type="primary" @click="disAudit" :disabled="btnOtherDisabled" v-has="'basic:process:reverseAudit'">反审核</el-button>
|
||||
<el-button type="primary" @click="download()" >下载模板</el-button>
|
||||
<el-upload
|
||||
style="display: inline-block;margin-left: 5px"
|
||||
ref="upload"
|
||||
:action="uploadUrl"
|
||||
:file-list="fileDocList"
|
||||
:before-remove="function(){
|
||||
return false
|
||||
}"
|
||||
:auto-upload="auto_upload"
|
||||
:on-change="onChange"
|
||||
v-loading.lock="fullscreenLoading"
|
||||
class="inline-block"
|
||||
accept=".xls,.xlsx,"
|
||||
>
|
||||
<el-button size="small" v-has="'basic:process:upload'" type="primary" >导入</el-button>
|
||||
</el-upload>
|
||||
</div>
|
||||
<div class="sys-search">
|
||||
<el-form inline>
|
||||
<el-form-item label="工序名称">
|
||||
<el-input placeholder="请输入工序名称" v-model="search_data.name" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="search">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="sys-table">
|
||||
<el-table
|
||||
border
|
||||
v-loading="pictLoading"
|
||||
ref="tb"
|
||||
:data="tableData"
|
||||
:header-cell-style="{fontWeight: 'normal', textAlign: 'center', backgroundColor: '#eceff4', color: '#222'}"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
||||
<el-table-column prop="code" align="center" label="工序代码" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-link type="primary" @click="gotoEdit(scope.row)">{{scope.row.code}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" align="center" label="工序名称" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="standard" align="center" label="基准良率" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="type" align="center" label="工序类型" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.type==238">普通订单</div>
|
||||
<div v-else-if="scope.row.type==239">正常生产</div>
|
||||
<div v-else="scope.row.type==240">返工返修</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="whetherExamine" align="center" label="是否检验" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.whetherExamine === 1 ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="whetherCollect" align="center" label="是否自动采集" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.whetherCollect === 1 ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="manHour" align="center" label="单件工时(分钟)" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="labourPrice" align="center" label="单件工价(元/件)" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="auditSignName" align="center" label="审核状态" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="sys-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="search_data.pageno"
|
||||
:page-sizes="pageSizes"
|
||||
:page-size="search_data.pagesize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from "@/utils/config.js";
|
||||
import base from '@/api/base.js'; // 导入接口域名列表
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
search_data: {
|
||||
pageno: 1,
|
||||
pagesize: 10
|
||||
},
|
||||
total: 0, //总条数
|
||||
pageSizes: [10, 20, 50], //每页展示多少条
|
||||
pictLoading: false,
|
||||
btnDelDisabled: true,
|
||||
btnOtherDisabled: true,
|
||||
tableData: [],
|
||||
processIds: [],
|
||||
uploadUrl: base.uploadUrl,
|
||||
fileDocList: [],
|
||||
auto_upload: false,
|
||||
fullscreenLoading: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var _this = this;
|
||||
document.onkeydown = e => {
|
||||
if (e.key === "Enter") {
|
||||
_this.search()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
onChange(file, fileList) {
|
||||
if (file.size > 100 * 1000000) {
|
||||
this.$message.error('上传文件不能超过100M!');
|
||||
this.$refs.upload.uploadFiles.splice(this.$refs.upload.uploadFiles.length - 1, 1);
|
||||
|
||||
return false
|
||||
}
|
||||
file = file.raw;
|
||||
if (!/image\/\w+/.test(file.type)) {//非图片
|
||||
this.fullscreenLoading = true;
|
||||
this.httpRequest(file, file.name);
|
||||
} else {
|
||||
this.fullscreenLoading = true;
|
||||
let _this = this;
|
||||
imageConversion.compressAccurately(file, 400).then(res => {
|
||||
if (res.size) {//压缩成功
|
||||
_this.httpRequest(res, file.name, file);
|
||||
} else {
|
||||
_this.$message.error('压缩图片失败');
|
||||
_this.fullscreenLoading = false;
|
||||
_this.$refs.upload.uploadFiles.splice(_this.$refs.upload.uploadFiles.length - 1, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//压缩并上传图片
|
||||
httpRequest(upload, name, file) {//file是需要压缩图片时,原图片
|
||||
let _this = this;
|
||||
var tempFormData = new FormData();
|
||||
tempFormData.append("file", upload, name);//上传blob对象
|
||||
this.$api.processAPI.importExcel(tempFormData).then(res => {
|
||||
_this.fullscreenLoading = false;
|
||||
if (res.code === 0) {//上传成功
|
||||
_this.$message({
|
||||
message: '上传成功',
|
||||
type: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
} else {//上传失败
|
||||
_this.fullscreenLoading = false;
|
||||
_this.$message.error(res.msg);
|
||||
_this.$refs.upload.uploadFiles.splice(_this.$refs.upload.uploadFiles.length - 1, 1)
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
// 下载模板
|
||||
download() {
|
||||
let obj = {filePath:"/gyhl-file/template/work-procedure-template.xlsx",fileName:"工序模板.xlsx"}
|
||||
this.$api.commonAPI
|
||||
.downLoad(obj)
|
||||
.then(res => {
|
||||
if(res.status == 200) {
|
||||
window.open(res.request.responseURL)
|
||||
this.$message({
|
||||
message: '下载成功',
|
||||
type: "success"
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: '下载失败',
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
// 审核
|
||||
audit() {
|
||||
let ids = [];
|
||||
this.processIds.forEach(item => {
|
||||
ids.push(item.id)
|
||||
})
|
||||
this.$confirm("确认审核选中的项吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.processAPI
|
||||
.batchAudit(ids)
|
||||
.then(res => {
|
||||
if(res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
})
|
||||
this. getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "error"
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
// 反审核
|
||||
disAudit() {
|
||||
let id = this.processIds[0].id
|
||||
this.$confirm("确认反审核选中的项吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.processAPI
|
||||
.backToAudit(id)
|
||||
.then(res => {
|
||||
if(res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
})
|
||||
this. getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "error"
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
// 获取工序配置列表
|
||||
getList() {
|
||||
this.pictLoading = true;
|
||||
this.$api.processAPI
|
||||
.listProcess(this.search_data)
|
||||
.then(res => {
|
||||
this.pictLoading = false;
|
||||
console.log(res.data)
|
||||
if (res.data) {
|
||||
this.total = res.data.totalRows;
|
||||
this.tableData = res.data.datas ? res.data.datas : [];
|
||||
} else {
|
||||
this.total = 0;
|
||||
this.tableData = [];
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 跳转到编辑页面
|
||||
gotoEdit(row) {
|
||||
this.$router.push({ path: "/basic/process_edit", query: { id: row.id, t:Date.now() } })
|
||||
},
|
||||
|
||||
// 删除
|
||||
remove() {
|
||||
let ids = [];
|
||||
console.log(this.processIds)
|
||||
this.processIds.forEach(item => {
|
||||
ids.push(item.id)
|
||||
console.log(ids)
|
||||
})
|
||||
this.$confirm("确认删除选中的工序配置吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.processAPI
|
||||
.removeProcess(ids)
|
||||
.then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ? res.msg : "删除失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "删除失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 查询
|
||||
search() {
|
||||
this.search_data.pageno = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
// 跳往新增列表
|
||||
gotoAdd() {
|
||||
this.$router.push({path:'/basic/process_add',query: { t: Date.now() }})
|
||||
},
|
||||
|
||||
clickRow() {
|
||||
|
||||
},
|
||||
// 每页显示多少条
|
||||
handleSizeChange(val) {
|
||||
this.search_data.pagesize = val;
|
||||
this.getList();
|
||||
},
|
||||
// 上下分页
|
||||
handleCurrentChange(val) {
|
||||
this.search_data.pageno = val;
|
||||
this.getList();
|
||||
},
|
||||
/**
|
||||
* 处理选中
|
||||
*/
|
||||
handleSelectionChange(val) {
|
||||
console.log(val)
|
||||
this.processIds = val;
|
||||
this.setBtn(val);
|
||||
},
|
||||
/**
|
||||
* 控件操作按钮状态
|
||||
*/
|
||||
setBtn(val) {
|
||||
let isFlag = true;
|
||||
let isDelFlag = true;
|
||||
if (val.length > 0) {
|
||||
isDelFlag = false;
|
||||
if (val.length == 1) {
|
||||
isFlag = false;
|
||||
}
|
||||
} else {
|
||||
isFlag = true;
|
||||
isDelFlag = true;
|
||||
}
|
||||
this.btnDelDisabled = isDelFlag;
|
||||
this.btnOtherDisabled = isFlag;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.process-form .form-inline {
|
||||
display: inline-block;
|
||||
}
|
||||
.company-form .form-inline .el-input {
|
||||
width: 200px;
|
||||
}
|
||||
.company-form .form-inline .el-selectt {
|
||||
width: 200px;
|
||||
}
|
||||
.company-form textarea {
|
||||
height: 80px;
|
||||
}
|
||||
.dialogButton{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="sys-box plan-box">
|
||||
<div class="sys-operate">
|
||||
<el-button type="primary" @click="gotoAdd" v-has="'basic:process:add'">新增</el-button>
|
||||
<el-button type="primary" @click="remove" :disabled="btnDelDisabled" v-has="'basic:process:delete'">删除</el-button>
|
||||
<el-button type="primary" @click="audit" :disabled="btnDelDisabled" v-has="'basic:process:audit'">批量审核</el-button>
|
||||
<el-button type="primary" @click="disAudit" :disabled="btnOtherDisabled" v-has="'basic:process:reverseAudit'">反审核</el-button>
|
||||
<el-button type="primary" @click="download()" >下载模板</el-button>
|
||||
<el-upload
|
||||
style="display: inline-block;margin-left: 5px"
|
||||
ref="upload"
|
||||
:action="uploadUrl"
|
||||
:file-list="fileDocList"
|
||||
:before-remove="function(){
|
||||
return false
|
||||
}"
|
||||
:auto-upload="auto_upload"
|
||||
:on-change="onChange"
|
||||
v-loading.lock="fullscreenLoading"
|
||||
class="inline-block"
|
||||
accept=".xls,.xlsx,"
|
||||
>
|
||||
<el-button size="small" v-has="'basic:process:upload'" type="primary" >导入</el-button>
|
||||
</el-upload>
|
||||
</div>
|
||||
<div class="sys-search">
|
||||
<el-form inline>
|
||||
<el-form-item label="工序名称">
|
||||
<el-input placeholder="请输入工序名称" v-model="search_data.name" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="search">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="sys-table">
|
||||
<el-table
|
||||
border
|
||||
v-loading="pictLoading"
|
||||
ref="tb"
|
||||
:data="tableData"
|
||||
:header-cell-style="{fontWeight: 'normal', textAlign: 'center', backgroundColor: '#eceff4', color: '#222'}"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
||||
<el-table-column prop="code" align="center" label="工序代码" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-link type="primary" @click="gotoEdit(scope.row)">{{scope.row.code}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" align="center" label="工序名称" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="standard" align="center" label="基准良率" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="type" align="center" label="工序类型" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.type==238">普通订单</div>
|
||||
<div v-else-if="scope.row.type==239">正常生产</div>
|
||||
<div v-else="scope.row.type==240">返工返修</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="whetherExamine" align="center" label="是否检验" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.whetherExamine === 1 ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="whetherCollect" align="center" label="是否自动采集" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.whetherCollect === 1 ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="manHour" align="center" label="单件工时(分钟)" show-overflow-tooltip></el-table-column> -->
|
||||
<!-- <el-table-column prop="labourPrice" align="center" label="单件工价(元/件)" show-overflow-tooltip></el-table-column> -->
|
||||
<el-table-column prop="auditSignName" align="center" label="审核状态" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="sys-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="search_data.pageno"
|
||||
:page-sizes="pageSizes"
|
||||
:page-size="search_data.pagesize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from "@/utils/config.js";
|
||||
import base from '@/api/base.js'; // 导入接口域名列表
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
search_data: {
|
||||
pageno: 1,
|
||||
pagesize: 10
|
||||
},
|
||||
total: 0, //总条数
|
||||
pageSizes: [10, 20, 50], //每页展示多少条
|
||||
pictLoading: false,
|
||||
btnDelDisabled: true,
|
||||
btnOtherDisabled: true,
|
||||
tableData: [],
|
||||
processIds: [],
|
||||
uploadUrl: base.uploadUrl,
|
||||
fileDocList: [],
|
||||
auto_upload: false,
|
||||
fullscreenLoading: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var _this = this;
|
||||
document.onkeydown = e => {
|
||||
if (e.key === "Enter") {
|
||||
_this.search()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
onChange(file, fileList) {
|
||||
if (file.size > 100 * 1000000) {
|
||||
this.$message.error('上传文件不能超过100M!');
|
||||
this.$refs.upload.uploadFiles.splice(this.$refs.upload.uploadFiles.length - 1, 1);
|
||||
|
||||
return false
|
||||
}
|
||||
file = file.raw;
|
||||
if (!/image\/\w+/.test(file.type)) {//非图片
|
||||
this.fullscreenLoading = true;
|
||||
this.httpRequest(file, file.name);
|
||||
} else {
|
||||
this.fullscreenLoading = true;
|
||||
let _this = this;
|
||||
imageConversion.compressAccurately(file, 400).then(res => {
|
||||
if (res.size) {//压缩成功
|
||||
_this.httpRequest(res, file.name, file);
|
||||
} else {
|
||||
_this.$message.error('压缩图片失败');
|
||||
_this.fullscreenLoading = false;
|
||||
_this.$refs.upload.uploadFiles.splice(_this.$refs.upload.uploadFiles.length - 1, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//压缩并上传图片
|
||||
httpRequest(upload, name, file) {//file是需要压缩图片时,原图片
|
||||
let _this = this;
|
||||
var tempFormData = new FormData();
|
||||
tempFormData.append("file", upload, name);//上传blob对象
|
||||
this.$api.processAPI.importExcel(tempFormData).then(res => {
|
||||
_this.fullscreenLoading = false;
|
||||
if (res.code === 0) {//上传成功
|
||||
_this.$message({
|
||||
message: '上传成功',
|
||||
type: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
} else {//上传失败
|
||||
_this.fullscreenLoading = false;
|
||||
_this.$message.error(res.msg);
|
||||
_this.$refs.upload.uploadFiles.splice(_this.$refs.upload.uploadFiles.length - 1, 1)
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
// 下载模板
|
||||
download() {
|
||||
let obj = {filePath:"/gyhl-file/template/work-procedure-template.xlsx",fileName:"工序模板.xlsx"}
|
||||
this.$api.commonAPI
|
||||
.downLoad(obj)
|
||||
.then(res => {
|
||||
if(res.status == 200) {
|
||||
window.open(res.request.responseURL)
|
||||
this.$message({
|
||||
message: '下载成功',
|
||||
type: "success"
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: '下载失败',
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
// 审核
|
||||
audit() {
|
||||
let ids = [];
|
||||
this.processIds.forEach(item => {
|
||||
ids.push(item.id)
|
||||
})
|
||||
this.$confirm("确认审核选中的项吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.processAPI
|
||||
.batchAudit(ids)
|
||||
.then(res => {
|
||||
if(res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
})
|
||||
this. getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "error"
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
// 反审核
|
||||
disAudit() {
|
||||
let id = this.processIds[0].id
|
||||
this.$confirm("确认反审核选中的项吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.processAPI
|
||||
.backToAudit(id)
|
||||
.then(res => {
|
||||
if(res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
})
|
||||
this. getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "error"
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
// 获取工序配置列表
|
||||
getList() {
|
||||
this.pictLoading = true;
|
||||
this.$api.processAPI
|
||||
.listProcess(this.search_data)
|
||||
.then(res => {
|
||||
this.pictLoading = false;
|
||||
console.log(res.data)
|
||||
if (res.data) {
|
||||
this.total = res.data.totalRows;
|
||||
this.tableData = res.data.datas ? res.data.datas : [];
|
||||
} else {
|
||||
this.total = 0;
|
||||
this.tableData = [];
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 跳转到编辑页面
|
||||
gotoEdit(row) {
|
||||
this.$router.push({ path: "/basic/process_edit", query: { id: row.id, t:Date.now() } })
|
||||
},
|
||||
|
||||
// 删除
|
||||
remove() {
|
||||
let ids = [];
|
||||
console.log(this.processIds)
|
||||
this.processIds.forEach(item => {
|
||||
ids.push(item.id)
|
||||
console.log(ids)
|
||||
})
|
||||
this.$confirm("确认删除选中的工序配置吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.processAPI
|
||||
.removeProcess(ids)
|
||||
.then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ? res.msg : "删除失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "删除失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 查询
|
||||
search() {
|
||||
this.search_data.pageno = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
// 跳往新增列表
|
||||
gotoAdd() {
|
||||
this.$router.push({path:'/basic/process_add',query: { t: Date.now() }})
|
||||
},
|
||||
|
||||
clickRow() {
|
||||
|
||||
},
|
||||
// 每页显示多少条
|
||||
handleSizeChange(val) {
|
||||
this.search_data.pagesize = val;
|
||||
this.getList();
|
||||
},
|
||||
// 上下分页
|
||||
handleCurrentChange(val) {
|
||||
this.search_data.pageno = val;
|
||||
this.getList();
|
||||
},
|
||||
/**
|
||||
* 处理选中
|
||||
*/
|
||||
handleSelectionChange(val) {
|
||||
console.log(val)
|
||||
this.processIds = val;
|
||||
this.setBtn(val);
|
||||
},
|
||||
/**
|
||||
* 控件操作按钮状态
|
||||
*/
|
||||
setBtn(val) {
|
||||
let isFlag = true;
|
||||
let isDelFlag = true;
|
||||
if (val.length > 0) {
|
||||
isDelFlag = false;
|
||||
if (val.length == 1) {
|
||||
isFlag = false;
|
||||
}
|
||||
} else {
|
||||
isFlag = true;
|
||||
isDelFlag = true;
|
||||
}
|
||||
this.btnDelDisabled = isDelFlag;
|
||||
this.btnOtherDisabled = isFlag;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.process-form .form-inline {
|
||||
display: inline-block;
|
||||
}
|
||||
.company-form .form-inline .el-input {
|
||||
width: 200px;
|
||||
}
|
||||
.company-form .form-inline .el-selectt {
|
||||
width: 200px;
|
||||
}
|
||||
.company-form textarea {
|
||||
height: 80px;
|
||||
}
|
||||
.dialogButton{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,434 +1,434 @@
|
|||
<template>
|
||||
<!-- 巡检计划 -->
|
||||
<div class="sys-box knowledge-box">
|
||||
<div class="sys-operate">
|
||||
<el-button type="primary" v-has="'mesInspection:plan:add'" @click="add()">新增</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:remove'" @click="remove()" :disabled="btnDelDisabled">删除</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:record'" @click="createRecord()" :disabled="btnOtherDisabled">下达</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:startUsing'" @click="startUsing()" :disabled="btnDelDisabled">启用</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:forbidden'" @click="forbidden()" :disabled="btnDelDisabled">禁用</el-button>
|
||||
|
||||
<!-- <el-button type="primary" @click="importPlan()">导入</el-button>
|
||||
<el-button type="primary" @click="exportPlan()">导出</el-button>-->
|
||||
</div>
|
||||
<div class="sys-search">
|
||||
<el-form inline class="form_item_search_out">
|
||||
<div class='form_item_input_out'>
|
||||
<el-form-item label="计划名称" style='width:22%' class="form_item-inline">
|
||||
<el-input placeholder="计划名称" v-model="search_data.planName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态" style='width:22%' class="form_item-inline">
|
||||
<el-select clearable v-model="search_data.status" placeholder="任务状态">
|
||||
<el-option
|
||||
v-for="item in statusList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检人" style='width:22%' class="form_item-inline">
|
||||
<!-- <el-select clearable v-model="search_data.engineerId" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in getUserList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select> -->
|
||||
<btn-input :valueText.sync='search_data.engineerName' :valueId.sync='search_data.engineerId' :chooseVisible.sync='chooseUserVisible'></btn-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划时间" style='width:34%' class="form_item-inline">
|
||||
<el-date-picker
|
||||
v-model="planTime"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class='form_item_btn_out' >
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="search()">查询</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="sys-table">
|
||||
<el-table border @sort-change="sortChange"
|
||||
v-loading="pictLoading"
|
||||
:data="tableData"
|
||||
@row-click="clickRow"
|
||||
ref="tb"
|
||||
@selection-change="handleSelectionChange"
|
||||
:header-cell-style="{fontWeight: 'normal', textAlign: 'center', backgroundColor: '#eceff4', color: '#222'}"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
||||
<el-table-column prop="workOrderNo" align="center" label="计划单号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="primary" @click="viewDetail(scope.row)">{{scope.row.workOrderNo}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="planName" label="计划名称" align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column sortable="custom" width="110" prop="statusId" align="center" label="任务状态">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.statusName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deptName" align="center" label="巡检部门"></el-table-column>
|
||||
<el-table-column prop="userName" align="center" label="巡检人"></el-table-column>
|
||||
<el-table-column sortable="custom" prop="startTime" align="center" label="计划开始时间" width="124" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column sortable="custom" prop="endTime" align="center" label="计划完成时间" width="124" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="sys-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="search_data.pageno"
|
||||
:page-sizes="pageSizes"
|
||||
:page-size="search_data.pagesize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
></el-pagination>
|
||||
</div>
|
||||
|
||||
<!-- 选择负责人-->
|
||||
<dialogChooseSingleUser :visible.sync="chooseUserVisible" @change="getUser" ></dialogChooseSingleUser>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatDateTime } from "@/utils/tools.js";
|
||||
import btnInput from "@/components/btnInput.vue";
|
||||
import dialogChooseSingleUser from "@/components/System/dialogChooseSingleUser";
|
||||
export default {
|
||||
name: "mesInspection_plan",
|
||||
components: {
|
||||
btnInput,dialogChooseSingleUser,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
total: 0, //总条数
|
||||
pageSizes: [10, 20, 50], //每页展示多少条
|
||||
search_data: {
|
||||
pageno: 1,
|
||||
pagesize: 10
|
||||
},
|
||||
|
||||
planTime: "",
|
||||
|
||||
statusList: [], //计划状态
|
||||
getUserList: [], //用户
|
||||
|
||||
btnDelDisabled: true,
|
||||
btnOtherDisabled: true,
|
||||
chooseUserVisible: false,
|
||||
rowIds: [],
|
||||
tableData: [],
|
||||
dialogVisible: false,
|
||||
pictLoading: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
var _this = this;
|
||||
document.onkeydown = e => {
|
||||
if (e.key === "Enter") {
|
||||
_this.search()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
// 下达
|
||||
createRecord(row){
|
||||
let id = this.rowIds[0].id
|
||||
this.$api.mesPatroPlanAPI.createRecordList(id).then(res=>{
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
}else {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
}).catch(err=>{
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取选择的负责人
|
||||
*/
|
||||
getUser(val){
|
||||
if (val) {
|
||||
this.$set(this.search_data,'engineerName',val.name)
|
||||
this.$set(this.search_data,'engineerId',val.id)
|
||||
}else{
|
||||
this.$set(this.search_data,'engineerName',"")
|
||||
this.$set(this.search_data,'engineerId',"")
|
||||
}
|
||||
},
|
||||
sortChange({ column, prop, order }){
|
||||
let j={ column, prop, order };
|
||||
let order_=j.order=="ascending"?'asc':'desc'
|
||||
this.$set(this.search_data,'sort',j.prop)
|
||||
this.$set(this.search_data,'order',order_)
|
||||
this.getList();
|
||||
},
|
||||
clickRow(row) {
|
||||
this.$refs.tb.toggleRowSelection(row);
|
||||
},
|
||||
/**
|
||||
* 启用
|
||||
*/
|
||||
startUsing() {
|
||||
let ids = [];
|
||||
this.rowIds.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
this.$confirm("确认启用选中的巡检计划吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.mesPatroPlanAPI
|
||||
.startUsing({ids: ids})
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ?res.msg: "启用失败,请重试" ,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "启用失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 禁用
|
||||
*/
|
||||
forbidden() {
|
||||
let ids = [];
|
||||
this.rowIds.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
this.$confirm("确认禁用选中的巡检计划吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.mesPatroPlanAPI
|
||||
.forbidden({ids: ids})
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ?res.msg: "禁用失败,请重试" ,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "禁用失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
initData() {
|
||||
Promise.all([
|
||||
this.$api.commonAPI.getUsers(),
|
||||
this.$api.dictAPI.getDictsByType("plan_status")
|
||||
])
|
||||
.then(([r1, r2]) => {
|
||||
if (r1.code === 0) {
|
||||
this.getUserList = r1.datas;
|
||||
}
|
||||
if (r2.code === 0) {
|
||||
this.statusList = r2.datas;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
getList() {
|
||||
if (this.planTime) {
|
||||
this.search_data.startTime = formatDateTime(this.planTime[0]);
|
||||
this.search_data.endTime = formatDateTime(this.planTime[1]);
|
||||
} else {
|
||||
this.search_data.startTime = "";
|
||||
this.search_data.endTime = "";
|
||||
}
|
||||
this.pictLoading = true;
|
||||
this.$api.mesPatroPlanAPI
|
||||
.planList(this.search_data)
|
||||
.then(res => {
|
||||
this.pictLoading = false;
|
||||
if (res.data) {
|
||||
this.total = res.data.totalRows;
|
||||
this.tableData = res.data.datas ? res.data.datas : [];
|
||||
} else {
|
||||
this.total = 0;
|
||||
this.tableData = [];
|
||||
}
|
||||
})
|
||||
.catch(r => {
|
||||
console.log(r);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
search() {
|
||||
this.search_data.pageno = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 上下分页
|
||||
handleCurrentChange(val) {
|
||||
this.search_data.pageno = val;
|
||||
this.getList();
|
||||
},
|
||||
// 每页显示多少条
|
||||
handleSizeChange(val) {
|
||||
this.search_data.pagesize = val;
|
||||
this.getList();
|
||||
},
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
add() {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/plan_add",
|
||||
query: {
|
||||
t: Date.now()
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 查看明细
|
||||
*/
|
||||
viewDetail(r) {
|
||||
if (r.statusId === 146) {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/plan_add",
|
||||
query: { id: r.id, t: Date.now() }
|
||||
});
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/plan_detail",
|
||||
query: { id: r.id, t: Date.now() }
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 导入
|
||||
*/
|
||||
importPlan() {},
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
exportPlan() {},
|
||||
/**
|
||||
*查看明细
|
||||
*/
|
||||
openDetails(r) {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/detail",
|
||||
query: { id: r.id, t: Date.now() }
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除POST /apis/patrolPlan/batcnRemovePlan
|
||||
*/
|
||||
remove() {
|
||||
let ids = [];
|
||||
this.rowIds.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
// const ids = this.rowIds.map(item => item.id).toString();
|
||||
let params = { ids: ids };
|
||||
this.$confirm("确认删除选中的巡检计划吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.mesPatroPlanAPI
|
||||
.batcnRemovePlan(params)
|
||||
.then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ? res.msg : "删除失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "删除失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 处理选中
|
||||
*/
|
||||
handleSelectionChange(val) {
|
||||
this.rowIds = val;
|
||||
this.setBtn(val);
|
||||
},
|
||||
/**
|
||||
* 控件操作按钮状态
|
||||
*/
|
||||
setBtn(val) {
|
||||
let isFlag = true;
|
||||
let isDelFlag = true;
|
||||
if (val.length > 0) {
|
||||
isDelFlag = false;
|
||||
if (val.length == 1) {
|
||||
isFlag = false;
|
||||
}
|
||||
} else {
|
||||
isFlag = true;
|
||||
isDelFlag = true;
|
||||
}
|
||||
this.btnDelDisabled = isDelFlag;
|
||||
this.btnOtherDisabled = isFlag;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
<template>
|
||||
<!-- 巡检计划 -->
|
||||
<div class="sys-box knowledge-box">
|
||||
<div class="sys-operate">
|
||||
<el-button type="primary" v-has="'mesInspection:plan:add'" @click="add()">新增</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:remove'" @click="remove()" :disabled="btnDelDisabled">删除</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:record'" @click="createRecord()" :disabled="btnOtherDisabled">下达</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:startUsing'" @click="startUsing()" :disabled="btnDelDisabled">启用</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:forbidden'" @click="forbidden()" :disabled="btnDelDisabled">禁用</el-button>
|
||||
|
||||
<!-- <el-button type="primary" @click="importPlan()">导入</el-button>
|
||||
<el-button type="primary" @click="exportPlan()">导出</el-button>-->
|
||||
</div>
|
||||
<div class="sys-search">
|
||||
<el-form inline class="form_item_search_out">
|
||||
<div class='form_item_input_out'>
|
||||
<el-form-item label="计划名称" style='width:22%' class="form_item-inline">
|
||||
<el-input placeholder="计划名称" v-model="search_data.planName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态" style='width:22%' class="form_item-inline">
|
||||
<el-select clearable v-model="search_data.status" placeholder="任务状态">
|
||||
<el-option
|
||||
v-for="item in statusList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检人" style='width:22%' class="form_item-inline">
|
||||
<!-- <el-select clearable v-model="search_data.engineerId" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in getUserList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select> -->
|
||||
<btn-input :valueText.sync='search_data.engineerName' :valueId.sync='search_data.engineerId' :chooseVisible.sync='chooseUserVisible'></btn-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划时间" style='width:34%' class="form_item-inline">
|
||||
<el-date-picker
|
||||
v-model="planTime"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class='form_item_btn_out' >
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="search()">查询</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="sys-table">
|
||||
<el-table border @sort-change="sortChange"
|
||||
v-loading="pictLoading"
|
||||
:data="tableData"
|
||||
@row-click="clickRow"
|
||||
ref="tb"
|
||||
@selection-change="handleSelectionChange"
|
||||
:header-cell-style="{fontWeight: 'normal', textAlign: 'center', backgroundColor: '#eceff4', color: '#222'}"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
||||
<el-table-column prop="workOrderNo" align="center" label="计划单号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="primary" @click="viewDetail(scope.row)">{{scope.row.workOrderNo}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="planName" label="计划名称" align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column sortable="custom" width="110" prop="statusId" align="center" label="任务状态">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.statusName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deptName" align="center" label="巡检部门"></el-table-column>
|
||||
<el-table-column prop="userName" align="center" label="巡检人"></el-table-column>
|
||||
<el-table-column sortable="custom" prop="startTime" align="center" label="计划开始时间" width="124" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column sortable="custom" prop="endTime" align="center" label="计划完成时间" width="124" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="sys-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="search_data.pageno"
|
||||
:page-sizes="pageSizes"
|
||||
:page-size="search_data.pagesize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
></el-pagination>
|
||||
</div>
|
||||
|
||||
<!-- 选择负责人-->
|
||||
<dialogChooseSingleUser :visible.sync="chooseUserVisible" @change="getUser" ></dialogChooseSingleUser>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatDateTime } from "@/utils/tools.js";
|
||||
import btnInput from "@/components/btnInput.vue";
|
||||
import dialogChooseSingleUser from "@/components/System/dialogChooseSingleUser";
|
||||
export default {
|
||||
name: "mesInspection_plan",
|
||||
components: {
|
||||
btnInput,dialogChooseSingleUser,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
total: 0, //总条数
|
||||
pageSizes: [10, 20, 50], //每页展示多少条
|
||||
search_data: {
|
||||
pageno: 1,
|
||||
pagesize: 10
|
||||
},
|
||||
|
||||
planTime: "",
|
||||
|
||||
statusList: [], //计划状态
|
||||
getUserList: [], //用户
|
||||
|
||||
btnDelDisabled: true,
|
||||
btnOtherDisabled: true,
|
||||
chooseUserVisible: false,
|
||||
rowIds: [],
|
||||
tableData: [],
|
||||
dialogVisible: false,
|
||||
pictLoading: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
var _this = this;
|
||||
document.onkeydown = e => {
|
||||
if (e.key === "Enter") {
|
||||
_this.search()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
// 下达
|
||||
createRecord(row){
|
||||
let id = this.rowIds[0].id
|
||||
this.$api.mesPatroPlanAPI.createRecordList(id).then(res=>{
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
}else {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
}).catch(err=>{
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取选择的负责人
|
||||
*/
|
||||
getUser(val){
|
||||
if (val) {
|
||||
this.$set(this.search_data,'engineerName',val.name)
|
||||
this.$set(this.search_data,'engineerId',val.id)
|
||||
}else{
|
||||
this.$set(this.search_data,'engineerName',"")
|
||||
this.$set(this.search_data,'engineerId',"")
|
||||
}
|
||||
},
|
||||
sortChange({ column, prop, order }){
|
||||
let j={ column, prop, order };
|
||||
let order_=j.order=="ascending"?'asc':'desc'
|
||||
this.$set(this.search_data,'sort',j.prop)
|
||||
this.$set(this.search_data,'order',order_)
|
||||
this.getList();
|
||||
},
|
||||
clickRow(row) {
|
||||
this.$refs.tb.toggleRowSelection(row);
|
||||
},
|
||||
/**
|
||||
* 启用
|
||||
*/
|
||||
startUsing() {
|
||||
let ids = [];
|
||||
this.rowIds.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
this.$confirm("确认启用选中的巡检计划吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.mesPatroPlanAPI
|
||||
.startUsing({ids: ids})
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ?res.msg: "启用失败,请重试" ,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "启用失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 禁用
|
||||
*/
|
||||
forbidden() {
|
||||
let ids = [];
|
||||
this.rowIds.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
this.$confirm("确认禁用选中的巡检计划吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.mesPatroPlanAPI
|
||||
.forbidden({ids: ids})
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ?res.msg: "禁用失败,请重试" ,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "禁用失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
initData() {
|
||||
Promise.all([
|
||||
this.$api.commonAPI.getUsers(),
|
||||
this.$api.dictAPI.getDictsByType("plan_status")
|
||||
])
|
||||
.then(([r1, r2]) => {
|
||||
if (r1.code === 0) {
|
||||
this.getUserList = r1.datas;
|
||||
}
|
||||
if (r2.code === 0) {
|
||||
this.statusList = r2.datas;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
getList() {
|
||||
if (this.planTime) {
|
||||
this.search_data.startTime = formatDateTime(this.planTime[0]);
|
||||
this.search_data.endTime = formatDateTime(this.planTime[1]);
|
||||
} else {
|
||||
this.search_data.startTime = "";
|
||||
this.search_data.endTime = "";
|
||||
}
|
||||
this.pictLoading = true;
|
||||
this.$api.mesPatroPlanAPI
|
||||
.planList(this.search_data)
|
||||
.then(res => {
|
||||
this.pictLoading = false;
|
||||
if (res.data) {
|
||||
this.total = res.data.totalRows;
|
||||
this.tableData = res.data.datas ? res.data.datas : [];
|
||||
} else {
|
||||
this.total = 0;
|
||||
this.tableData = [];
|
||||
}
|
||||
})
|
||||
.catch(r => {
|
||||
console.log(r);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
search() {
|
||||
this.search_data.pageno = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 上下分页
|
||||
handleCurrentChange(val) {
|
||||
this.search_data.pageno = val;
|
||||
this.getList();
|
||||
},
|
||||
// 每页显示多少条
|
||||
handleSizeChange(val) {
|
||||
this.search_data.pagesize = val;
|
||||
this.getList();
|
||||
},
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
add() {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/plan_add",
|
||||
query: {
|
||||
t: Date.now()
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 查看明细
|
||||
*/
|
||||
viewDetail(r) {
|
||||
if (r.statusId === 146) {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/plan_add",
|
||||
query: { id: r.id, t: Date.now() }
|
||||
});
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/plan_detail",
|
||||
query: { id: r.id, t: Date.now() }
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 导入
|
||||
*/
|
||||
importPlan() {},
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
exportPlan() {},
|
||||
/**
|
||||
*查看明细
|
||||
*/
|
||||
openDetails(r) {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/detail",
|
||||
query: { id: r.id, t: Date.now() }
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除POST /apis/patrolPlan/batcnRemovePlan
|
||||
*/
|
||||
remove() {
|
||||
let ids = [];
|
||||
this.rowIds.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
// const ids = this.rowIds.map(item => item.id).toString();
|
||||
let params = { ids: ids };
|
||||
this.$confirm("确认删除选中的巡检计划吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.mesPatroPlanAPI
|
||||
.batcnRemovePlan(params)
|
||||
.then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ? res.msg : "删除失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "删除失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 处理选中
|
||||
*/
|
||||
handleSelectionChange(val) {
|
||||
this.rowIds = val;
|
||||
this.setBtn(val);
|
||||
},
|
||||
/**
|
||||
* 控件操作按钮状态
|
||||
*/
|
||||
setBtn(val) {
|
||||
let isFlag = true;
|
||||
let isDelFlag = true;
|
||||
if (val.length > 0) {
|
||||
isDelFlag = false;
|
||||
if (val.length == 1) {
|
||||
isFlag = false;
|
||||
}
|
||||
} else {
|
||||
isFlag = true;
|
||||
isDelFlag = true;
|
||||
}
|
||||
this.btnDelDisabled = isDelFlag;
|
||||
this.btnOtherDisabled = isFlag;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
|
|
@ -1,434 +1,434 @@
|
|||
<template>
|
||||
<!-- 巡检计划 -->
|
||||
<div class="sys-box knowledge-box">
|
||||
<div class="sys-operate">
|
||||
<el-button type="primary" v-has="'mesInspection:plan:add'" @click="add()">新增</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:remove'" @click="remove()" :disabled="btnDelDisabled">删除</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:record'" @click="createRecord()" :disabled="btnOtherDisabled">下达</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:startUsing'" @click="startUsing()" :disabled="btnDelDisabled">启用</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:forbidden'" @click="forbidden()" :disabled="btnDelDisabled">禁用</el-button>
|
||||
|
||||
<!-- <el-button type="primary" @click="importPlan()">导入</el-button>
|
||||
<el-button type="primary" @click="exportPlan()">导出</el-button>-->
|
||||
</div>
|
||||
<div class="sys-search">
|
||||
<el-form inline class="form_item_search_out">
|
||||
<div class='form_item_input_out'>
|
||||
<el-form-item label="计划名称" style='width:22%' class="form_item-inline">
|
||||
<el-input placeholder="计划名称" v-model="search_data.planName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态" style='width:22%' class="form_item-inline">
|
||||
<el-select clearable v-model="search_data.status" placeholder="任务状态">
|
||||
<el-option
|
||||
v-for="item in statusList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检人" style='width:22%' class="form_item-inline">
|
||||
<!-- <el-select clearable v-model="search_data.engineerId" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in getUserList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select> -->
|
||||
<btn-input :valueText.sync='search_data.engineerName' :valueId.sync='search_data.engineerId' :chooseVisible.sync='chooseUserVisible'></btn-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划时间" style='width:34%' class="form_item-inline">
|
||||
<el-date-picker
|
||||
v-model="planTime"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class='form_item_btn_out' >
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="search()">查询</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="sys-table">
|
||||
<el-table border @sort-change="sortChange"
|
||||
v-loading="pictLoading"
|
||||
:data="tableData"
|
||||
@row-click="clickRow"
|
||||
ref="tb"
|
||||
@selection-change="handleSelectionChange"
|
||||
:header-cell-style="{fontWeight: 'normal', textAlign: 'center', backgroundColor: '#eceff4', color: '#222'}"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
||||
<el-table-column prop="workOrderNo" align="center" label="计划单号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="primary" @click="viewDetail(scope.row)">{{scope.row.workOrderNo}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="planName" label="计划名称" align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column sortable="custom" width="110" prop="statusId" align="center" label="任务状态">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.statusName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deptName" align="center" label="巡检部门"></el-table-column>
|
||||
<el-table-column prop="userName" align="center" label="巡检人"></el-table-column>
|
||||
<el-table-column sortable="custom" prop="startTime" align="center" label="计划开始时间" width="124" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column sortable="custom" prop="endTime" align="center" label="计划完成时间" width="124" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="sys-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="search_data.pageno"
|
||||
:page-sizes="pageSizes"
|
||||
:page-size="search_data.pagesize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
></el-pagination>
|
||||
</div>
|
||||
|
||||
<!-- 选择负责人-->
|
||||
<dialogChooseSingleUser :visible.sync="chooseUserVisible" @change="getUser" ></dialogChooseSingleUser>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatDateTime } from "@/utils/tools.js";
|
||||
import btnInput from "@/components/btnInput.vue";
|
||||
import dialogChooseSingleUser from "@/components/System/dialogChooseSingleUser";
|
||||
export default {
|
||||
name: "mesInspection_plan",
|
||||
components: {
|
||||
btnInput,dialogChooseSingleUser,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
total: 0, //总条数
|
||||
pageSizes: [10, 20, 50], //每页展示多少条
|
||||
search_data: {
|
||||
pageno: 1,
|
||||
pagesize: 10
|
||||
},
|
||||
|
||||
planTime: "",
|
||||
|
||||
statusList: [], //计划状态
|
||||
getUserList: [], //用户
|
||||
|
||||
btnDelDisabled: true,
|
||||
btnOtherDisabled: true,
|
||||
chooseUserVisible: false,
|
||||
rowIds: [],
|
||||
tableData: [],
|
||||
dialogVisible: false,
|
||||
pictLoading: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
var _this = this;
|
||||
document.onkeydown = e => {
|
||||
if (e.key === "Enter") {
|
||||
_this.search()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
// 下达
|
||||
createRecord(row){
|
||||
let id = this.rowIds[0].id
|
||||
this.$api.mesPatroPlanAPI.createRecordList(id).then(res=>{
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
}else {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
}).catch(err=>{
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取选择的负责人
|
||||
*/
|
||||
getUser(val){
|
||||
if (val) {
|
||||
this.$set(this.search_data,'engineerName',val.name)
|
||||
this.$set(this.search_data,'engineerId',val.id)
|
||||
}else{
|
||||
this.$set(this.search_data,'engineerName',"")
|
||||
this.$set(this.search_data,'engineerId',"")
|
||||
}
|
||||
},
|
||||
sortChange({ column, prop, order }){
|
||||
let j={ column, prop, order };
|
||||
let order_=j.order=="ascending"?'asc':'desc'
|
||||
this.$set(this.search_data,'sort',j.prop)
|
||||
this.$set(this.search_data,'order',order_)
|
||||
this.getList();
|
||||
},
|
||||
clickRow(row) {
|
||||
this.$refs.tb.toggleRowSelection(row);
|
||||
},
|
||||
/**
|
||||
* 启用
|
||||
*/
|
||||
startUsing() {
|
||||
let ids = [];
|
||||
this.rowIds.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
this.$confirm("确认启用选中的巡检计划吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.mesPatroPlanAPI
|
||||
.startUsing({ids: ids})
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ?res.msg: "启用失败,请重试" ,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "启用失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 禁用
|
||||
*/
|
||||
forbidden() {
|
||||
let ids = [];
|
||||
this.rowIds.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
this.$confirm("确认禁用选中的巡检计划吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.mesPatroPlanAPI
|
||||
.forbidden({ids: ids})
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ?res.msg: "禁用失败,请重试" ,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "禁用失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
initData() {
|
||||
Promise.all([
|
||||
this.$api.commonAPI.getUsers(),
|
||||
this.$api.dictAPI.getDictsByType("plan_status")
|
||||
])
|
||||
.then(([r1, r2]) => {
|
||||
if (r1.code === 0) {
|
||||
this.getUserList = r1.datas;
|
||||
}
|
||||
if (r2.code === 0) {
|
||||
this.statusList = r2.datas;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
getList() {
|
||||
if (this.planTime) {
|
||||
this.search_data.startTime = formatDateTime(this.planTime[0]);
|
||||
this.search_data.endTime = formatDateTime(this.planTime[1]);
|
||||
} else {
|
||||
this.search_data.startTime = "";
|
||||
this.search_data.endTime = "";
|
||||
}
|
||||
this.pictLoading = true;
|
||||
this.$api.mesPatroPlanAPI
|
||||
.planList(this.search_data)
|
||||
.then(res => {
|
||||
this.pictLoading = false;
|
||||
if (res.data) {
|
||||
this.total = res.data.totalRows;
|
||||
this.tableData = res.data.datas ? res.data.datas : [];
|
||||
} else {
|
||||
this.total = 0;
|
||||
this.tableData = [];
|
||||
}
|
||||
})
|
||||
.catch(r => {
|
||||
console.log(r);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
search() {
|
||||
this.search_data.pageno = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 上下分页
|
||||
handleCurrentChange(val) {
|
||||
this.search_data.pageno = val;
|
||||
this.getList();
|
||||
},
|
||||
// 每页显示多少条
|
||||
handleSizeChange(val) {
|
||||
this.search_data.pagesize = val;
|
||||
this.getList();
|
||||
},
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
add() {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/plan_add",
|
||||
query: {
|
||||
t: Date.now()
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 查看明细
|
||||
*/
|
||||
viewDetail(r) {
|
||||
if (r.statusId === 146) {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/plan_add",
|
||||
query: { id: r.id, t: Date.now() }
|
||||
});
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/plan_detail",
|
||||
query: { id: r.id, t: Date.now() }
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 导入
|
||||
*/
|
||||
importPlan() {},
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
exportPlan() {},
|
||||
/**
|
||||
*查看明细
|
||||
*/
|
||||
openDetails(r) {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/detail",
|
||||
query: { id: r.id, t: Date.now() }
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除POST /apis/patrolPlan/batcnRemovePlan
|
||||
*/
|
||||
remove() {
|
||||
let ids = [];
|
||||
this.rowIds.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
// const ids = this.rowIds.map(item => item.id).toString();
|
||||
let params = { ids: ids };
|
||||
this.$confirm("确认删除选中的巡检计划吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.mesPatroPlanAPI
|
||||
.batcnRemovePlan(params)
|
||||
.then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ? res.msg : "删除失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "删除失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 处理选中
|
||||
*/
|
||||
handleSelectionChange(val) {
|
||||
this.rowIds = val;
|
||||
this.setBtn(val);
|
||||
},
|
||||
/**
|
||||
* 控件操作按钮状态
|
||||
*/
|
||||
setBtn(val) {
|
||||
let isFlag = true;
|
||||
let isDelFlag = true;
|
||||
if (val.length > 0) {
|
||||
isDelFlag = false;
|
||||
if (val.length == 1) {
|
||||
isFlag = false;
|
||||
}
|
||||
} else {
|
||||
isFlag = true;
|
||||
isDelFlag = true;
|
||||
}
|
||||
this.btnDelDisabled = isDelFlag;
|
||||
this.btnOtherDisabled = isFlag;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
<template>
|
||||
<!-- 巡检计划 -->
|
||||
<div class="sys-box knowledge-box">
|
||||
<div class="sys-operate">
|
||||
<el-button type="primary" v-has="'mesInspection:plan:add'" @click="add()">新增</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:remove'" @click="remove()" :disabled="btnDelDisabled">删除</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:record'" @click="createRecord()" :disabled="btnOtherDisabled">下达</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:startUsing'" @click="startUsing()" :disabled="btnDelDisabled">启用</el-button>
|
||||
<el-button type="primary" v-has="'mesInspection:plan:forbidden'" @click="forbidden()" :disabled="btnDelDisabled">禁用</el-button>
|
||||
|
||||
<!-- <el-button type="primary" @click="importPlan()">导入</el-button>
|
||||
<el-button type="primary" @click="exportPlan()">导出</el-button>-->
|
||||
</div>
|
||||
<div class="sys-search">
|
||||
<el-form inline class="form_item_search_out">
|
||||
<div class='form_item_input_out'>
|
||||
<el-form-item label="计划名称" style='width:22%' class="form_item-inline">
|
||||
<el-input placeholder="计划名称" v-model="search_data.planName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态" style='width:22%' class="form_item-inline">
|
||||
<el-select clearable v-model="search_data.status" placeholder="任务状态">
|
||||
<el-option
|
||||
v-for="item in statusList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检人" style='width:22%' class="form_item-inline">
|
||||
<!-- <el-select clearable v-model="search_data.engineerId" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in getUserList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select> -->
|
||||
<btn-input :valueText.sync='search_data.engineerName' :valueId.sync='search_data.engineerId' :chooseVisible.sync='chooseUserVisible'></btn-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划时间" style='width:34%' class="form_item-inline">
|
||||
<el-date-picker
|
||||
v-model="planTime"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class='form_item_btn_out' >
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="search()">查询</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="sys-table">
|
||||
<el-table border @sort-change="sortChange"
|
||||
v-loading="pictLoading"
|
||||
:data="tableData"
|
||||
@row-click="clickRow"
|
||||
ref="tb"
|
||||
@selection-change="handleSelectionChange"
|
||||
:header-cell-style="{fontWeight: 'normal', textAlign: 'center', backgroundColor: '#eceff4', color: '#222'}"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
||||
<el-table-column prop="workOrderNo" align="center" label="计划单号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="primary" @click="viewDetail(scope.row)">{{scope.row.workOrderNo}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="planName" label="计划名称" align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column sortable="custom" width="110" prop="statusId" align="center" label="任务状态">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.statusName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deptName" align="center" label="巡检部门"></el-table-column>
|
||||
<el-table-column prop="userName" align="center" label="巡检人"></el-table-column>
|
||||
<el-table-column sortable="custom" prop="startTime" align="center" label="计划开始时间" width="124" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column sortable="custom" prop="endTime" align="center" label="计划完成时间" width="124" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="sys-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="search_data.pageno"
|
||||
:page-sizes="pageSizes"
|
||||
:page-size="search_data.pagesize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
></el-pagination>
|
||||
</div>
|
||||
|
||||
<!-- 选择负责人-->
|
||||
<dialogChooseSingleUser :visible.sync="chooseUserVisible" @change="getUser" ></dialogChooseSingleUser>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatDateTime } from "@/utils/tools.js";
|
||||
import btnInput from "@/components/btnInput.vue";
|
||||
import dialogChooseSingleUser from "@/components/System/dialogChooseSingleUser";
|
||||
export default {
|
||||
name: "mesInspection_plan",
|
||||
components: {
|
||||
btnInput,dialogChooseSingleUser,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
total: 0, //总条数
|
||||
pageSizes: [10, 20, 50], //每页展示多少条
|
||||
search_data: {
|
||||
pageno: 1,
|
||||
pagesize: 10
|
||||
},
|
||||
|
||||
planTime: "",
|
||||
|
||||
statusList: [], //计划状态
|
||||
getUserList: [], //用户
|
||||
|
||||
btnDelDisabled: true,
|
||||
btnOtherDisabled: true,
|
||||
chooseUserVisible: false,
|
||||
rowIds: [],
|
||||
tableData: [],
|
||||
dialogVisible: false,
|
||||
pictLoading: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
var _this = this;
|
||||
document.onkeydown = e => {
|
||||
if (e.key === "Enter") {
|
||||
_this.search()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
// 下达
|
||||
createRecord(row){
|
||||
let id = this.rowIds[0].id
|
||||
this.$api.mesPatroPlanAPI.createRecordList(id).then(res=>{
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
}else {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
}).catch(err=>{
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取选择的负责人
|
||||
*/
|
||||
getUser(val){
|
||||
if (val) {
|
||||
this.$set(this.search_data,'engineerName',val.name)
|
||||
this.$set(this.search_data,'engineerId',val.id)
|
||||
}else{
|
||||
this.$set(this.search_data,'engineerName',"")
|
||||
this.$set(this.search_data,'engineerId',"")
|
||||
}
|
||||
},
|
||||
sortChange({ column, prop, order }){
|
||||
let j={ column, prop, order };
|
||||
let order_=j.order=="ascending"?'asc':'desc'
|
||||
this.$set(this.search_data,'sort',j.prop)
|
||||
this.$set(this.search_data,'order',order_)
|
||||
this.getList();
|
||||
},
|
||||
clickRow(row) {
|
||||
this.$refs.tb.toggleRowSelection(row);
|
||||
},
|
||||
/**
|
||||
* 启用
|
||||
*/
|
||||
startUsing() {
|
||||
let ids = [];
|
||||
this.rowIds.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
this.$confirm("确认启用选中的巡检计划吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.mesPatroPlanAPI
|
||||
.startUsing({ids: ids})
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ?res.msg: "启用失败,请重试" ,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "启用失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 禁用
|
||||
*/
|
||||
forbidden() {
|
||||
let ids = [];
|
||||
this.rowIds.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
this.$confirm("确认禁用选中的巡检计划吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.mesPatroPlanAPI
|
||||
.forbidden({ids: ids})
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ?res.msg: "禁用失败,请重试" ,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "禁用失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
initData() {
|
||||
Promise.all([
|
||||
this.$api.commonAPI.getUsers(),
|
||||
this.$api.dictAPI.getDictsByType("plan_status")
|
||||
])
|
||||
.then(([r1, r2]) => {
|
||||
if (r1.code === 0) {
|
||||
this.getUserList = r1.datas;
|
||||
}
|
||||
if (r2.code === 0) {
|
||||
this.statusList = r2.datas;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
getList() {
|
||||
if (this.planTime) {
|
||||
this.search_data.startTime = formatDateTime(this.planTime[0]);
|
||||
this.search_data.endTime = formatDateTime(this.planTime[1]);
|
||||
} else {
|
||||
this.search_data.startTime = "";
|
||||
this.search_data.endTime = "";
|
||||
}
|
||||
this.pictLoading = true;
|
||||
this.$api.mesPatroPlanAPI
|
||||
.planList(this.search_data)
|
||||
.then(res => {
|
||||
this.pictLoading = false;
|
||||
if (res.data) {
|
||||
this.total = res.data.totalRows;
|
||||
this.tableData = res.data.datas ? res.data.datas : [];
|
||||
} else {
|
||||
this.total = 0;
|
||||
this.tableData = [];
|
||||
}
|
||||
})
|
||||
.catch(r => {
|
||||
console.log(r);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
search() {
|
||||
this.search_data.pageno = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 上下分页
|
||||
handleCurrentChange(val) {
|
||||
this.search_data.pageno = val;
|
||||
this.getList();
|
||||
},
|
||||
// 每页显示多少条
|
||||
handleSizeChange(val) {
|
||||
this.search_data.pagesize = val;
|
||||
this.getList();
|
||||
},
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
add() {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/plan_add",
|
||||
query: {
|
||||
t: Date.now()
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 查看明细
|
||||
*/
|
||||
viewDetail(r) {
|
||||
if (r.statusId === 146) {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/plan_add",
|
||||
query: { id: r.id, t: Date.now() }
|
||||
});
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/plan_detail",
|
||||
query: { id: r.id, t: Date.now() }
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 导入
|
||||
*/
|
||||
importPlan() {},
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
exportPlan() {},
|
||||
/**
|
||||
*查看明细
|
||||
*/
|
||||
openDetails(r) {
|
||||
this.$router.push({
|
||||
path: "/mesInspection/detail",
|
||||
query: { id: r.id, t: Date.now() }
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除POST /apis/patrolPlan/batcnRemovePlan
|
||||
*/
|
||||
remove() {
|
||||
let ids = [];
|
||||
this.rowIds.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
// const ids = this.rowIds.map(item => item.id).toString();
|
||||
let params = { ids: ids };
|
||||
this.$confirm("确认删除选中的巡检计划吗?", "提示", {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$api.mesPatroPlanAPI
|
||||
.batcnRemovePlan(params)
|
||||
.then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.msg ? res.msg : "删除失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message({
|
||||
message: "删除失败,请重试",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 处理选中
|
||||
*/
|
||||
handleSelectionChange(val) {
|
||||
this.rowIds = val;
|
||||
this.setBtn(val);
|
||||
},
|
||||
/**
|
||||
* 控件操作按钮状态
|
||||
*/
|
||||
setBtn(val) {
|
||||
let isFlag = true;
|
||||
let isDelFlag = true;
|
||||
if (val.length > 0) {
|
||||
isDelFlag = false;
|
||||
if (val.length == 1) {
|
||||
isFlag = false;
|
||||
}
|
||||
} else {
|
||||
isFlag = true;
|
||||
isDelFlag = true;
|
||||
}
|
||||
this.btnDelDisabled = isDelFlag;
|
||||
this.btnOtherDisabled = isFlag;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,470 +1,469 @@
|
|||
<template>
|
||||
<div class="sys-box">
|
||||
<div class="sys-operate">
|
||||
<el-button type="primary" @click="showColumnSetDialog">{{config.configureBtnName}}</el-button>
|
||||
</div>
|
||||
<div class="sys-search">
|
||||
<el-form inline class="form_item_search_out">
|
||||
<div class='form_item_input_out'>
|
||||
<el-form-item label="物料" style='width:33%' class="form_item-inline">
|
||||
<el-input v-model="search_data.fuzzySearch" placeholder="物料代码、名称和规格模糊查询" clearable ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" style='width:33%' class="form_item-inline">
|
||||
<el-select v-model="search_data.facilityId" placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="item in fac_type_list1"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="批号" style='width:33%' class="form_item-inline">
|
||||
<el-input v-model="search_data.batch" placeholder="请输入批号" clearable ></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class='form_item_btn_out'>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="search()">查询</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="sys-table">
|
||||
<el-table border
|
||||
v-if="formTableData.length>0"
|
||||
id="out-table"
|
||||
ref="tb"
|
||||
v-loading="pictLoading"
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
:data="tableData"
|
||||
:header-cell-style="{fontWeight: 'normal', textAlign: 'center', backgroundColor: '#eceff4', color: '#222'}"
|
||||
>
|
||||
|
||||
<el-table-column v-for="(items,index) in formTableData" :key="index" :prop="items.prop_" :label="items.title"
|
||||
align="center" show-overflow-tooltip>
|
||||
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="sys-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="search_data.pageno"
|
||||
:page-sizes="pageSizes"
|
||||
:page-size="search_data.pagesize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
></el-pagination>
|
||||
</div>
|
||||
<!-- 状态控制 -->
|
||||
<el-dialog :title="columnSetDialogTitle" center :visible.sync="columnSetDialogVisible" width="531px" :before-close="handleClose">
|
||||
<el-table border
|
||||
:data="showTableColumns"
|
||||
:key="Math.random()"
|
||||
max-height="350"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="title"
|
||||
label="列表名称"
|
||||
width="180" fixed>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="select"
|
||||
label="是否显示"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.select">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="toUp(scope)">前移</el-button>
|
||||
<el-button type="text" size="small" @click="toDown(scope)">后移</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row type="flex" class="row-bg" justify="center" style="margin-top: 10px;">
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" size="middle" @click="saveAndCloseColumnSetDialog">完成</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" size="middle" @click="toDefault">恢复默认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState, mapActions, mapGetters} from "vuex";
|
||||
import config from "@/utils/config.js";
|
||||
import FileSaver from 'file-saver'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
total: 0, //总条数
|
||||
pageSizes: [10, 20, 50], //每页展示多少条
|
||||
search_data: {
|
||||
pageno: 1,
|
||||
pagesize: 10,
|
||||
isPC: -1
|
||||
},
|
||||
config: config,
|
||||
tableData: [],
|
||||
allotIds: [],
|
||||
allotTime: '',
|
||||
dialogTitle: "",
|
||||
time: "",
|
||||
selectDeptId:'',
|
||||
formDataTime: "",
|
||||
fac_type_list1:[],//仓库
|
||||
fac_type_list2:[],//仓库
|
||||
auditSignList: [],
|
||||
companyList: [],
|
||||
createByList: [],
|
||||
depOptions: [],
|
||||
formData: {
|
||||
|
||||
},
|
||||
summary:{},
|
||||
btnDelDisabled: true,
|
||||
btnOtherDisabled: true,
|
||||
chooseClientrVisible: false,
|
||||
dialogLoading: false,
|
||||
chooseUserVisible: false,
|
||||
chooseMaterielVisible: false,
|
||||
columnSetDialogVisible: false,
|
||||
advanceQueryDialogVisible: false,
|
||||
chooseSupplierVisible:false,//选择供应商
|
||||
columnSetDialogTitle: "设置显示字段列表",
|
||||
tableId: 'stock1_table',
|
||||
pictLoading: false,
|
||||
//默认列表数据
|
||||
showTableColumnsDefault: [
|
||||
{title: "仓库", prop_: "facilityName", select: true},
|
||||
{title: "仓位", prop_: "facilityLocationName", select: true},
|
||||
{title: "物料代码", prop_: "serialNo", select: true},
|
||||
{title: "物料名称", prop_: "materielName", select: true},
|
||||
{title: "规格型号", prop_: "specification", select: true},
|
||||
{title: "批号", prop_: "batch", select: true},
|
||||
{title: "主计量单位", prop_: "unitUomName", select: true},
|
||||
{title: "主单位库存数量", prop_: "totalCount", select: true},
|
||||
{title: "辅助单位", prop_: "supportUomName", select: true},
|
||||
{title: "辅助单位库存数量", prop_: "totalRepertoryCount", select: true},
|
||||
{title: "换算系数", prop_: "convCoefficient", select: true}
|
||||
|
||||
],
|
||||
///弹出页面列表数据
|
||||
showTableColumns: [
|
||||
{title: "仓库", prop_: "facilityName", select: true},
|
||||
{title: "仓位", prop_: "facilityLocationName", select: true},
|
||||
{title: "物料代码", prop_: "serialNo", select: true},
|
||||
{title: "物料名称", prop_: "materielName", select: true},
|
||||
{title: "规格型号", prop_: "specification", select: true},
|
||||
{title: "批号", prop_: "batch", select: true},
|
||||
{title: "主计量单位", prop_: "unitUomName", select: true},
|
||||
{title: "主单位库存数量", prop_: "totalCount", select: true},
|
||||
{title: "辅助单位", prop_: "supportUomName", select: true},
|
||||
{title: "辅助单位库存数量", prop_: "totalRepertoryCount", select: true},
|
||||
{title: "换算系数", prop_: "convCoefficient", select: true}
|
||||
],
|
||||
showTableColumnsTemp: [],//弹框弹出的时候,保存当前的列表数据
|
||||
//显示的列表字段
|
||||
formTableData: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var _this = this;
|
||||
document.onkeydown = e => {
|
||||
if (e.key === "Enter") {
|
||||
_this.search()
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
userInfo: "user/getUserInfo"
|
||||
}),
|
||||
},
|
||||
mounted() {
|
||||
this.showTableColumns = JSON.parse(JSON.stringify(this.showTableColumns));
|
||||
this.showTableColumnsTemp = JSON.parse(JSON.stringify(this.showTableColumns));
|
||||
this.formData.createBy = this.userInfo.userId;
|
||||
this.formData.createByName =this.userInfo.name
|
||||
this.getList()
|
||||
this.getShowColumns();
|
||||
this.initialize();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
initialize() {
|
||||
this.$api.gylInventoryAPI
|
||||
.facilityList({pageno:1,pagesize:1000,auditSign:179})
|
||||
.then(res => {
|
||||
this.fac_type_list1 = res.data.datas?res.data.datas:''
|
||||
this.fac_type_list2 = res.data.datas?res.data.datas:''
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
|
||||
settime(n) {
|
||||
if (n.toString().length == 1) {
|
||||
return "0" + n.toString()
|
||||
} else {
|
||||
return n;
|
||||
}
|
||||
},
|
||||
// 查询
|
||||
search() {
|
||||
this.search_data.pageno = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
// 生产入库列表
|
||||
getList() {
|
||||
this.pictLoading = true;
|
||||
this.$api.saleStockAPI
|
||||
.getStockList(this.search_data)
|
||||
.then(res => {
|
||||
this.pictLoading = false;
|
||||
if(res.data) {
|
||||
console.log(res.data)
|
||||
this.total = res.data.totalRows;
|
||||
this.tableData = res.data.datas ? res.data.datas : [];
|
||||
this.summary = res.total
|
||||
} else {
|
||||
this.total = 0;
|
||||
this.tableData = [];
|
||||
}
|
||||
}).catch(r => {
|
||||
console.log(r);
|
||||
});
|
||||
},
|
||||
|
||||
// 每页显示多少条
|
||||
handleSizeChange(val) {
|
||||
this.search_data.pagesize = val;
|
||||
this.getList();
|
||||
},
|
||||
// 上下分页
|
||||
handleCurrentChange(val) {
|
||||
this.search_data.pageno = val;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
//设置显示字段
|
||||
showColumnSetDialog() {
|
||||
this.columnSetDialogVisible = true;
|
||||
this.showTableColumnsTemp = JSON.parse(JSON.stringify(this.showTableColumns));
|
||||
},
|
||||
//前移
|
||||
toUp(scope) {
|
||||
if (scope.$index == 0) {
|
||||
return false;
|
||||
}
|
||||
let n;
|
||||
for (let i = 0; i < this.showTableColumns.length; i++) {
|
||||
if (this.showTableColumns[i].prop_ == scope.row.prop_) {
|
||||
n = i;
|
||||
}
|
||||
}
|
||||
let temp = this.showTableColumns[n];
|
||||
this.showTableColumns[n] = this.showTableColumns[n - 1];
|
||||
this.showTableColumns[n - 1] = temp;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
//后移
|
||||
toDown(scope) {
|
||||
if (scope.$index == this.showTableColumns.length - 1) {
|
||||
return false;
|
||||
}
|
||||
let n;
|
||||
for (let i = 0; i < this.showTableColumns.length; i++) {
|
||||
if (this.showTableColumns[i].prop_ == scope.row.prop_) {
|
||||
n = i;
|
||||
}
|
||||
}
|
||||
let temp = this.showTableColumns[n];
|
||||
this.showTableColumns[n] = this.showTableColumns[n + 1];
|
||||
this.showTableColumns[n + 1] = temp;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
//恢复默认
|
||||
toDefault() {
|
||||
this.showTableColumns = JSON.parse(JSON.stringify(this.showTableColumnsDefault));
|
||||
this.$forceUpdate();
|
||||
},
|
||||
//完成列表字段设置
|
||||
saveAndCloseColumnSetDialog() {
|
||||
let tableNo = this.tableId;
|
||||
let tableColumns = JSON.stringify(this.showTableColumns);
|
||||
this.columnSetDialogVisible = false;
|
||||
this.$api.tableColumnAPI
|
||||
.saveShowColumns({tableNo:tableNo,tableColumns:tableColumns})
|
||||
.then(res => {
|
||||
let arr = JSON.parse(JSON.stringify(this.showTableColumns));
|
||||
this.formTableData = [];
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i].select) {
|
||||
this.formTableData.push(arr[i]);
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(r => {
|
||||
console.log(r);
|
||||
});
|
||||
},
|
||||
// 合计
|
||||
getSummaries(param){
|
||||
const { columns, data } = param;
|
||||
let sums=[];
|
||||
columns.forEach((column, index) => { //计算不含税金额总计
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
if (column.property!=='totalRepertoryCount'
|
||||
&&column.property!=='totalCount') {
|
||||
sums[index] = '';
|
||||
return;
|
||||
}
|
||||
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
if (column.property==='totalCount') {
|
||||
if(sums[index]) {
|
||||
sums[index] = this.summary.totalCount;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (column.property==='totalRepertoryCount') {
|
||||
if(sums[index]) {
|
||||
sums[index] = this.summary.totalRepertoryCount;
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
console.log("------------------")
|
||||
console.log(sums)
|
||||
return sums;
|
||||
},
|
||||
//关闭字段设置弹出
|
||||
handleClose() {
|
||||
this.showTableColumns = JSON.parse(JSON.stringify(this.showTableColumnsTemp));
|
||||
this.columnSetDialogVisible = false;
|
||||
|
||||
},
|
||||
/**
|
||||
* 获取显示字段
|
||||
*/
|
||||
getShowColumns() {
|
||||
let tableNo = this.tableId;
|
||||
this.formTableData = [];
|
||||
|
||||
this.$api.tableColumnAPI
|
||||
.getShowColumns({tableNo:tableNo})
|
||||
.then(res => {
|
||||
if(res.code==0){
|
||||
if(res.results){
|
||||
this.showTableColumns = JSON.parse(res.results);
|
||||
let arr = JSON.parse(JSON.stringify(this.showTableColumns));
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i].select) {
|
||||
this.formTableData.push(arr[i]);
|
||||
}
|
||||
}
|
||||
this.$forceUpdate();
|
||||
}else{
|
||||
let arr = JSON.parse(JSON.stringify(this.showTableColumnsDefault));
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i].select) {
|
||||
this.formTableData.push(arr[i]);
|
||||
}
|
||||
}
|
||||
this.$forceUpdate();
|
||||
}
|
||||
}else{
|
||||
this.$message({
|
||||
message: res.msg ? res.msg : "获取列表信息失败",
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.catch(r => {
|
||||
this.$message({
|
||||
message: r,
|
||||
type: "error"
|
||||
});
|
||||
console.log(r);
|
||||
});
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
>>>.sys-search .el-input__inner{
|
||||
width: 100%;
|
||||
}
|
||||
.dialog-form{
|
||||
position: relative;
|
||||
}
|
||||
.dialog-line{
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
}
|
||||
.dialog-line .dialog-form-inline{
|
||||
position: relative;
|
||||
width: 50%;
|
||||
margin-right: 0;
|
||||
}
|
||||
.dialog-line .dialog-form-inline-single{
|
||||
position: relative;
|
||||
width: 100%;
|
||||
margin-right: 0;
|
||||
}
|
||||
>>>.dialog-line .el-input__inner{
|
||||
width: 100% !important;;
|
||||
}
|
||||
>>>.dialog-line .el-form-item__content{
|
||||
width: calc(100% - 80px) !important;;
|
||||
}
|
||||
>>>.dialog-line .el-input,>>>.dialog-line .el-cascader{
|
||||
width: 100% !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
<template>
|
||||
<div class="sys-box">
|
||||
<div class="sys-operate">
|
||||
<el-button type="primary" @click="showColumnSetDialog">{{config.configureBtnName}}</el-button>
|
||||
</div>
|
||||
<div class="sys-search">
|
||||
<el-form inline class="form_item_search_out">
|
||||
<div class='form_item_input_out'>
|
||||
<el-form-item label="物料" style='width:33%' class="form_item-inline">
|
||||
<el-input v-model="search_data.fuzzySearch" placeholder="物料代码、名称和规格模糊查询" clearable ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" style='width:33%' class="form_item-inline">
|
||||
<el-select v-model="search_data.facilityId" placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="item in fac_type_list1"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="批号" style='width:33%' class="form_item-inline">
|
||||
<el-input v-model="search_data.batch" placeholder="请输入批号" clearable ></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class='form_item_btn_out'>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="search()">查询</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="sys-table">
|
||||
<el-table border
|
||||
v-if="formTableData.length>0"
|
||||
id="out-table"
|
||||
ref="tb"
|
||||
v-loading="pictLoading"
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
:data="tableData"
|
||||
:header-cell-style="{fontWeight: 'normal', textAlign: 'center', backgroundColor: '#eceff4', color: '#222'}"
|
||||
>
|
||||
|
||||
<el-table-column v-for="(items,index) in formTableData" :key="index" :prop="items.prop_" :label="items.title"
|
||||
align="center" show-overflow-tooltip>
|
||||
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="sys-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="search_data.pageno"
|
||||
:page-sizes="pageSizes"
|
||||
:page-size="search_data.pagesize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
></el-pagination>
|
||||
</div>
|
||||
<!-- 状态控制 -->
|
||||
<el-dialog :title="columnSetDialogTitle" center :visible.sync="columnSetDialogVisible" width="531px" :before-close="handleClose">
|
||||
<el-table border
|
||||
:data="showTableColumns"
|
||||
:key="Math.random()"
|
||||
max-height="350"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="title"
|
||||
label="列表名称"
|
||||
width="180" fixed>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="select"
|
||||
label="是否显示"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.select">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="toUp(scope)">前移</el-button>
|
||||
<el-button type="text" size="small" @click="toDown(scope)">后移</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row type="flex" class="row-bg" justify="center" style="margin-top: 10px;">
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" size="middle" @click="saveAndCloseColumnSetDialog">完成</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" size="middle" @click="toDefault">恢复默认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState, mapActions, mapGetters} from "vuex";
|
||||
import config from "@/utils/config.js";
|
||||
import FileSaver from 'file-saver'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
total: 0, //总条数
|
||||
pageSizes: [10, 20, 50], //每页展示多少条
|
||||
search_data: {
|
||||
pageno: 1,
|
||||
pagesize: 10,
|
||||
isPC: -1
|
||||
},
|
||||
config: config,
|
||||
tableData: [],
|
||||
allotIds: [],
|
||||
allotTime: '',
|
||||
dialogTitle: "",
|
||||
time: "",
|
||||
selectDeptId:'',
|
||||
formDataTime: "",
|
||||
fac_type_list1:[],//仓库
|
||||
fac_type_list2:[],//仓库
|
||||
auditSignList: [],
|
||||
companyList: [],
|
||||
createByList: [],
|
||||
depOptions: [],
|
||||
formData: {
|
||||
|
||||
},
|
||||
summary:{},
|
||||
btnDelDisabled: true,
|
||||
btnOtherDisabled: true,
|
||||
chooseClientrVisible: false,
|
||||
dialogLoading: false,
|
||||
chooseUserVisible: false,
|
||||
chooseMaterielVisible: false,
|
||||
columnSetDialogVisible: false,
|
||||
advanceQueryDialogVisible: false,
|
||||
chooseSupplierVisible:false,//选择供应商
|
||||
columnSetDialogTitle: "设置显示字段列表",
|
||||
tableId: 'stock1_table',
|
||||
pictLoading: false,
|
||||
//默认列表数据
|
||||
showTableColumnsDefault: [
|
||||
{title: "仓库", prop_: "facilityName", select: true},
|
||||
{title: "仓位", prop_: "facilityLocationName", select: false},
|
||||
{title: "物料代码", prop_: "serialNo", select: true},
|
||||
{title: "物料名称", prop_: "materielName", select: true},
|
||||
{title: "规格型号", prop_: "specification", select: true},
|
||||
{title: "批号", prop_: "batch", select: false},
|
||||
{title: "主计量单位", prop_: "unitUomName", select: true},
|
||||
{title: "主单位库存数量", prop_: "totalCount", select: true},
|
||||
{title: "辅助单位", prop_: "supportUomName", select: false},
|
||||
{title: "辅助单位库存数量", prop_: "totalRepertoryCount", select: false},
|
||||
{title: "换算系数", prop_: "convCoefficient", select: false}
|
||||
],
|
||||
///弹出页面列表数据
|
||||
showTableColumns: [
|
||||
{title: "仓库", prop_: "facilityName", select: true},
|
||||
{title: "仓位", prop_: "facilityLocationName", select: false},
|
||||
{title: "物料代码", prop_: "serialNo", select: true},
|
||||
{title: "物料名称", prop_: "materielName", select: true},
|
||||
{title: "规格型号", prop_: "specification", select: true},
|
||||
{title: "批号", prop_: "batch", select: false},
|
||||
{title: "主计量单位", prop_: "unitUomName", select: true},
|
||||
{title: "主单位库存数量", prop_: "totalCount", select: true},
|
||||
{title: "辅助单位", prop_: "supportUomName", select: false},
|
||||
{title: "辅助单位库存数量", prop_: "totalRepertoryCount", select: false},
|
||||
{title: "换算系数", prop_: "convCoefficient", select: false}
|
||||
],
|
||||
showTableColumnsTemp: [],//弹框弹出的时候,保存当前的列表数据
|
||||
//显示的列表字段
|
||||
formTableData: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var _this = this;
|
||||
document.onkeydown = e => {
|
||||
if (e.key === "Enter") {
|
||||
_this.search()
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
userInfo: "user/getUserInfo"
|
||||
}),
|
||||
},
|
||||
mounted() {
|
||||
this.showTableColumns = JSON.parse(JSON.stringify(this.showTableColumns));
|
||||
this.showTableColumnsTemp = JSON.parse(JSON.stringify(this.showTableColumns));
|
||||
this.formData.createBy = this.userInfo.userId;
|
||||
this.formData.createByName =this.userInfo.name
|
||||
this.getList()
|
||||
this.getShowColumns();
|
||||
this.initialize();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
initialize() {
|
||||
this.$api.gylInventoryAPI
|
||||
.facilityList({pageno:1,pagesize:1000,auditSign:179})
|
||||
.then(res => {
|
||||
this.fac_type_list1 = res.data.datas?res.data.datas:''
|
||||
this.fac_type_list2 = res.data.datas?res.data.datas:''
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
|
||||
settime(n) {
|
||||
if (n.toString().length == 1) {
|
||||
return "0" + n.toString()
|
||||
} else {
|
||||
return n;
|
||||
}
|
||||
},
|
||||
// 查询
|
||||
search() {
|
||||
this.search_data.pageno = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
// 生产入库列表
|
||||
getList() {
|
||||
this.pictLoading = true;
|
||||
this.$api.saleStockAPI
|
||||
.getStockList(this.search_data)
|
||||
.then(res => {
|
||||
this.pictLoading = false;
|
||||
if(res.data) {
|
||||
console.log(res.data)
|
||||
this.total = res.data.totalRows;
|
||||
this.tableData = res.data.datas ? res.data.datas : [];
|
||||
this.summary = res.total
|
||||
} else {
|
||||
this.total = 0;
|
||||
this.tableData = [];
|
||||
}
|
||||
}).catch(r => {
|
||||
console.log(r);
|
||||
});
|
||||
},
|
||||
|
||||
// 每页显示多少条
|
||||
handleSizeChange(val) {
|
||||
this.search_data.pagesize = val;
|
||||
this.getList();
|
||||
},
|
||||
// 上下分页
|
||||
handleCurrentChange(val) {
|
||||
this.search_data.pageno = val;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
//设置显示字段
|
||||
showColumnSetDialog() {
|
||||
this.columnSetDialogVisible = true;
|
||||
this.showTableColumnsTemp = JSON.parse(JSON.stringify(this.showTableColumns));
|
||||
},
|
||||
//前移
|
||||
toUp(scope) {
|
||||
if (scope.$index == 0) {
|
||||
return false;
|
||||
}
|
||||
let n;
|
||||
for (let i = 0; i < this.showTableColumns.length; i++) {
|
||||
if (this.showTableColumns[i].prop_ == scope.row.prop_) {
|
||||
n = i;
|
||||
}
|
||||
}
|
||||
let temp = this.showTableColumns[n];
|
||||
this.showTableColumns[n] = this.showTableColumns[n - 1];
|
||||
this.showTableColumns[n - 1] = temp;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
//后移
|
||||
toDown(scope) {
|
||||
if (scope.$index == this.showTableColumns.length - 1) {
|
||||
return false;
|
||||
}
|
||||
let n;
|
||||
for (let i = 0; i < this.showTableColumns.length; i++) {
|
||||
if (this.showTableColumns[i].prop_ == scope.row.prop_) {
|
||||
n = i;
|
||||
}
|
||||
}
|
||||
let temp = this.showTableColumns[n];
|
||||
this.showTableColumns[n] = this.showTableColumns[n + 1];
|
||||
this.showTableColumns[n + 1] = temp;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
//恢复默认
|
||||
toDefault() {
|
||||
this.showTableColumns = JSON.parse(JSON.stringify(this.showTableColumnsDefault));
|
||||
this.$forceUpdate();
|
||||
},
|
||||
//完成列表字段设置
|
||||
saveAndCloseColumnSetDialog() {
|
||||
let tableNo = this.tableId;
|
||||
let tableColumns = JSON.stringify(this.showTableColumns);
|
||||
this.columnSetDialogVisible = false;
|
||||
this.$api.tableColumnAPI
|
||||
.saveShowColumns({tableNo:tableNo,tableColumns:tableColumns})
|
||||
.then(res => {
|
||||
let arr = JSON.parse(JSON.stringify(this.showTableColumns));
|
||||
this.formTableData = [];
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i].select) {
|
||||
this.formTableData.push(arr[i]);
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(r => {
|
||||
console.log(r);
|
||||
});
|
||||
},
|
||||
// 合计
|
||||
getSummaries(param){
|
||||
const { columns, data } = param;
|
||||
let sums=[];
|
||||
columns.forEach((column, index) => { //计算不含税金额总计
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
if (column.property!=='totalRepertoryCount'
|
||||
&&column.property!=='totalCount') {
|
||||
sums[index] = '';
|
||||
return;
|
||||
}
|
||||
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
if (column.property==='totalCount') {
|
||||
if(sums[index]) {
|
||||
sums[index] = this.summary.totalCount;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (column.property==='totalRepertoryCount') {
|
||||
if(sums[index]) {
|
||||
sums[index] = this.summary.totalRepertoryCount;
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
console.log("------------------")
|
||||
console.log(sums)
|
||||
return sums;
|
||||
},
|
||||
//关闭字段设置弹出
|
||||
handleClose() {
|
||||
this.showTableColumns = JSON.parse(JSON.stringify(this.showTableColumnsTemp));
|
||||
this.columnSetDialogVisible = false;
|
||||
|
||||
},
|
||||
/**
|
||||
* 获取显示字段
|
||||
*/
|
||||
getShowColumns() {
|
||||
let tableNo = this.tableId;
|
||||
this.formTableData = [];
|
||||
|
||||
this.$api.tableColumnAPI
|
||||
.getShowColumns({tableNo:tableNo})
|
||||
.then(res => {
|
||||
if(res.code==0){
|
||||
if(res.results){
|
||||
this.showTableColumns = JSON.parse(res.results);
|
||||
let arr = JSON.parse(JSON.stringify(this.showTableColumns));
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i].select) {
|
||||
this.formTableData.push(arr[i]);
|
||||
}
|
||||
}
|
||||
this.$forceUpdate();
|
||||
}else{
|
||||
let arr = JSON.parse(JSON.stringify(this.showTableColumnsDefault));
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i].select) {
|
||||
this.formTableData.push(arr[i]);
|
||||
}
|
||||
}
|
||||
this.$forceUpdate();
|
||||
}
|
||||
}else{
|
||||
this.$message({
|
||||
message: res.msg ? res.msg : "获取列表信息失败",
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.catch(r => {
|
||||
this.$message({
|
||||
message: r,
|
||||
type: "error"
|
||||
});
|
||||
console.log(r);
|
||||
});
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
>>>.sys-search .el-input__inner{
|
||||
width: 100%;
|
||||
}
|
||||
.dialog-form{
|
||||
position: relative;
|
||||
}
|
||||
.dialog-line{
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
}
|
||||
.dialog-line .dialog-form-inline{
|
||||
position: relative;
|
||||
width: 50%;
|
||||
margin-right: 0;
|
||||
}
|
||||
.dialog-line .dialog-form-inline-single{
|
||||
position: relative;
|
||||
width: 100%;
|
||||
margin-right: 0;
|
||||
}
|
||||
>>>.dialog-line .el-input__inner{
|
||||
width: 100% !important;;
|
||||
}
|
||||
>>>.dialog-line .el-form-item__content{
|
||||
width: calc(100% - 80px) !important;;
|
||||
}
|
||||
>>>.dialog-line .el-input,>>>.dialog-line .el-cascader{
|
||||
width: 100% !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,92 +1,100 @@
|
|||
import base from "../../../api/base";
|
||||
import companyAPI from "../../../api/companyAPI";
|
||||
const state = {
|
||||
commonUserList: [],
|
||||
commonDepts: [],
|
||||
logoUrl:undefined,
|
||||
logoUrlFlag:false,
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
setCommonUserList: (state, data) => {
|
||||
state.commonUserList = data
|
||||
sessionStorage.setItem("commonUserList", JSON.stringify(state.commonUserList));
|
||||
},
|
||||
setCommonDeptList: (state, data) => {
|
||||
state.commonDepts = data
|
||||
sessionStorage.setItem("commonUserList", JSON.stringify(state.commonDepts));
|
||||
},
|
||||
setLogoUrl:(state,data)=>{
|
||||
if(data!=''){
|
||||
state.logoUrl = base.ftpPrefix+data
|
||||
}else {
|
||||
state.logoUrl = undefined
|
||||
}
|
||||
state.logoUrlFlag = true
|
||||
sessionStorage.setItem("logoUrl",state.logoUrl)
|
||||
}
|
||||
}
|
||||
|
||||
const actions = {
|
||||
getUsers({ commit }, user) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.$api.commonAPI.getUsers().then(res => {
|
||||
if (res.code === 0) {
|
||||
commit('setCommonUserList', res.datas)
|
||||
}
|
||||
resolve(res);
|
||||
}).catch(r => {
|
||||
console.log(r);
|
||||
reject(r);
|
||||
})
|
||||
});
|
||||
},
|
||||
getDepts({ commit }, depts) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.$api.commonAPI.getDepts().then(res => {
|
||||
if (res.code === 0) {
|
||||
commit('setCommonDeptList', res.datas)
|
||||
}
|
||||
resolve(res);
|
||||
}).catch(r => {
|
||||
console.log(r);
|
||||
reject(r);
|
||||
})
|
||||
});
|
||||
},
|
||||
getLogoUrl({commit}){
|
||||
return new Promise((resolve,reject) => {
|
||||
console.log("cesssssss")
|
||||
companyAPI.detail().then(res=>{
|
||||
if(res.code ===0){
|
||||
console.log("cesssssss")
|
||||
commit('setLogoUrl',res.result.logoUrl)
|
||||
}
|
||||
resolve(res)
|
||||
}).catch(r=>{
|
||||
reject(r)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const getters = {
|
||||
getCommonUserList: state => {
|
||||
if (!state.commonUserList) {
|
||||
state.commonUserList = sessionStorage.getItem("commonUserList");
|
||||
}
|
||||
return state.commonUserList;
|
||||
},
|
||||
getLogoUrl:state =>{
|
||||
if(!state.logoUrl){
|
||||
state.logoUrl = sessionStorage.getItem("logoUrl")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
mutations,
|
||||
actions
|
||||
}
|
||||
import base from "../../../api/base";
|
||||
import companyAPI from "../../../api/companyAPI";
|
||||
const state = {
|
||||
commonUserList: [],
|
||||
commonDepts: [],
|
||||
logoUrl:undefined,
|
||||
logoUrlFlag:false,
|
||||
companyInfo:{}
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
setCommonUserList: (state, data) => {
|
||||
state.commonUserList = data
|
||||
sessionStorage.setItem("commonUserList", JSON.stringify(state.commonUserList));
|
||||
},
|
||||
setCommonDeptList: (state, data) => {
|
||||
state.commonDepts = data
|
||||
sessionStorage.setItem("commonUserList", JSON.stringify(state.commonDepts));
|
||||
},
|
||||
setLogoUrl:(state,data)=>{
|
||||
if(data!=''){
|
||||
state.logoUrl = base.ftpPrefix+data
|
||||
}else {
|
||||
state.logoUrl = undefined
|
||||
}
|
||||
state.logoUrlFlag = true
|
||||
sessionStorage.setItem("logoUrl",state.logoUrl)
|
||||
},
|
||||
setCompanyInfo: (state, data) => {
|
||||
state.companyInfo = data;
|
||||
sessionStorage.setItem("companyInfo", JSON.stringify(data));
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
const actions = {
|
||||
getUsers({ commit }, user) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.$api.commonAPI.getUsers().then(res => {
|
||||
if (res.code === 0) {
|
||||
commit('setCommonUserList', res.datas)
|
||||
}
|
||||
resolve(res);
|
||||
}).catch(r => {
|
||||
console.log(r);
|
||||
reject(r);
|
||||
})
|
||||
});
|
||||
},
|
||||
getDepts({ commit }, depts) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.$api.commonAPI.getDepts().then(res => {
|
||||
if (res.code === 0) {
|
||||
commit('setCommonDeptList', res.datas)
|
||||
}
|
||||
resolve(res);
|
||||
}).catch(r => {
|
||||
console.log(r);
|
||||
reject(r);
|
||||
})
|
||||
});
|
||||
},
|
||||
getLogoUrl({commit}){
|
||||
return new Promise((resolve,reject) => {
|
||||
console.log("cesssssss")
|
||||
companyAPI.detail().then(res=>{
|
||||
if(res.code ===0){
|
||||
console.log("cesssssss")
|
||||
commit('setLogoUrl',res.result.logoUrl)
|
||||
commit('setCompanyInfo', res.result);
|
||||
|
||||
}
|
||||
resolve(res)
|
||||
}).catch(r=>{
|
||||
reject(r)
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
const getters = {
|
||||
getCommonUserList: state => {
|
||||
if (!state.commonUserList) {
|
||||
state.commonUserList = sessionStorage.getItem("commonUserList");
|
||||
}
|
||||
return state.commonUserList;
|
||||
},
|
||||
getLogoUrl:state =>{
|
||||
if(!state.logoUrl){
|
||||
state.logoUrl = sessionStorage.getItem("logoUrl")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
mutations,
|
||||
actions
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue