bug修复

This commit is contained in:
bb_pan 2025-04-08 16:50:35 +08:00
parent 1e88ef8037
commit 9ef9b48ce9
12 changed files with 157 additions and 94 deletions

View File

@ -286,3 +286,12 @@ export function getDeviceFactoryCbx(data) {
data: data, data: data,
}); });
} }
// 类型-tree
export function getDeviceTypeTree(data) {
return request({
url: "/material/select/getDeviceTypeTree",
method: "post",
data,
});
}

View File

@ -48,8 +48,7 @@
>新建</el-button >新建</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<!-- :disabled="single" -->
<el-button <el-button
type="success" type="success"
plain plain
@ -58,7 +57,7 @@
@click="handlePeople" @click="handlePeople"
>人员配置</el-button >人员配置</el-button
> >
</el-col> </el-col> -->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"

View File

@ -68,6 +68,8 @@
<el-form-item label="附件" prop="bmFileInfos"> <el-form-item label="附件" prop="bmFileInfos">
<el-upload <el-upload
:action="uploadUrl" :action="uploadUrl"
:headers="uploadHeaders"
:data="{ fileType: 'sx' }"
:file-list="maForm.bmFileInfos" :file-list="maForm.bmFileInfos"
:show-file-list="true" :show-file-list="true"
:auto-upload="true" :auto-upload="true"
@ -79,6 +81,7 @@
:class="{ disabledFbs: uploadDisabled }" :class="{ disabledFbs: uploadDisabled }"
:on-preview="picturePreviewFbs" :on-preview="picturePreviewFbs"
:on-remove="handleRemoveElectricianImgList" :on-remove="handleRemoveElectricianImgList"
:on-success="handleFileSuccess"
> >
<!-- 文件格式下载图片格式预览 --> <!-- 文件格式下载图片格式预览 -->
<div slot="file" slot-scope="{ file }"> <div slot="file" slot-scope="{ file }">
@ -379,7 +382,9 @@ export default {
dialogImageUrl: '', dialogImageUrl: '',
dialogVisible: false, dialogVisible: false,
uploadKey: Date.now(), uploadKey: Date.now(),
// uploadHeaders: {Authorization: 'Bearer ' + localStorage.getItem('token')}, uploadHeaders: {
Authorization: 'Bearer ' + localStorage.getItem('token'),
},
// //
// upload: { // upload: {
// // // //
@ -387,7 +392,8 @@ export default {
// // // //
// url: process.env.VUE_APP_BASE_API + '/file/upload' // 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: { computed: {
@ -554,6 +560,11 @@ export default {
// this.loading = true; // this.loading = true;
await getScrapInfo({ taskId: this.taskId }).then(async (response) => { await getScrapInfo({ taskId: this.taskId }).then(async (response) => {
this.maForm.bmFileInfos = response.data.fileList 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) => { this.equipmentList = response.data.scrapApplyDetailsList.map((item) => {
let newMaCodeList = [] let newMaCodeList = []
@ -620,6 +631,20 @@ export default {
.confirm('是否确认保存当前页面') .confirm('是否确认保存当前页面')
.then(function () {}) .then(function () {})
.then(() => { .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) { if (this.isEdit) {
console.log('编辑') console.log('编辑')
this.loading = true this.loading = true
@ -648,7 +673,7 @@ export default {
} }
}) })
let list = { let list = {
fileList: this.maForm.bmFileInfos, fileList: this.uploadUrlList,
scrapApplyDetailsList: dataList, scrapApplyDetailsList: dataList,
taskId: this.taskId, taskId: this.taskId,
} }
@ -692,7 +717,7 @@ export default {
} }
}) })
let list = { let list = {
fileList: this.maForm.bmFileInfos, fileList: this.uploadUrlList,
scrapApplyDetailsList: dataList, scrapApplyDetailsList: dataList,
} }
console.log('ccccccccccccccccccc', list) console.log('ccccccccccccccccccc', list)
@ -767,63 +792,19 @@ export default {
this.rowData.fileType = row.fileType this.rowData.fileType = row.fileType
}, },
// //
handleFileSuccess(response, file, fileList) { handleFileSuccess(res, file, fileList) {
if (response.code == 200) { if (res.code == 200) {
if (this.taskId == '') { // this.maForm.bmFileInfos.push({
// // name: res.data.fileName,
// console.log(response) // url: res.data.fileUrl,
// console.log(this.rowData) // fileName: res.data.fileName,
// console.log(this.rowData.bmFileInfos) // // fileUrl: process.env.VUE_APP_BASE_API + '/system' + res.data.fileUrl,
let obj = { // fileUrl: file.url,
taskId: this.taskId, // })
taskType: '0', console.log(
name: response.data.name, '🚀 ~ handleFileSuccess ~ this.maForm.bmFileInfos:',
url: response.data.url, this.maForm.bmFileInfos,
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('上传失败')
})
}
} }
}, },

View File

@ -652,6 +652,8 @@ export default {
this.tableList = res.data.rows this.tableList = res.data.rows
this.total = res.data.total this.total = res.data.total
this.loading = false this.loading = false
}).catch(() => {
this.loading = false
}) })
}, },
@ -662,6 +664,8 @@ export default {
this.dialogTotal = response.data.total this.dialogTotal = response.data.total
this.loading = false this.loading = false
this.ids = response.data.rows.map((item) => item) this.ids = response.data.rows.map((item) => item)
}).catch(() => {
this.loading = false
}) })
}, },

View File

@ -666,6 +666,8 @@ export default {
this.detailTableList = response.data.rows this.detailTableList = response.data.rows
this.dialogTotal = response.data.total this.dialogTotal = response.data.total
this.loading = false this.loading = false
}).catch(() => {
this.loading = false
}) })
}, },

