安全工器具的协议包含机具,不能发布
This commit is contained in:
parent
49d22604e1
commit
c4a1747dc3
|
|
@ -239,6 +239,7 @@ import {
|
||||||
getApplyInfo,getTypeOptions,applySubmit
|
getApplyInfo,getTypeOptions,applySubmit
|
||||||
} from "@/api/leasePublish/index";
|
} from "@/api/leasePublish/index";
|
||||||
import { getUnitListLeaseApi, getListLeasePersonApi,getPendingOutNumByTypeId } from '@/api/lease/apply'
|
import { getUnitListLeaseApi, getListLeasePersonApi,getPendingOutNumByTypeId } from '@/api/lease/apply'
|
||||||
|
import { getAgreement,} from "@/api/lease/apply";
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from "@/utils/auth";
|
||||||
import Treeselect from '@riophae/vue-treeselect'
|
import Treeselect from '@riophae/vue-treeselect'
|
||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
|
|
@ -319,6 +320,8 @@ export default {
|
||||||
|
|
||||||
items: [],
|
items: [],
|
||||||
|
|
||||||
|
isSafeType: 0,
|
||||||
|
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
unitId: [
|
unitId: [
|
||||||
|
|
@ -361,6 +364,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
uniteChange(e) {
|
uniteChange(e) {
|
||||||
this.getLeasePersonList(e.id)
|
this.getLeasePersonList(e.id)
|
||||||
|
this.getAgreementId(e.id)
|
||||||
},
|
},
|
||||||
// 获取领料人列表
|
// 获取领料人列表
|
||||||
async getLeasePersonList(teamId) {
|
async getLeasePersonList(teamId) {
|
||||||
|
|
@ -372,6 +376,16 @@ export default {
|
||||||
console.log('🚀 ~ 获取领料人列表失败 ~ error:', error)
|
console.log('🚀 ~ 获取领料人列表失败 ~ error:', error)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//获取协议
|
||||||
|
async getAgreementId(teamId) {
|
||||||
|
await getAgreement({
|
||||||
|
unitId: teamId,
|
||||||
|
projectId: this.leaseApplyData.leaseProjectId,
|
||||||
|
}).then((response) => {
|
||||||
|
this.isSafeType = response.data.isSafeType;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/** 转换菜单数据结构 */
|
/** 转换菜单数据结构 */
|
||||||
normalizer(node) {
|
normalizer(node) {
|
||||||
if (node.children && !node.children.length) {
|
if (node.children && !node.children.length) {
|
||||||
|
|
@ -473,6 +487,7 @@ export default {
|
||||||
console.log('storageNum---',res.data.storageNum)
|
console.log('storageNum---',res.data.storageNum)
|
||||||
this.$set(row, 'pendingOutNum', res.data.pendingOutNum)
|
this.$set(row, 'pendingOutNum', res.data.pendingOutNum)
|
||||||
this.$set(row, 'storageNum', res.data.storageNum)
|
this.$set(row, 'storageNum', res.data.storageNum)
|
||||||
|
this.$set(row, 'jiJuType', res.data.jiJuType)
|
||||||
}
|
}
|
||||||
// this.$set(row, 'newTypeId', row.newTypeId)
|
// this.$set(row, 'newTypeId', row.newTypeId)
|
||||||
// this.$set(row, 'num', row.num)
|
// this.$set(row, 'num', row.num)
|
||||||
|
|
@ -497,6 +512,11 @@ export default {
|
||||||
this.leaseList.forEach((item) => {
|
this.leaseList.forEach((item) => {
|
||||||
// 检查 item 的 id 是否存在于 this.items 中
|
// 检查 item 的 id 是否存在于 this.items 中
|
||||||
if (this.items.some((selectedItem) => selectedItem.id === item.id)) {
|
if (this.items.some((selectedItem) => selectedItem.id === item.id)) {
|
||||||
|
console.log('hhhhhhhhhxxxxx',item,this.isSafeType)
|
||||||
|
if(item.jiJuType == 1 && this.isSafeType == 1){
|
||||||
|
this.$modal.msgError("所选择的领用单位的安全工器具协议下所勾选的物资包含机具,不能发布!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// 如果存在,将 item 存入 itemsTemp
|
// 如果存在,将 item 存入 itemsTemp
|
||||||
itemsTemp.push({'typeId': item.typeId,'parentId':item.parentId, 'num': item.num, 'newTypeId': item.newTypeId});
|
itemsTemp.push({'typeId': item.typeId,'parentId':item.parentId, 'num': item.num, 'newTypeId': item.newTypeId});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -468,6 +468,7 @@ export default {
|
||||||
projectTemp: undefined,
|
projectTemp: undefined,
|
||||||
unitTemp: undefined,
|
unitTemp: undefined,
|
||||||
agreementId: undefined,
|
agreementId: undefined,
|
||||||
|
isSafeType: 0,
|
||||||
// taxRate:0,
|
// taxRate:0,
|
||||||
flattenOptions: [], // 扁平化后的选项数据
|
flattenOptions: [], // 扁平化后的选项数据
|
||||||
typePopoverVisible: false,
|
typePopoverVisible: false,
|
||||||
|
|
@ -596,6 +597,7 @@ export default {
|
||||||
// } else if (val && val.length == 0) {
|
// } else if (val && val.length == 0) {
|
||||||
// this.maForm.projectId = "";
|
// this.maForm.projectId = "";
|
||||||
// }
|
// }
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
// projectId: this.maForm.projectId
|
// projectId: this.maForm.projectId
|
||||||
getMaterialUnitListApi({ projectId: this.maForm.projectId }).then((response) => {
|
getMaterialUnitListApi({ projectId: this.maForm.projectId }).then((response) => {
|
||||||
|
|
@ -735,10 +737,11 @@ export default {
|
||||||
// 处理类型数据
|
// 处理类型数据
|
||||||
processTypeData(data) {
|
processTypeData(data) {
|
||||||
const result = [];
|
const result = [];
|
||||||
|
console.log("zzzzzzzzzzzzzzzzz",data)
|
||||||
const traverse = (node, parents = []) => {
|
const traverse = (node, parents = []) => {
|
||||||
const path = [...parents, node.typeName];
|
const path = [...parents, node.typeName];
|
||||||
|
|
||||||
|
// 确保jijuType属性被正确提取
|
||||||
if (!node.children || node.children.length === 0) {
|
if (!node.children || node.children.length === 0) {
|
||||||
result.push({
|
result.push({
|
||||||
typeId: node.typeId,
|
typeId: node.typeId,
|
||||||
|
|
@ -751,7 +754,8 @@ export default {
|
||||||
specificationType: node.typeName,
|
specificationType: node.typeName,
|
||||||
unitName: node.unitName,
|
unitName: node.unitName,
|
||||||
unitValue: node.unitValue,
|
unitValue: node.unitValue,
|
||||||
maxSortPriority: node.maxSortPriority
|
maxSortPriority: node.maxSortPriority,
|
||||||
|
jiJuType: node.jiJuType,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -800,7 +804,6 @@ export default {
|
||||||
// 获取新选中的项
|
// 获取新选中的项
|
||||||
const lastSelected = val[val.length - 1];
|
const lastSelected = val[val.length - 1];
|
||||||
const typeData = this.flattenTypeOptions.find(item => item.typeId === lastSelected);
|
const typeData = this.flattenTypeOptions.find(item => item.typeId === lastSelected);
|
||||||
|
|
||||||
if (typeData) {
|
if (typeData) {
|
||||||
if (this.equipmentList.some(item => item.typeId === lastSelected)) {
|
if (this.equipmentList.some(item => item.typeId === lastSelected)) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|
@ -917,8 +920,13 @@ export default {
|
||||||
projectId: this.maForm.projectId,
|
projectId: this.maForm.projectId,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
this.agreementId = response.data.agreementId;
|
this.agreementId = response.data.agreementId;
|
||||||
|
this.isSafeType = response.data.isSafeType;
|
||||||
this.maForm.agreementId = this.agreementId;
|
this.maForm.agreementId = this.agreementId;
|
||||||
});
|
});
|
||||||
|
if(this.isSafeType==1 && this.equipmentList.some(item => item.jiJuType == 1)){
|
||||||
|
this.$modal.msgError("该安全工器具协议下所申请的物资包含机具,不能申请!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.maForm.taskId = this.taskId;
|
this.maForm.taskId = this.taskId;
|
||||||
// this.maForm.checkDetailsList = this.equipmentList
|
// this.maForm.checkDetailsList = this.equipmentList
|
||||||
await this.$modal
|
await this.$modal
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue