Merge branch 'dev-sy-9-24'
This commit is contained in:
commit
f556d3d085
|
|
@ -1,83 +1,87 @@
|
|||
import { Message, MessageBox, Notification, Loading } from 'element-ui'
|
||||
|
||||
let loadingInstance;
|
||||
let loadingInstance
|
||||
|
||||
export default {
|
||||
// 消息提示
|
||||
msg(content) {
|
||||
Message.info(content)
|
||||
},
|
||||
// 错误消息
|
||||
msgError(content) {
|
||||
Message.error(content)
|
||||
},
|
||||
// 成功消息
|
||||
msgSuccess(content) {
|
||||
Message.success(content)
|
||||
},
|
||||
// 警告消息
|
||||
msgWarning(content) {
|
||||
Message.warning(content)
|
||||
},
|
||||
// 弹出提示
|
||||
alert(content) {
|
||||
MessageBox.alert(content, "系统提示")
|
||||
},
|
||||
// 错误提示
|
||||
alertError(content) {
|
||||
MessageBox.alert(content, "系统提示", { type: 'error' })
|
||||
},
|
||||
// 成功提示
|
||||
alertSuccess(content) {
|
||||
MessageBox.alert(content, "系统提示", { type: 'success' })
|
||||
},
|
||||
// 警告提示
|
||||
alertWarning(content) {
|
||||
MessageBox.alert(content, "系统提示", { type: 'warning' })
|
||||
},
|
||||
// 通知提示
|
||||
notify(content) {
|
||||
Notification.info(content)
|
||||
},
|
||||
// 错误通知
|
||||
notifyError(content) {
|
||||
Notification.error(content);
|
||||
},
|
||||
// 成功通知
|
||||
notifySuccess(content) {
|
||||
Notification.success(content)
|
||||
},
|
||||
// 警告通知
|
||||
notifyWarning(content) {
|
||||
Notification.warning(content)
|
||||
},
|
||||
// 确认窗体
|
||||
confirm(content) {
|
||||
return MessageBox.confirm(content, "系统提示", {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: "warning",
|
||||
})
|
||||
},
|
||||
// 提交内容
|
||||
prompt(content) {
|
||||
return MessageBox.prompt(content, "系统提示", {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: "warning",
|
||||
})
|
||||
},
|
||||
// 打开遮罩层
|
||||
loading(content) {
|
||||
loadingInstance = Loading.service({
|
||||
lock: true,
|
||||
text: content,
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
})
|
||||
},
|
||||
// 关闭遮罩层
|
||||
closeLoading() {
|
||||
loadingInstance.close();
|
||||
}
|
||||
// 消息提示
|
||||
msg(content) {
|
||||
Message.closeAll()
|
||||
Message.info(content)
|
||||
},
|
||||
// 错误消息
|
||||
msgError(content) {
|
||||
Message.closeAll()
|
||||
Message.error(content)
|
||||
},
|
||||
// 成功消息
|
||||
msgSuccess(content) {
|
||||
Message.closeAll()
|
||||
Message.success(content)
|
||||
},
|
||||
// 警告消息
|
||||
msgWarning(content) {
|
||||
Message.closeAll()
|
||||
Message.warning(content)
|
||||
},
|
||||
// 弹出提示
|
||||
alert(content) {
|
||||
MessageBox.alert(content, '系统提示')
|
||||
},
|
||||
// 错误提示
|
||||
alertError(content) {
|
||||
MessageBox.alert(content, '系统提示', { type: 'error' })
|
||||
},
|
||||
// 成功提示
|
||||
alertSuccess(content) {
|
||||
MessageBox.alert(content, '系统提示', { type: 'success' })
|
||||
},
|
||||
// 警告提示
|
||||
alertWarning(content) {
|
||||
MessageBox.alert(content, '系统提示', { type: 'warning' })
|
||||
},
|
||||
// 通知提示
|
||||
notify(content) {
|
||||
Notification.info(content)
|
||||
},
|
||||
// 错误通知
|
||||
notifyError(content) {
|
||||
Notification.error(content)
|
||||
},
|
||||
// 成功通知
|
||||
notifySuccess(content) {
|
||||
Notification.success(content)
|
||||
},
|
||||
// 警告通知
|
||||
notifyWarning(content) {
|
||||
Notification.warning(content)
|
||||
},
|
||||
// 确认窗体
|
||||
confirm(content) {
|
||||
return MessageBox.confirm(content, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
},
|
||||
// 提交内容
|
||||
prompt(content) {
|
||||
return MessageBox.prompt(content, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
},
|
||||
// 打开遮罩层
|
||||
loading(content) {
|
||||
loadingInstance = Loading.service({
|
||||
lock: true,
|
||||
text: content,
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
},
|
||||
// 关闭遮罩层
|
||||
closeLoading() {
|
||||
loadingInstance.close()
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,179 +3,244 @@ import { Notification, MessageBox, Message, Loading } from 'element-ui'
|
|||
import store from '@/store'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import errorCode from '@/utils/errorCode'
|
||||
import { tansParams, blobValidate } from "@/utils/ruoyi";
|
||||
import { tansParams, blobValidate } from '@/utils/ruoyi'
|
||||
import cache from '@/plugins/cache'
|
||||
import { saveAs } from 'file-saver'
|
||||
|
||||
let downloadLoadingInstance;
|
||||
let downloadLoadingInstance
|
||||
// 是否显示重新登录
|
||||
export let isRelogin = { show: false };
|
||||
export let isRelogin = { show: false }
|
||||
|
||||
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
// 超时
|
||||
timeout: 10000
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
// 超时
|
||||
timeout: 10000,
|
||||
})
|
||||
|
||||
// request拦截器
|
||||
service.interceptors.request.use(config => {
|
||||
// 是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
// 是否需要防止数据重复提交
|
||||
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
// get请求映射params参数
|
||||
if (config.method === 'get' && config.params) {
|
||||
let url = config.url + '?' + tansParams(config.params);
|
||||
url = url.slice(0, -1);
|
||||
config.params = {};
|
||||
config.url = url;
|
||||
}
|
||||
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
|
||||
const requestObj = {
|
||||
url: config.url,
|
||||
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
|
||||
time: new Date().getTime()
|
||||
}
|
||||
const requestSize = Object.keys(JSON.stringify(requestObj)).length; // 请求数据大小
|
||||
const limitSize = 5 * 1024 * 1024; // 限制存放数据5M
|
||||
if (requestSize >= limitSize) {
|
||||
console.warn(`[${config.url}]: ` + '请求数据大小超出允许的5M限制,无法进行防重复提交验证。')
|
||||
return config;
|
||||
}
|
||||
const sessionObj = cache.session.getJSON('sessionObj')
|
||||
if (sessionObj === undefined || sessionObj === null || sessionObj === '') {
|
||||
cache.session.setJSON('sessionObj', requestObj)
|
||||
} else {
|
||||
const s_url = sessionObj.url; // 请求地址
|
||||
const s_data = sessionObj.data; // 请求数据
|
||||
const s_time = sessionObj.time; // 请求时间
|
||||
const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交
|
||||
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
|
||||
const message = '数据正在处理,请勿重复提交';
|
||||
console.warn(`[${s_url}]: ` + message)
|
||||
return Promise.reject(new Error(message))
|
||||
} else {
|
||||
cache.session.setJSON('sessionObj', requestObj)
|
||||
}
|
||||
}
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
})
|
||||
service.interceptors.request.use(
|
||||
(config) => {
|
||||
// 是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
// 是否需要防止数据重复提交
|
||||
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
// get请求映射params参数
|
||||
if (config.method === 'get' && config.params) {
|
||||
let url = config.url + '?' + tansParams(config.params)
|
||||
url = url.slice(0, -1)
|
||||
config.params = {}
|
||||
config.url = url
|
||||
}
|
||||
if (
|
||||
!isRepeatSubmit &&
|
||||
(config.method === 'post' || config.method === 'put')
|
||||
) {
|
||||
const requestObj = {
|
||||
url: config.url,
|
||||
data:
|
||||
typeof config.data === 'object'
|
||||
? JSON.stringify(config.data)
|
||||
: config.data,
|
||||
time: new Date().getTime(),
|
||||
}
|
||||
const requestSize = Object.keys(JSON.stringify(requestObj)).length // 请求数据大小
|
||||
const limitSize = 5 * 1024 * 1024 // 限制存放数据5M
|
||||
if (requestSize >= limitSize) {
|
||||
console.warn(
|
||||
`[${config.url}]: ` +
|
||||
'请求数据大小超出允许的5M限制,无法进行防重复提交验证。',
|
||||
)
|
||||
return config
|
||||
}
|
||||
const sessionObj = cache.session.getJSON('sessionObj')
|
||||
if (
|
||||
sessionObj === undefined ||
|
||||
sessionObj === null ||
|
||||
sessionObj === ''
|
||||
) {
|
||||
cache.session.setJSON('sessionObj', requestObj)
|
||||
} else {
|
||||
const s_url = sessionObj.url // 请求地址
|
||||
const s_data = sessionObj.data // 请求数据
|
||||
const s_time = sessionObj.time // 请求时间
|
||||
const interval = 1000 // 间隔时间(ms),小于此时间视为重复提交
|
||||
if (
|
||||
s_data === requestObj.data &&
|
||||
requestObj.time - s_time < interval &&
|
||||
s_url === requestObj.url
|
||||
) {
|
||||
const message = '数据正在处理,请勿重复提交'
|
||||
console.warn(`[${s_url}]: ` + message)
|
||||
return Promise.reject(new Error(message))
|
||||
} else {
|
||||
cache.session.setJSON('sessionObj', requestObj)
|
||||
}
|
||||
}
|
||||
}
|
||||
return config
|
||||
},
|
||||
(error) => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
},
|
||||
)
|
||||
|
||||
// 响应拦截器
|
||||
service.interceptors.response.use(res => {
|
||||
// 未设置状态码则默认成功状态
|
||||
const code = res.data.code || 200;
|
||||
// 获取错误信息
|
||||
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||
// 二进制数据则直接返回
|
||||
if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
|
||||
return res.data
|
||||
}
|
||||
if (code === 401) {
|
||||
if (!isRelogin.show) {
|
||||
isRelogin.show = true;
|
||||
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
||||
isRelogin.show = false;
|
||||
store.dispatch('LogOut').then(() => {
|
||||
// location.href = '/login';
|
||||
// location.href = '/gl/login';
|
||||
service.interceptors.response.use(
|
||||
(res) => {
|
||||
// 未设置状态码则默认成功状态
|
||||
const code = res.data.code || 200
|
||||
// 获取错误信息
|
||||
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||
// 二进制数据则直接返回
|
||||
if (
|
||||
res.request.responseType === 'blob' ||
|
||||
res.request.responseType === 'arraybuffer'
|
||||
) {
|
||||
return res.data
|
||||
}
|
||||
if (code === 401) {
|
||||
if (!isRelogin.show) {
|
||||
isRelogin.show = true
|
||||
MessageBox.confirm(
|
||||
'登录状态已过期,您可以继续留在该页面,或者重新登录',
|
||||
'系统提示',
|
||||
{
|
||||
confirmButtonText: '重新登录',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
},
|
||||
)
|
||||
.then(() => {
|
||||
isRelogin.show = false
|
||||
store.dispatch('LogOut').then(() => {
|
||||
// location.href = '/login';
|
||||
// location.href = '/gl/login';
|
||||
|
||||
location.href = process.env.VUE_APP_ENV === 'production-nw' ? '/sgzbgl/login' : '/login'
|
||||
})
|
||||
}).catch(() => {
|
||||
isRelogin.show = false;
|
||||
});
|
||||
}
|
||||
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
||||
} else if (code === 500) {
|
||||
Message({ message: msg, type: 'error' })
|
||||
return Promise.reject(new Error(msg))
|
||||
} else if (code === 601) {
|
||||
Message({ message: msg, type: 'warning' })
|
||||
return Promise.reject('error')
|
||||
} else if (code !== 200) {
|
||||
Notification.error({ title: msg })
|
||||
return Promise.reject('error')
|
||||
} else {
|
||||
return res.data
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "后端接口连接异常";
|
||||
} else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
} else if (message.includes("Request failed with status code")) {
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
}
|
||||
Message({ message: message, type: 'error', duration: 5 * 1000 })
|
||||
return Promise.reject(error)
|
||||
}
|
||||
location.href =
|
||||
process.env.VUE_APP_ENV === 'production-nw'
|
||||
? '/sgzbgl/login'
|
||||
: '/login'
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
isRelogin.show = false
|
||||
})
|
||||
}
|
||||
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
||||
} else if (code === 500) {
|
||||
Message.closeAll()
|
||||
Message({ message: msg, type: 'error' })
|
||||
return Promise.reject(new Error(msg))
|
||||
} else if (code === 601) {
|
||||
Message.closeAll()
|
||||
Message({ message: msg, type: 'warning' })
|
||||
return Promise.reject('error')
|
||||
} else if (code !== 200) {
|
||||
Notification.closeAll()
|
||||
Notification.error({ title: msg })
|
||||
return Promise.reject('error')
|
||||
} else {
|
||||
return res.data
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
console.log('err' + error)
|
||||
let { message } = error
|
||||
if (message == 'Network Error') {
|
||||
message = '后端接口连接异常'
|
||||
} else if (message.includes('timeout')) {
|
||||
message = '系统接口请求超时'
|
||||
} else if (message.includes('Request failed with status code')) {
|
||||
message = '系统接口' + message.substr(message.length - 3) + '异常'
|
||||
}
|
||||
Message.closeAll()
|
||||
Message({ message: message, type: 'error', duration: 5 * 1000 })
|
||||
return Promise.reject(error)
|
||||
},
|
||||
)
|
||||
|
||||
// 通用下载方法
|
||||
export function download(url, params, filename, config) {
|
||||
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
|
||||
return service.post(url, params, {
|
||||
transformRequest: [(params) => { return tansParams(params) }],
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
responseType: 'blob',
|
||||
...config
|
||||
}).then(async (data) => {
|
||||
const isBlob = blobValidate(data);
|
||||
if (isBlob) {
|
||||
const blob = new Blob([data])
|
||||
saveAs(blob, filename)
|
||||
} else {
|
||||
const resText = await data.text();
|
||||
const rspObj = JSON.parse(resText);
|
||||
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
|
||||
Message.error(errMsg);
|
||||
}
|
||||
downloadLoadingInstance.close();
|
||||
}).catch((r) => {
|
||||
console.error(r)
|
||||
Message.error('下载文件出现错误,请联系管理员!')
|
||||
downloadLoadingInstance.close();
|
||||
})
|
||||
downloadLoadingInstance = Loading.service({
|
||||
text: '正在下载数据,请稍候',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
return service
|
||||
.post(url, params, {
|
||||
transformRequest: [
|
||||
(params) => {
|
||||
return tansParams(params)
|
||||
},
|
||||
],
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
responseType: 'blob',
|
||||
...config,
|
||||
})
|
||||
.then(async (data) => {
|
||||
const isBlob = blobValidate(data)
|
||||
if (isBlob) {
|
||||
const blob = new Blob([data])
|
||||
saveAs(blob, filename)
|
||||
} else {
|
||||
const resText = await data.text()
|
||||
const rspObj = JSON.parse(resText)
|
||||
const errMsg =
|
||||
errorCode[rspObj.code] || rspObj.msg || errorCode['default']
|
||||
Message.error(errMsg)
|
||||
}
|
||||
downloadLoadingInstance.close()
|
||||
})
|
||||
.catch((r) => {
|
||||
console.error(r)
|
||||
Message.error('下载文件出现错误,请联系管理员!')
|
||||
downloadLoadingInstance.close()
|
||||
})
|
||||
}
|
||||
|
||||
// 通用下载方法
|
||||
export function downloadJson(url, params, filename, config) {
|
||||
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
|
||||
return service.post(url, params, {
|
||||
transformRequest: [(params) => { return params }],
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
responseType: 'blob',
|
||||
...config
|
||||
}).then(async (data) => {
|
||||
const isBlob = blobValidate(data);
|
||||
if (isBlob) {
|
||||
const blob = new Blob([data])
|
||||
saveAs(blob, filename)
|
||||
} else {
|
||||
const resText = await data.text();
|
||||
const rspObj = JSON.parse(resText);
|
||||
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
|
||||
Message.error(errMsg);
|
||||
}
|
||||
downloadLoadingInstance.close();
|
||||
}).catch((r) => {
|
||||
console.error(r)
|
||||
Message.error('下载文件出现错误,请联系管理员!')
|
||||
downloadLoadingInstance.close();
|
||||
})
|
||||
downloadLoadingInstance = Loading.service({
|
||||
text: '正在下载数据,请稍候',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
return service
|
||||
.post(url, params, {
|
||||
transformRequest: [
|
||||
(params) => {
|
||||
return params
|
||||
},
|
||||
],
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
responseType: 'blob',
|
||||
...config,
|
||||
})
|
||||
.then(async (data) => {
|
||||
const isBlob = blobValidate(data)
|
||||
if (isBlob) {
|
||||
const blob = new Blob([data])
|
||||
saveAs(blob, filename)
|
||||
} else {
|
||||
const resText = await data.text()
|
||||
const rspObj = JSON.parse(resText)
|
||||
const errMsg =
|
||||
errorCode[rspObj.code] || rspObj.msg || errorCode['default']
|
||||
Message.error(errMsg)
|
||||
}
|
||||
downloadLoadingInstance.close()
|
||||
})
|
||||
.catch((r) => {
|
||||
console.error(r)
|
||||
Message.error('下载文件出现错误,请联系管理员!')
|
||||
downloadLoadingInstance.close()
|
||||
})
|
||||
}
|
||||
export default service
|
||||
|
|
|
|||
|
|
@ -75,13 +75,17 @@
|
|||
<el-form-item label="规格型号" prop="status">
|
||||
<el-cascader
|
||||
placeholder="请输入规格型号"
|
||||
collapse-tags
|
||||
:options="deviceTypeTree"
|
||||
:props="deviceTypeTreeProps"
|
||||
popper-class="popper-select"
|
||||
:show-all-levels="false"
|
||||
v-model="deviceType"
|
||||
@change="deviceTypeChange"
|
||||
ref="deviceTypeCascader"
|
||||
filterable
|
||||
style="width: 240px"
|
||||
:key="propsKey"
|
||||
:disabled="(isEdit && !isView) || isCost"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
|
|
@ -457,11 +461,11 @@ export default {
|
|||
|
||||
// 设备 树显示 配置
|
||||
deviceTypeTreeProps: {
|
||||
multiple: false,
|
||||
multiple: true,
|
||||
value: 'id',
|
||||
},
|
||||
// 选中的设备类型
|
||||
deviceType: null,
|
||||
deviceType: [],
|
||||
|
||||
// 表单参数
|
||||
form: {},
|
||||
|
|
@ -495,6 +499,7 @@ export default {
|
|||
},
|
||||
costBearingList: [],
|
||||
isCost: false,
|
||||
propsKey: 1000,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -506,7 +511,7 @@ export default {
|
|||
|
||||
this.getCostBearingFun()
|
||||
|
||||
this.GetDeviceTypeTree()
|
||||
// this.GetDeviceTypeTree()
|
||||
// this.getList();
|
||||
if (this.$route.query.taskId && !this.$route.query.isBack) {
|
||||
console.log('查看')
|
||||
|
|
@ -521,8 +526,25 @@ export default {
|
|||
this.taskId = this.viewTaskId
|
||||
|
||||
if (this.taskId) {
|
||||
this.GetTaskDetail(this.taskId)
|
||||
Promise.all([
|
||||
this.GetTaskDetail(this.taskId),
|
||||
this.GetDeviceTypeTree(),
|
||||
]).then(() => {
|
||||
let selectList = []
|
||||
this.leaseApplyDetails.forEach((e) => {
|
||||
selectList.push(
|
||||
this.getParentsById(this.deviceTypeTree, e.typeId),
|
||||
)
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.deviceType = selectList
|
||||
this.propsKey++
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.GetDeviceTypeTree()
|
||||
}
|
||||
|
||||
// console.log(typeof(this.isEdit))
|
||||
// this.$set('isEdit',this.$route.query.isEdit)
|
||||
},
|
||||
|
|
@ -560,8 +582,25 @@ export default {
|
|||
const params = {
|
||||
level: 4,
|
||||
}
|
||||
const res = await getDeviceTypeTree(params)
|
||||
this.deviceTypeTree = res.data
|
||||
getDeviceTypeTree(params).then((res) => {
|
||||
this.deviceTypeTree = res.data
|
||||
})
|
||||
},
|
||||
getParentsById(list, id) {
|
||||
for (let i in list) {
|
||||
if (list[i].id == id) {
|
||||
//查询到就返回该数组对象的value
|
||||
return [list[i].id]
|
||||
}
|
||||
if (list[i].children) {
|
||||
let node = this.getParentsById(list[i].children, id)
|
||||
if (node !== undefined) {
|
||||
//查询到把父节把父节点加到数组前面
|
||||
node.unshift(list[i].id)
|
||||
return node
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取 协议id
|
||||
async GetAgreementInfoById() {
|
||||
|
|
@ -832,6 +871,12 @@ export default {
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.deviceType.forEach((e, index) => {
|
||||
if (e[3] === row.typeId) {
|
||||
this.deviceType.splice(index, 1)
|
||||
this.propsKey++
|
||||
}
|
||||
})
|
||||
this.leaseApplyDetails.splice(row.index, 1)
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
|
|
@ -851,25 +896,74 @@ export default {
|
|||
},
|
||||
/////// 设备类型树 切换
|
||||
deviceTypeChange(val) {
|
||||
console.log(val)
|
||||
let nodes = null
|
||||
nodes =
|
||||
this.$refs.deviceTypeCascader.getCheckedNodes().length > 0
|
||||
? this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
: [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]
|
||||
if (nodes[0].level != 4) {
|
||||
return
|
||||
}
|
||||
// console.log(this.leaseApplyDetails)
|
||||
// console.log(nodes[0].data.id)
|
||||
for (let i = 0; i < this.leaseApplyDetails.length; i++) {
|
||||
if (this.leaseApplyDetails[i].typeId == nodes[0].data.id) {
|
||||
this.leaseApplyDetails.splice(i, 1)
|
||||
break
|
||||
const deviceTypeList =
|
||||
this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
|
||||
// if (val.length > 0) {
|
||||
// for (let i in val) {
|
||||
// console.log(val[i], '----+++')
|
||||
// }
|
||||
// }
|
||||
let tempList = []
|
||||
if (val.length > 0) {
|
||||
const items = val.map((e) => {
|
||||
return e[3]
|
||||
})
|
||||
for (let i in items) {
|
||||
for (let z in deviceTypeList) {
|
||||
if (deviceTypeList[z].data.id === items[i]) {
|
||||
let { num, companyId, id, unitName } =
|
||||
deviceTypeList[z].data
|
||||
tempList.push({
|
||||
createBy: this.user.name,
|
||||
typeId: id,
|
||||
num,
|
||||
companyId,
|
||||
unitCn: unitName,
|
||||
typeCn: deviceTypeList[z].pathLabels[2],
|
||||
guigeCn: deviceTypeList[z].pathLabels[3],
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.leaseApplyDetails.push(this.handelTableItemData(nodes[0]))
|
||||
this.deviceType = {}
|
||||
|
||||
this.leaseApplyDetails = [...new Set(tempList)]
|
||||
|
||||
// const templateList = deviceTypeList.map((e) => {
|
||||
// let { num, companyId, id, unitName } = e.data
|
||||
// return {
|
||||
// createBy: this.user.name,
|
||||
// num,
|
||||
// companyId,
|
||||
// typeId: id,
|
||||
// unitCn: unitName,
|
||||
// typeCn: e.pathLabels[2],
|
||||
// guigeCn: e.pathLabels[3],
|
||||
// }
|
||||
// })
|
||||
// this.leaseApplyDetails = [...new Set(templateList)]
|
||||
// console.log(templateList, '----')
|
||||
|
||||
// let nodes = null
|
||||
// nodes =
|
||||
// this.$refs.deviceTypeCascader.getCheckedNodes().length > 0
|
||||
// ? this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
// : [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]
|
||||
// if (nodes[0].level != 4) {
|
||||
// return
|
||||
// }
|
||||
// // console.log(this.leaseApplyDetails)
|
||||
// // console.log(nodes[0].data.id)
|
||||
// for (let i = 0; i < this.leaseApplyDetails.length; i++) {
|
||||
// if (this.leaseApplyDetails[i].typeId == nodes[0].data.id) {
|
||||
// this.leaseApplyDetails.splice(i, 1)
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// this.leaseApplyDetails.push(this.handelTableItemData(nodes[0]))
|
||||
// this.deviceType = {}
|
||||
},
|
||||
//// 将数据处理成 表格中需要的数据
|
||||
handelTableItemData(node) {
|
||||
|
|
@ -912,3 +1006,21 @@ export default {
|
|||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.popper-select {
|
||||
// li[aria-haspopup='true'] {
|
||||
// .el-checkbox {
|
||||
// display: none;
|
||||
// }
|
||||
// }
|
||||
|
||||
.el-cascader-panel .el-scrollbar .el-checkbox {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-cascader-panel .el-scrollbar:nth-child(4) .el-checkbox {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -57,14 +57,18 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="status">
|
||||
<el-cascader
|
||||
placeholder="规格型号"
|
||||
:key="propsKey"
|
||||
v-model="deviceType"
|
||||
:show-all-levels="false"
|
||||
:options="deviceTypeTree"
|
||||
:props="deviceTypeTreeProps"
|
||||
v-model="deviceType"
|
||||
@change="deviceTypeChange"
|
||||
ref="deviceTypeCascader"
|
||||
filterable
|
||||
collapse-tags
|
||||
style="width: 240px"
|
||||
placeholder="规格型号"
|
||||
ref="deviceTypeCascader"
|
||||
popper-class="popper-select"
|
||||
@change="deviceTypeChange"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="退料人" prop="backPerson">
|
||||
|
|
@ -159,18 +163,21 @@
|
|||
label="机具名称"
|
||||
prop="typeName"
|
||||
min-width="200"
|
||||
align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="规格型号"
|
||||
prop="typeCode"
|
||||
min-width="200"
|
||||
align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="计量单位"
|
||||
prop="unitNames"
|
||||
min-width="100"
|
||||
align="center"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
|
|
@ -286,6 +293,7 @@ export default {
|
|||
},
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
|
|
@ -445,9 +453,10 @@ export default {
|
|||
label: 'typeName',
|
||||
// multiple: false,
|
||||
value: 'typeId',
|
||||
multiple: true,
|
||||
},
|
||||
// 选中的设备类型
|
||||
deviceType: null,
|
||||
deviceType: [],
|
||||
|
||||
// 表单参数
|
||||
form: {},
|
||||
|
|
@ -481,8 +490,9 @@ export default {
|
|||
},
|
||||
companyId: '',
|
||||
createBy: '',
|
||||
isEdit: 'true',
|
||||
// isEdit: 'true',
|
||||
rowId: '',
|
||||
propsKey: 2000,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -539,9 +549,38 @@ export default {
|
|||
// this.agreementId
|
||||
}
|
||||
|
||||
const res = await getUseTypeTreee(params)
|
||||
console.log('resgetUseTypeTreee==========', res)
|
||||
this.deviceTypeTree = res.data
|
||||
getUseTypeTreee(params).then((res) => {
|
||||
this.deviceTypeTree = res.data
|
||||
|
||||
// console.log(this.deviceTypeTree, this.leaseApplyDetails, '6666')
|
||||
|
||||
let selectList = []
|
||||
this.leaseApplyDetails.forEach((e) => {
|
||||
selectList.push(
|
||||
this.getParentsById(this.deviceTypeTree, e.typeId),
|
||||
)
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.deviceType = selectList
|
||||
this.propsKey++
|
||||
})
|
||||
})
|
||||
},
|
||||
getParentsById(list, id) {
|
||||
for (let i in list) {
|
||||
if (list[i].typeId == id) {
|
||||
//查询到就返回该数组对象的value
|
||||
return [list[i].typeId]
|
||||
}
|
||||
if (list[i].children) {
|
||||
let node = this.getParentsById(list[i].children, id)
|
||||
if (node !== undefined) {
|
||||
//查询到把父节把父节点加到数组前面
|
||||
node.unshift(list[i].typeId)
|
||||
return node
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取 协议id
|
||||
async GetAgreementInfoById() {
|
||||
|
|
@ -587,7 +626,7 @@ export default {
|
|||
},
|
||||
//生成回显数据
|
||||
handelEchoData(item) {
|
||||
console.log('item======', item)
|
||||
// console.log('item======', item)
|
||||
const template = JSON.parse(
|
||||
JSON.stringify(this.leaseApplyDetailsItem),
|
||||
)
|
||||
|
|
@ -693,7 +732,7 @@ export default {
|
|||
},
|
||||
//是否可用勾选框
|
||||
selectable(row) {
|
||||
console.log(row)
|
||||
// console.log(row)
|
||||
if (row.num != 0) {
|
||||
return true
|
||||
} else {
|
||||
|
|
@ -844,6 +883,12 @@ export default {
|
|||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.deviceType.forEach((e, index) => {
|
||||
if (e[3] === row.typeId) {
|
||||
this.deviceType.splice(index, 1)
|
||||
this.propsKey++
|
||||
}
|
||||
})
|
||||
this.leaseApplyDetails.splice(row.index, 1)
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
|
|
@ -868,38 +913,75 @@ export default {
|
|||
|
||||
/////// 设备类型树 切换
|
||||
async deviceTypeChange(val) {
|
||||
let nodes = null
|
||||
console.log(
|
||||
'vall1211221122',
|
||||
this.$refs.deviceTypeCascader.getCheckedNodes().length,
|
||||
this.$refs.deviceTypeCascader.getCheckedNodes(),
|
||||
[this.$refs.deviceTypeCascader.panel.getNodeByValue(val)],
|
||||
)
|
||||
nodes =
|
||||
this.$refs.deviceTypeCascader.getCheckedNodes().length > 0
|
||||
? this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
: [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]
|
||||
console.log('nodes', nodes)
|
||||
// const res = await getUseNumByTypeId({ typeId: nodes[0].data.typeId })
|
||||
nodes[0].data.useNum = nodes[0].data.num
|
||||
if (nodes[0].level != 4) {
|
||||
return
|
||||
}
|
||||
if (nodes[0].data.useNum < 1) {
|
||||
this.$modal.msgError('所选机具类型当前无在用!')
|
||||
return
|
||||
}
|
||||
for (let i = 0; i < this.leaseApplyDetails.length; i++) {
|
||||
if (this.leaseApplyDetails[i].typeId == nodes[0].data.typeId) {
|
||||
this.leaseApplyDetails.splice(i, 1)
|
||||
break
|
||||
}
|
||||
}
|
||||
this.leaseApplyDetails.push(this.handelTableItemData(nodes[0]))
|
||||
// let nodes = null
|
||||
// console.log(
|
||||
// 'vall1211221122',
|
||||
// this.$refs.deviceTypeCascader.getCheckedNodes().length,
|
||||
// this.$refs.deviceTypeCascader.getCheckedNodes(),
|
||||
// [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)],
|
||||
// )
|
||||
// nodes =
|
||||
// this.$refs.deviceTypeCascader.getCheckedNodes().length > 0
|
||||
// ? this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
// : [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]
|
||||
// console.log('nodes', nodes)
|
||||
// // const res = await getUseNumByTypeId({ typeId: nodes[0].data.typeId })
|
||||
// nodes[0].data.useNum = nodes[0].data.num
|
||||
// if (nodes[0].level != 4) {
|
||||
// return
|
||||
// }
|
||||
// if (nodes[0].data.useNum < 1) {
|
||||
// this.$modal.msgError('所选机具类型当前无在用!')
|
||||
// return
|
||||
// }
|
||||
// for (let i = 0; i < this.leaseApplyDetails.length; i++) {
|
||||
// if (this.leaseApplyDetails[i].typeId == nodes[0].data.typeId) {
|
||||
// this.leaseApplyDetails.splice(i, 1)
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// this.leaseApplyDetails.push(this.handelTableItemData(nodes[0]))
|
||||
// this.$refs.cascader.$refs.panel.clearCheckedNodes()
|
||||
// // 设置为空可以让节点不高亮显示
|
||||
// this.$refs.cascader.$refs.panel.activePath = []
|
||||
this.deviceType = {}
|
||||
// this.deviceType = {}
|
||||
|
||||
const deviceTypeList =
|
||||
this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
|
||||
// if (val.length > 0) {
|
||||
// for (let i in val) {
|
||||
// console.log(val[i], '----+++')
|
||||
// }
|
||||
// }
|
||||
let tempList = []
|
||||
if (val.length > 0) {
|
||||
const items = val.map((e) => {
|
||||
return e[3]
|
||||
})
|
||||
for (let i in items) {
|
||||
for (let z in deviceTypeList) {
|
||||
if (deviceTypeList[z].data.typeId === items[i]) {
|
||||
let { num, companyId, typeId, unitNames } =
|
||||
deviceTypeList[z].data
|
||||
tempList.push({
|
||||
createBy: this.createBy,
|
||||
typeId,
|
||||
preNum: num,
|
||||
num,
|
||||
companyId,
|
||||
unitNames,
|
||||
useNum: num,
|
||||
typeName: deviceTypeList[z].pathLabels[2],
|
||||
typeCode: deviceTypeList[z].pathLabels[3],
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.leaseApplyDetails = [...new Set(tempList)]
|
||||
},
|
||||
//// 将数据处理成 表格中需要的数据
|
||||
handelTableItemData(node) {
|
||||
|
|
@ -921,3 +1003,15 @@ export default {
|
|||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.popper-select {
|
||||
.el-cascader-panel .el-scrollbar .el-checkbox {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-cascader-panel .el-scrollbar:nth-child(4) .el-checkbox {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -186,6 +186,12 @@
|
|||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="退料接收时间"
|
||||
align="center"
|
||||
prop="backReceiveTime"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="equipmentId">
|
||||
<treeselect
|
||||
<!-- <treeselect
|
||||
v-model="queryParams.equipmentId"
|
||||
default-expand-all
|
||||
:options="equipmentTypeList"
|
||||
|
|
@ -63,7 +63,21 @@
|
|||
noChildrenText="没有数据了"
|
||||
noOptionsText="没有数据"
|
||||
noResultsText="没有搜索结果"
|
||||
/>
|
||||
/> -->
|
||||
<el-cascader
|
||||
:key="propsKey"
|
||||
v-model="deviceType"
|
||||
:show-all-levels="false"
|
||||
:options="equipmentTypeList"
|
||||
:props="deviceTypeTreeProps"
|
||||
filterable
|
||||
collapse-tags
|
||||
style="width: 240px"
|
||||
placeholder="请选择规格型号"
|
||||
ref="deviceTypeCascader"
|
||||
popper-class="popper-select"
|
||||
@change="deviceTypeChange"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="采购日期" prop="purchaseTime">
|
||||
<el-date-picker
|
||||
|
|
@ -130,25 +144,29 @@
|
|||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="55" />
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="55"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="机具名称"
|
||||
prop="machineTypeName"
|
||||
:show-overflow-tooltip="true"
|
||||
width="200"
|
||||
show-overflow-tooltip
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="规格型号"
|
||||
prop="specificationType"
|
||||
:show-overflow-tooltip="true"
|
||||
width="200"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="单位" prop="unitName" width="100" />
|
||||
<el-table-column align="center" label="单位" prop="unitName" />
|
||||
<el-table-column
|
||||
label="购置单价(元)"
|
||||
prop="purchasePrice"
|
||||
align="center"
|
||||
width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
|
|
@ -160,9 +178,9 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="采购数量"
|
||||
prop="purchaseNum"
|
||||
width="150"
|
||||
type="number"
|
||||
maxlength="10"
|
||||
>
|
||||
|
|
@ -175,14 +193,18 @@
|
|||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机具厂家" prop="supplierId" width="200">
|
||||
<el-table-column
|
||||
label="机具厂家"
|
||||
prop="supplierId"
|
||||
align="center"
|
||||
width="200"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.supplierId"
|
||||
placeholder="机具厂家"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 180px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in supplierList"
|
||||
|
|
@ -202,15 +224,16 @@
|
|||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
v-model="scope.row.productionTime"
|
||||
style="width: 180px"
|
||||
style="width: 100%"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date"
|
||||
range-separator="-"
|
||||
placeholder="出厂日期"
|
||||
clearable
|
||||
></el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150">
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
|
||||
<el-button
|
||||
size="mini"
|
||||
|
|
@ -384,6 +407,15 @@ export default {
|
|||
// { required: true, message: "采购员不能为空", trigger: "blur" }
|
||||
// ]
|
||||
},
|
||||
deviceTypeTreeProps: {
|
||||
children: 'children',
|
||||
label: 'typeName',
|
||||
// multiple: false,
|
||||
value: 'typeId',
|
||||
multiple: true,
|
||||
},
|
||||
deviceType: [],
|
||||
propsKey: 1000,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -464,8 +496,17 @@ export default {
|
|||
})
|
||||
}
|
||||
})
|
||||
|
||||
let selectList = []
|
||||
this.equipmentList.forEach((e) => {
|
||||
selectList.push(
|
||||
this.getParentsById(this.equipmentTypeList, e.typeId),
|
||||
)
|
||||
})
|
||||
this.deviceType = selectList
|
||||
})
|
||||
},
|
||||
|
||||
//添加机具类型
|
||||
select(row) {
|
||||
console.log(row)
|
||||
|
|
@ -519,10 +560,28 @@ export default {
|
|||
this.maForm.remark = response.data.remark
|
||||
this.maForm.purchaseNumber = response.data.purchaseNumber
|
||||
this.equipmentList = response.data.checkDetailsList
|
||||
|
||||
// this.loading = false;
|
||||
})
|
||||
},
|
||||
|
||||
getParentsById(list, id) {
|
||||
for (let i in list) {
|
||||
if (list[i].typeId == id) {
|
||||
//查询到就返回该数组对象的value
|
||||
return [list[i].typeId]
|
||||
}
|
||||
if (list[i].children) {
|
||||
let node = this.getParentsById(list[i].children, id)
|
||||
if (node !== undefined) {
|
||||
//查询到把父节把父节点加到数组前面
|
||||
node.unshift(list[i].typeId)
|
||||
return node
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/** 查询右侧列表 */
|
||||
getList() {
|
||||
// this.loading = true;
|
||||
|
|
@ -676,10 +735,16 @@ export default {
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
console.log(row.id)
|
||||
// console.log(row.id)
|
||||
this.$modal
|
||||
.confirm('是否确认删除所选择的数据项?')
|
||||
.then(() => {
|
||||
this.deviceType.forEach((e, index) => {
|
||||
if (e[3] === row.typeId) {
|
||||
this.deviceType.splice(index, 1)
|
||||
this.propsKey++
|
||||
}
|
||||
})
|
||||
this.equipmentList.forEach((item, index) => {
|
||||
if (item.id == row.id) {
|
||||
this.equipmentList.splice(index, 1)
|
||||
|
|
@ -702,20 +767,73 @@ export default {
|
|||
// ...this.queryParams
|
||||
// }, `role_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
deviceTypeChange(val) {
|
||||
const deviceTypeList =
|
||||
this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
let tempList = []
|
||||
if (val.length > 0) {
|
||||
const items = val.map((e) => {
|
||||
return e[3]
|
||||
})
|
||||
for (let i in items) {
|
||||
for (let z in deviceTypeList) {
|
||||
if (deviceTypeList[z].data.typeId === items[i]) {
|
||||
this.$set(deviceTypeList[z].data, 'supplierId', '')
|
||||
this.$set(
|
||||
deviceTypeList[z].data,
|
||||
'createTime',
|
||||
null,
|
||||
)
|
||||
this.$set(
|
||||
deviceTypeList[z].data,
|
||||
'productionTime',
|
||||
'',
|
||||
)
|
||||
this.$set(
|
||||
deviceTypeList[z].data,
|
||||
'purchasePrice',
|
||||
0,
|
||||
)
|
||||
this.$set(deviceTypeList[z].data, 'purchaseNum', 1)
|
||||
|
||||
tempList.push(deviceTypeList[z].data)
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.equipmentList = [...new Set(tempList)]
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
//
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.el-table .fixed-width .el-button--mini {
|
||||
width: 60px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
// ::v-deep.el-table .fixed-width .el-button--mini {
|
||||
// width: 60px !important;
|
||||
// margin-bottom: 10px;
|
||||
// }
|
||||
|
||||
::v-deep input::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none !important;
|
||||
}
|
||||
// ::v-deep input::-webkit-inner-spin-button {
|
||||
// -webkit-appearance: none !important;
|
||||
// }
|
||||
|
||||
::v-deep input[type='number'] {
|
||||
-moz-appearance: textfield !important;
|
||||
// ::v-deep input[type='number'] {
|
||||
// -moz-appearance: textfield !important;
|
||||
// }
|
||||
//
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.popper-select {
|
||||
.el-cascader-panel .el-scrollbar .el-checkbox {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-cascader-panel .el-scrollbar:nth-child(4) .el-checkbox {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@
|
|||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
v-if="scope.row.purchasingId == 25"
|
||||
v-if="scope.row.purchasingId === 24"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['newPurchase:tools:del']"
|
||||
>删除</el-button
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@
|
|||
>
|
||||
<i class="el-icon-plus avatar-uploader-icon"></i>
|
||||
<div class="el-upload__tip" slot="tip"
|
||||
>请上传png、jpg、jpeg类型文件,文件个数不能超过
|
||||
{{ limit }} 个,且单个文件不能超过5M</div
|
||||
>请上传png、jpg、jpeg类型图片,图片总数不能超过
|
||||
{{ limit }} 个,且单张图片不能超过5M</div
|
||||
>
|
||||
</el-upload>
|
||||
</div>
|
||||
|
|
@ -55,7 +55,7 @@ export default {
|
|||
this.$emit('success', response, file)
|
||||
},
|
||||
handleExceed() {
|
||||
this.$message.error(`最多只能上传${this.limit}个文件!`)
|
||||
this.$message.error(`最多只能上传${this.limit}个图片!`)
|
||||
},
|
||||
beforeUpload(file) {
|
||||
const isJPGorPNG =
|
||||
|
|
@ -64,10 +64,10 @@ export default {
|
|||
file.type == 'image/jpeg'
|
||||
const isLt5M = file.size / 1024 / 1024 < 5 // 小于 5MB
|
||||
if (!isJPGorPNG) {
|
||||
this.$message.error('只能上传 jpg、jpeg、png 、 格式的文件!')
|
||||
this.$message.error('只能上传 jpg、jpeg、png 、 格式的图片!')
|
||||
}
|
||||
if (!isLt5M) {
|
||||
this.$message.error('上传图片大小不能超过 5MB')
|
||||
this.$message.error('上传的图片大小不能超过 5MB')
|
||||
}
|
||||
return isJPGorPNG && isLt5M
|
||||
},
|
||||
|
|
|
|||
|
|
@ -113,10 +113,10 @@
|
|||
<el-table-column
|
||||
label="入库人员"
|
||||
align="center"
|
||||
prop="updateBy"
|
||||
prop="inputUser"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
label="入库时间"
|
||||
align="center"
|
||||
prop="updateTime"
|
||||
|
|
@ -127,7 +127,7 @@
|
|||
align="center"
|
||||
prop="createTime"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
/> -->
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="center"
|
||||
|
|
@ -336,6 +336,12 @@
|
|||
<span v-if="scope.row.manageType == '1'">数量管理</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="入库时间"
|
||||
align="center"
|
||||
prop="inputTime"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<!-- <el-table-column label="不通过原因" align="center" prop="remark" show-overflow-tooltip /> -->
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
|
|
|
|||
Loading…
Reference in New Issue