View File

@ -826,9 +826,13 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// this.download('system/dict/type/export', { this.download(
// ...this.queryParams 'base/machine/export',
// }, `type_${new Date().getTime()}.xlsx`) {
...this.queryParams,
},
`调试编码设备_${new Date().getTime()}.xlsx`,
)
}, },
// iot // iot

View File

@ -826,9 +826,13 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// this.download('system/dict/type/export', { this.download(
// ...this.queryParams 'base/machine/export',
// }, `type_${new Date().getTime()}.xlsx`) {
...this.queryParams,
},
`机具编码设备_${new Date().getTime()}.xlsx`,
)
}, },
// iot // iot

View File

@ -42,28 +42,40 @@
size="small" size="small"
:inline="true" :inline="true"
v-show="showSearch" 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 <el-input
v-model="queryParams.typeName" v-model="queryParams.userName"
placeholder="请输入类型名称" placeholder="请输入库管员"
clearable clearable
maxlength="50" maxlength="50"
style="width: 240px" style="width: 240px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </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-form-item>
<el-button <el-button
type="primary" type="primary"
@ -257,6 +269,7 @@ import {
getMaUserList, getMaUserList,
addHouseKeeper, addHouseKeeper,
delHouseKeeper, delHouseKeeper,
getDeviceTypeTree,
} from '@/api/store/tools' } from '@/api/store/tools'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
@ -300,6 +313,8 @@ export default {
postOptions: [], postOptions: [],
// //
roleOptions: [], roleOptions: [],
//
typeTreeOptions: [],
// //
form: {}, form: {},
//Id //Id
@ -333,6 +348,7 @@ export default {
deptId: undefined, deptId: undefined,
modelName: undefined, modelName: undefined,
typeName: undefined, typeName: undefined,
id: undefined,
}, },
// //
columns: [ columns: [
@ -412,8 +428,11 @@ export default {
this.loading = true this.loading = true
console.log(this.queryParams) console.log(this.queryParams)
warehouseKeeperInfoAll(this.queryParams).then((response) => { warehouseKeeperInfoAll(this.queryParams).then((response) => {
this.equipmentList = response.rows this.equipmentList = response.data.rows
this.total = response.total this.total = response.data.total
this.loading = false
}).catch((error) => {
console.log('🚀 ~ warehouseKeeperInfoAll ~ error:', error)
this.loading = false this.loading = false
}) })
}, },
@ -422,6 +441,28 @@ export default {
getMaUserList({ userName: this.userName }).then((response) => { getMaUserList({ userName: this.userName }).then((response) => {
this.treeOptions = this.handleTree(response.data, 'userId') 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) { filterNode(value, data) {
@ -482,6 +523,9 @@ export default {
this.dateRange = [] this.dateRange = []
this.resetForm('queryForm') this.resetForm('queryForm')
this.queryParams.deptId = undefined this.queryParams.deptId = undefined
this.queryParams.id = undefined
this.queryParams.typeName = ''
this.queryParams.modelName = ''
this.$refs.tree.setCurrentKey(null) this.$refs.tree.setCurrentKey(null)
this.handleQuery() this.handleQuery()
}, },
@ -579,9 +623,13 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// this.download('system/user/export', { this.download(
// ...this.queryParams 'base/maWarehouseKeeper/export',
// }, `user_${new Date().getTime()}.xlsx`) {
...this.queryParams,
},
`库管员配置_${new Date().getTime()}.xlsx`,
)
}, },
/** 导入按钮操作 */ /** 导入按钮操作 */
handleImport() { handleImport() {

View File

@ -175,7 +175,7 @@
<el-input <el-input
v-model="form.paName" v-model="form.paName"
placeholder="请输入名称" placeholder="请输入名称"
maxlength="50" maxlength="30"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -184,7 +184,7 @@
<el-input <el-input
v-model="form.unitId" v-model="form.unitId"
placeholder="请输入计量单位" placeholder="请输入计量单位"
maxlength="50" maxlength="30"
/> />
<!-- <el-input-number v-model="form.unitId" controls-position="right" :min="0" /> --> <!-- <el-input-number v-model="form.unitId" controls-position="right" :min="0" /> -->
</el-form-item> </el-form-item>

View File

@ -578,9 +578,13 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// this.download('system/user/export', { this.download(
// ...this.queryParams 'base/maintenanceGang/export ',
// }, `user_${new Date().getTime()}.xlsx`) {
...this.queryParams,
},
`维修员配置_${new Date().getTime()}.xlsx`,
)
}, },
/** 导入按钮操作 */ /** 导入按钮操作 */
handleImport() { handleImport() {

View File

@ -687,6 +687,8 @@ export default {
this.tableList = response.data.rows this.tableList = response.data.rows
this.total = response.data.total this.total = response.data.total
this.loading = false this.loading = false
}).catch(() => {
this.loading = false
}) })
}, },
@ -697,6 +699,8 @@ export default {
this.dialogTotal = response.data.total this.dialogTotal = response.data.total
this.loading = false this.loading = false
this.ids = response.data.rows.map((item) => item) this.ids = response.data.rows.map((item) => item)
}).catch(() => {
this.loading = false
}) })
}, },

View File

@ -661,6 +661,8 @@ export default {
this.tableList = response.rows this.tableList = response.rows
this.total = response.total this.total = response.total
this.loading = false this.loading = false
}).catch(() => {
this.loading = false
}) })
}, },
@ -670,6 +672,8 @@ export default {
this.detailTableList = response.data.rows this.detailTableList = response.data.rows
this.dialogTotal = response.data.total this.dialogTotal = response.data.total
this.loading = false this.loading = false
}).catch(() => {
this.loading = false
}) })
}, },