bug修复
This commit is contained in:
parent
1e88ef8037
commit
9ef9b48ce9
|
|
@ -286,3 +286,12 @@ export function getDeviceFactoryCbx(data) {
|
|||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 类型-tree
|
||||
export function getDeviceTypeTree(data) {
|
||||
return request({
|
||||
url: "/material/select/getDeviceTypeTree",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
|
@ -48,8 +48,7 @@
|
|||
>新建</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- :disabled="single" -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
|
|
@ -58,7 +57,7 @@
|
|||
@click="handlePeople"
|
||||
>人员配置</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@
|
|||
<el-form-item label="附件" prop="bmFileInfos">
|
||||
<el-upload
|
||||
:action="uploadUrl"
|
||||
:headers="uploadHeaders"
|
||||
:data="{ fileType: 'sx' }"
|
||||
:file-list="maForm.bmFileInfos"
|
||||
:show-file-list="true"
|
||||
:auto-upload="true"
|
||||
|
|
@ -79,6 +81,7 @@
|
|||
:class="{ disabledFbs: uploadDisabled }"
|
||||
:on-preview="picturePreviewFbs"
|
||||
:on-remove="handleRemoveElectricianImgList"
|
||||
:on-success="handleFileSuccess"
|
||||
>
|
||||
<!-- 文件格式下载,图片格式预览 -->
|
||||
<div slot="file" slot-scope="{ file }">
|
||||
|
|
@ -379,7 +382,9 @@ export default {
|
|||
dialogImageUrl: '',
|
||||
dialogVisible: false,
|
||||
uploadKey: Date.now(),
|
||||
// uploadHeaders: {Authorization: 'Bearer ' + localStorage.getItem('token')},
|
||||
uploadHeaders: {
|
||||
Authorization: 'Bearer ' + localStorage.getItem('token'),
|
||||
},
|
||||
//上传
|
||||
// upload: {
|
||||
// // 设置上传的请求头部
|
||||
|
|
@ -387,7 +392,8 @@ export default {
|
|||
// // 上传的地址
|
||||
// url: process.env.VUE_APP_BASE_API + '/file/upload'
|
||||
// },
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + '/system/user/imgUpLoad', // 上传的图片服务器地址
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + '/system/sys/file/upload', // 上传的图片服务器地址
|
||||
uploadUrlList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -554,6 +560,11 @@ export default {
|
|||
// this.loading = true;
|
||||
await getScrapInfo({ taskId: this.taskId }).then(async (response) => {
|
||||
this.maForm.bmFileInfos = response.data.fileList
|
||||
if (this.maForm.bmFileInfos.length > 0) {
|
||||
this.maForm.bmFileInfos.forEach((item) => {
|
||||
item.url = process.env.VUE_APP_BASE_API + '/system' + item.url
|
||||
})
|
||||
}
|
||||
|
||||
this.equipmentList = response.data.scrapApplyDetailsList.map((item) => {
|
||||
let newMaCodeList = []
|
||||
|
|
@ -620,6 +631,20 @@ export default {
|
|||
.confirm('是否确认保存当前页面')
|
||||
.then(function () {})
|
||||
.then(() => {
|
||||
this.uploadUrlList = []
|
||||
this.maForm.bmFileInfos.forEach((item) => {
|
||||
if (item.response) {
|
||||
this.uploadUrlList.push({
|
||||
url: item.response.data.fileUrl,
|
||||
name: item.response.data.fileName,
|
||||
})
|
||||
} else {
|
||||
this.uploadUrlList.push({
|
||||
url: item.url,
|
||||
name: item.name,
|
||||
})
|
||||
}
|
||||
})
|
||||
if (this.isEdit) {
|
||||
console.log('编辑')
|
||||
this.loading = true
|
||||
|
|
@ -648,7 +673,7 @@ export default {
|
|||
}
|
||||
})
|
||||
let list = {
|
||||
fileList: this.maForm.bmFileInfos,
|
||||
fileList: this.uploadUrlList,
|
||||
scrapApplyDetailsList: dataList,
|
||||
taskId: this.taskId,
|
||||
}
|
||||
|
|
@ -692,7 +717,7 @@ export default {
|
|||
}
|
||||
})
|
||||
let list = {
|
||||
fileList: this.maForm.bmFileInfos,
|
||||
fileList: this.uploadUrlList,
|
||||
scrapApplyDetailsList: dataList,
|
||||
}
|
||||
console.log('ccccccccccccccccccc', list)
|
||||
|
|
@ -767,63 +792,19 @@ export default {
|
|||
this.rowData.fileType = row.fileType
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
if (response.code == 200) {
|
||||
if (this.taskId == '') {
|
||||
//新增逻辑
|
||||
// console.log(response)
|
||||
// console.log(this.rowData)
|
||||
// console.log(this.rowData.bmFileInfos)
|
||||
let obj = {
|
||||
taskId: this.taskId,
|
||||
taskType: '0',
|
||||
name: response.data.name,
|
||||
url: response.data.url,
|
||||
modelId: this.rowData.typeId,
|
||||
fileType: this.rowData.fileType,
|
||||
// "dictLabel": this.rowData.dictLabel,
|
||||
}
|
||||
//根据文件上传返回更新文件管理弹窗内容
|
||||
let index = this.fileDataList.findIndex(
|
||||
(v) => v.fileType == this.rowData.fileType,
|
||||
)
|
||||
this.fileDataList[index].name = response.data.name
|
||||
this.fileDataList[index].url = response.data.url
|
||||
//判断当前上传的文件是否已上传过-再往机具类型数据中插入
|
||||
if (this.rowData.bmFileInfos.length > 0) {
|
||||
let index2 = this.rowData.bmFileInfos.findIndex(
|
||||
(v) => v.fileType == this.rowData.fileType,
|
||||
)
|
||||
if (index2 > -1) {
|
||||
//相同类型文件重复上传-替换
|
||||
this.rowData.bmFileInfos.splice(index2, 0, obj)
|
||||
} else {
|
||||
//不存在相同类型文件-添加
|
||||
this.rowData.bmFileInfos.push(obj)
|
||||
}
|
||||
} else {
|
||||
this.rowData.bmFileInfos.push(obj)
|
||||
}
|
||||
} else {
|
||||
//编辑逻辑
|
||||
let param = {
|
||||
taskId: this.taskId,
|
||||
taskType: '0',
|
||||
name: response.data.name,
|
||||
url: response.data.url,
|
||||
modelId: this.rowData.typeId,
|
||||
fileType: this.rowData.fileType,
|
||||
// "dictLabel": this.rowData.dictLabel,
|
||||
}
|
||||
uploadPurchaseFile(param)
|
||||
.then((response) => {
|
||||
this.$modal.msgSuccess('上传成功')
|
||||
this.getFileData()
|
||||
})
|
||||
.catch(() => {
|
||||
this.$modal.msgError('上传失败')
|
||||
})
|
||||
}
|
||||
handleFileSuccess(res, file, fileList) {
|
||||
if (res.code == 200) {
|
||||
// this.maForm.bmFileInfos.push({
|
||||
// name: res.data.fileName,
|
||||
// url: res.data.fileUrl,
|
||||
// fileName: res.data.fileName,
|
||||
// // fileUrl: process.env.VUE_APP_BASE_API + '/system' + res.data.fileUrl,
|
||||
// fileUrl: file.url,
|
||||
// })
|
||||
console.log(
|
||||
'🚀 ~ handleFileSuccess ~ this.maForm.bmFileInfos:',
|
||||
this.maForm.bmFileInfos,
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -652,6 +652,8 @@ export default {
|
|||
this.tableList = res.data.rows
|
||||
this.total = res.data.total
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
|
|
@ -662,6 +664,8 @@ export default {
|
|||
this.dialogTotal = response.data.total
|
||||
this.loading = false
|
||||
this.ids = response.data.rows.map((item) => item)
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -666,6 +666,8 @@ export default {
|
|||
this.detailTableList = response.data.rows
|
||||
this.dialogTotal = response.data.total
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -826,9 +826,13 @@ export default {
|
|||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// this.download('system/dict/type/export', {
|
||||
// ...this.queryParams
|
||||
// }, `type_${new Date().getTime()}.xlsx`)
|
||||
this.download(
|
||||
'base/machine/export',
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`调试编码设备_${new Date().getTime()}.xlsx`,
|
||||
)
|
||||
},
|
||||
|
||||
// iot设备绑定
|
||||
|
|
|
|||
|
|
@ -826,9 +826,13 @@ export default {
|
|||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// this.download('system/dict/type/export', {
|
||||
// ...this.queryParams
|
||||
// }, `type_${new Date().getTime()}.xlsx`)
|
||||
this.download(
|
||||
'base/machine/export',
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`机具编码设备_${new Date().getTime()}.xlsx`,
|
||||
)
|
||||
},
|
||||
|
||||
// iot设备绑定
|
||||
|
|
|
|||
|
|
@ -42,28 +42,40 @@
|
|||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="类型名称" prop="typeName">
|
||||
<el-form-item label="类型/规格" prop="id">
|
||||
<treeselect
|
||||
v-model="queryParams.id"
|
||||
:options="typeTreeOptions"
|
||||
noChildrenText="没有数据了"
|
||||
noOptionsText="没有数据"
|
||||
noResultsText="没有搜索结果"
|
||||
placeholder="请选择所属上级"
|
||||
@select="handleTypeTree"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否绑定库管员" prop="isBind">
|
||||
<el-select
|
||||
v-model="queryParams.isBind"
|
||||
placeholder="请选择是否绑定库管员"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option label="是" :value="1"></el-option>
|
||||
<el-option label="否" :value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="库管员搜索" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.typeName"
|
||||
placeholder="请输入类型名称"
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入库管员"
|
||||
clearable
|
||||
maxlength="50"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="modelName">
|
||||
<el-input
|
||||
v-model="queryParams.modelName"
|
||||
placeholder="请输入规格型号"
|
||||
clearable
|
||||
maxlength="50"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
|
|
@ -257,6 +269,7 @@ import {
|
|||
getMaUserList,
|
||||
addHouseKeeper,
|
||||
delHouseKeeper,
|
||||
getDeviceTypeTree,
|
||||
} from '@/api/store/tools'
|
||||
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
|
@ -300,6 +313,8 @@ export default {
|
|||
postOptions: [],
|
||||
// 角色选项
|
||||
roleOptions: [],
|
||||
// 类型树
|
||||
typeTreeOptions: [],
|
||||
// 表单参数
|
||||
form: {},
|
||||
//选中库管员Id
|
||||
|
|
@ -333,6 +348,7 @@ export default {
|
|||
deptId: undefined,
|
||||
modelName: undefined,
|
||||
typeName: undefined,
|
||||
id: undefined,
|
||||
},
|
||||
// 列信息
|
||||
columns: [
|
||||
|
|
@ -412,8 +428,11 @@ export default {
|
|||
this.loading = true
|
||||
console.log(this.queryParams)
|
||||
warehouseKeeperInfoAll(this.queryParams).then((response) => {
|
||||
this.equipmentList = response.rows
|
||||
this.total = response.total
|
||||
this.equipmentList = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading = false
|
||||
}).catch((error) => {
|
||||
console.log('🚀 ~ warehouseKeeperInfoAll ~ error:', error)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
|
@ -422,6 +441,28 @@ export default {
|
|||
getMaUserList({ userName: this.userName }).then((response) => {
|
||||
this.treeOptions = this.handleTree(response.data, 'userId')
|
||||
})
|
||||
getDeviceTypeTree({ level: 4 })
|
||||
.then((res) => {
|
||||
console.log('🚀 ~ getDeviceTypeTree ~ res:', res)
|
||||
this.typeTreeOptions = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('🚀 ~ getDeviceTypeTree ~ err:', err)
|
||||
})
|
||||
},
|
||||
handleTypeTree(val) {
|
||||
console.log('🚀 ~ handleTypeTree ~ val:', val)
|
||||
console.log('🚀 ~ handleTypeTree ~ val:', this.queryParams)
|
||||
if (val.level == '3') {
|
||||
this.queryParams.typeName = val.label
|
||||
this.queryParams.modelName = ''
|
||||
} else if (val.level == '4') {
|
||||
this.queryParams.typeName = ''
|
||||
this.queryParams.modelName = val.label
|
||||
} else {
|
||||
this.queryParams.typeName = ''
|
||||
this.queryParams.modelName = ''
|
||||
}
|
||||
},
|
||||
// 筛选节点
|
||||
filterNode(value, data) {
|
||||
|
|
@ -482,6 +523,9 @@ export default {
|
|||
this.dateRange = []
|
||||
this.resetForm('queryForm')
|
||||
this.queryParams.deptId = undefined
|
||||
this.queryParams.id = undefined
|
||||
this.queryParams.typeName = ''
|
||||
this.queryParams.modelName = ''
|
||||
this.$refs.tree.setCurrentKey(null)
|
||||
this.handleQuery()
|
||||
},
|
||||
|
|
@ -579,9 +623,13 @@ export default {
|
|||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// this.download('system/user/export', {
|
||||
// ...this.queryParams
|
||||
// }, `user_${new Date().getTime()}.xlsx`)
|
||||
this.download(
|
||||
'base/maWarehouseKeeper/export',
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`库管员配置_${new Date().getTime()}.xlsx`,
|
||||
)
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@
|
|||
<el-input
|
||||
v-model="form.paName"
|
||||
placeholder="请输入名称"
|
||||
maxlength="50"
|
||||
maxlength="30"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -184,7 +184,7 @@
|
|||
<el-input
|
||||
v-model="form.unitId"
|
||||
placeholder="请输入计量单位"
|
||||
maxlength="50"
|
||||
maxlength="30"
|
||||
/>
|
||||
<!-- <el-input-number v-model="form.unitId" controls-position="right" :min="0" /> -->
|
||||
</el-form-item>
|
||||
|
|
|
|||
|
|
@ -578,9 +578,13 @@ export default {
|
|||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// this.download('system/user/export', {
|
||||
// ...this.queryParams
|
||||
// }, `user_${new Date().getTime()}.xlsx`)
|
||||
this.download(
|
||||
'base/maintenanceGang/export ',
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`维修员配置_${new Date().getTime()}.xlsx`,
|
||||
)
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
|
|
|
|||
|
|
@ -687,6 +687,8 @@ export default {
|
|||
this.tableList = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
|
|
@ -697,6 +699,8 @@ export default {
|
|||
this.dialogTotal = response.data.total
|
||||
this.loading = false
|
||||
this.ids = response.data.rows.map((item) => item)
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -661,6 +661,8 @@ export default {
|
|||
this.tableList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
|
|
@ -670,6 +672,8 @@ export default {
|
|||
this.detailTableList = response.data.rows
|
||||
this.dialogTotal = response.data.total
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue