This commit is contained in:
parent
12a65812af
commit
ba942dfd8f
|
|
@ -86,6 +86,14 @@ export function updateMaType(data) {
|
|||
data: data,
|
||||
})
|
||||
}
|
||||
// 配件类型管理--一级修改
|
||||
export function updatePartType(data) {
|
||||
return request({
|
||||
url: '/material/wh_house_info',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 物资类型管理--新增
|
||||
export function addMaType(data) {
|
||||
|
|
|
|||
|
|
@ -586,3 +586,39 @@ export function getDetailsByTypeId(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 根据用户名查询用户信息
|
||||
export function getUserInfoByUserNameApi(data) {
|
||||
return request({
|
||||
url: '/material/app/iwsTeamUser/selectUserInfoByUserName',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 根据身份证号查询用户信息
|
||||
export function getUserInfoByIdCardApi(data) {
|
||||
return request({
|
||||
url: '/material/app/iwsTeamUser/selectProjectTeamInfoByIdCard',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新班组工程信息
|
||||
export function updateTeamProjectApi(data) {
|
||||
return request({
|
||||
url: '/material/app/iwsTeamUser/updateTeamProject',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取工程ids
|
||||
export function getProjectInfoApi(data) {
|
||||
return request({
|
||||
url: '/material/select/getProjectInfo',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
@ -130,8 +130,9 @@ const user = {
|
|||
commit('SET_AVATAR', avatar)
|
||||
|
||||
// 存取用户的userId
|
||||
sessionStorage.setItem('userId', res.user.userId)
|
||||
sessionStorage.setItem('userId', res.user?.userId)
|
||||
sessionStorage.setItem('deptName', res.user?.dept?.deptName)
|
||||
sessionStorage.setItem('userName', res.user?.userName)
|
||||
return res
|
||||
})
|
||||
.catch(error => Promise.reject(error))
|
||||
|
|
|
|||
|
|
@ -143,6 +143,12 @@ import {
|
|||
getBarAndLineDataApi
|
||||
} from '@/api/home/equipment-supply.js'
|
||||
import { getListProject, getListUnite } from '@/api/lease/apply'
|
||||
import {
|
||||
getProjectInfoApi,
|
||||
getUserInfoByUserNameApi,
|
||||
getUserInfoByIdCardApi,
|
||||
updateTeamProjectApi
|
||||
} from '@/api/materialsStation'
|
||||
export default {
|
||||
components: {
|
||||
CardModel,
|
||||
|
|
@ -285,7 +291,9 @@ export default {
|
|||
barY1: [],
|
||||
lineY1: [],
|
||||
barY2: [],
|
||||
lineY2: []
|
||||
lineY2: [],
|
||||
idCard: '',
|
||||
projectIds: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -449,13 +457,62 @@ export default {
|
|||
}
|
||||
|
||||
return [formatDate(lastMonth), formatDate(today)]
|
||||
}
|
||||
},
|
||||
// start
|
||||
// 获取用户信息
|
||||
async getUserInfoByUserName() {
|
||||
try {
|
||||
const userName = sessionStorage.getItem('userName')
|
||||
console.log('🚀 ~ getUserInfoByUserName ~ userName:', userName)
|
||||
const res = await getUserInfoByUserNameApi({ userName })
|
||||
this.idCard = res?.data?.idCard
|
||||
sessionStorage.setItem('idCard', res?.data?.idCard)
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ getUserInfoByUserName ~ error:', error)
|
||||
}
|
||||
},
|
||||
async projectInfoList() {
|
||||
try {
|
||||
const res = await getProjectInfoApi({ unitId: null, isApp: true })
|
||||
console.log('🚀 ~ projectInfoList ~ res:', res)
|
||||
if (res.data && res.data.length > 0) {
|
||||
this.projectIds = res.data.map(item => item.proId)
|
||||
} else {
|
||||
this.projectIds = []
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ projectInfoList ~ error:', error)
|
||||
}
|
||||
},
|
||||
async getUserInfoByIdCard() {
|
||||
const params = {
|
||||
idCard: this.idCard,
|
||||
projectIds: this.projectIds
|
||||
}
|
||||
console.log('🚀 ~ getUserInfoByIdCard ~ params:', params)
|
||||
try {
|
||||
const res = await getUserInfoByIdCardApi(params)
|
||||
console.log('🚀 ~ getUserInfoByIdCard ~ res:', res)
|
||||
if (res.code === 200 && res.data && res.data.length > 0) {
|
||||
const params = {
|
||||
teamList: res.data
|
||||
}
|
||||
const res2 = await updateTeamProjectApi(params)
|
||||
console.log('🚀 ~ getUserInfoByIdCard ~ res2:', res2)
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ getUserInfoByIdCard ~ error:', error)
|
||||
}
|
||||
},
|
||||
// end
|
||||
},
|
||||
created() {
|
||||
async created() {
|
||||
this.queryDate = this.getDefaultDateRange()
|
||||
this.getCompanyAndProjectFun()
|
||||
this.getCardListFun()
|
||||
this.getPie_1DataFun()
|
||||
await Promise.all([this.getUserInfoByUserName(), this.projectInfoList()])
|
||||
this.getUserInfoByIdCard()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
style="color: #f56c6c"
|
||||
v-if="data.id !== 0"
|
||||
v-if="data.id !== 0 && data.level !== 0"
|
||||
@click.stop="() => removeTreeNode(data)"
|
||||
>
|
||||
</el-button>
|
||||
|
|
@ -715,7 +715,8 @@ import {
|
|||
delMaType,
|
||||
addMaType,
|
||||
updateMaType,
|
||||
getUserTypeList
|
||||
getUserTypeList,
|
||||
updatePartType
|
||||
} from "@/api/ma/base";
|
||||
import { getKeeperIds} from "@/api/ma/typeConfigKeeper";
|
||||
import { getRepairIds } from "@/api/ma/typeConfigRepair";
|
||||
|
|
@ -1350,7 +1351,12 @@ export default {
|
|||
this.getTreeData();
|
||||
}
|
||||
} else {
|
||||
const res = await updateMaType(editParams);
|
||||
let res = null
|
||||
if (this.levelTemp == 0) {
|
||||
res = await updatePartType(editParams);
|
||||
} else {
|
||||
res = await updateMaType(editParams);
|
||||
}
|
||||
if (res.code === 200) {
|
||||
this.$message.success("修改成功!");
|
||||
this.addTitleVisible = false;
|
||||
|
|
|
|||
|
|
@ -128,7 +128,6 @@
|
|||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:on-remove="handleFileRemove"
|
||||
:before-upload="beforeUpload"
|
||||
accept=".pdf"
|
||||
:disabled="isEditMode"
|
||||
>
|
||||
|
|
@ -402,8 +401,8 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.supplierInfoList()
|
||||
this.equipmentType()
|
||||
// this.supplierInfoList()
|
||||
// this.equipmentType()
|
||||
},
|
||||
watch: {
|
||||
// 监听弹框显示状态
|
||||
|
|
|
|||
Loading…
Reference in New Issue