成套问题修改,领料申请时可选成套设备
This commit is contained in:
parent
9f9e979cb9
commit
e0e22054fb
|
|
@ -320,3 +320,8 @@ export function getLeaseOutDetailRecordApi(data) {
|
|||
params: data,
|
||||
})
|
||||
}
|
||||
|
||||
/* 获取抱杆成套下拉数据 */
|
||||
export const getHoldingPoleSelListApi = () => {
|
||||
return request.get('/material/maWhole/selectWholeList')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,21 +72,41 @@
|
|||
style="width: 240px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="抱杆设备" prop="agreementCode">
|
||||
<el-select
|
||||
clearable
|
||||
style="width: 240px"
|
||||
placeholder="请选择抱杆设备"
|
||||
@change="onChangeWholeTypeName"
|
||||
v-model="queryParams.wholeTypeName"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in holdingPoleSelList"
|
||||
:key="item.id"
|
||||
:label="item.wholeTypeName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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"
|
||||
collapse-tags
|
||||
:key="propsKey"
|
||||
:disabled="(isEdit && !isView) || isCost"
|
||||
style="width: 240px"
|
||||
v-model="deviceType"
|
||||
:show-all-levels="false"
|
||||
ref="deviceTypeCascader"
|
||||
:options="deviceTypeTree"
|
||||
@change="deviceTypeChange"
|
||||
placeholder="请输入规格型号"
|
||||
popper-class="popper-select"
|
||||
:props="deviceTypeTreeProps"
|
||||
:disabled="
|
||||
(isEdit && !isView) ||
|
||||
isCost ||
|
||||
wholeTypeNameList.length > 0
|
||||
"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="预计领料时间" prop="estimateLeaseTime">
|
||||
|
|
@ -154,11 +174,11 @@
|
|||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
v-if="isView"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd"
|
||||
>
|
||||
保存
|
||||
|
|
@ -176,9 +196,58 @@
|
|||
</el-col> -->
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-show="wholeTypeNameList.length > 0"
|
||||
:data="wholeTypeNameList"
|
||||
>
|
||||
<el-table-column type="index" align="center" />
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="props">
|
||||
<el-table :data="props.row.childrenList">
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="typeName"
|
||||
label="设备名称"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="规格型号"
|
||||
prop="deviceType"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="设备所属"
|
||||
prop="deviceAscription"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="领用数量"
|
||||
prop="deviceNum"
|
||||
/>
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="wholeTypeName"
|
||||
align="center"
|
||||
label="抱杆设备名称"
|
||||
/>
|
||||
<el-table-column align="center" label="操作" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="onHandelDelete(scope.$index)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="leaseApplyDetails"
|
||||
v-show="wholeTypeNameList.length === 0"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
|
|
@ -239,7 +308,10 @@
|
|||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="
|
||||
handleDelete({ ...scope.row, index: scope.$index })
|
||||
handleDelete({
|
||||
...scope.row,
|
||||
index: scope.$index,
|
||||
})
|
||||
"
|
||||
>
|
||||
删除
|
||||
|
|
@ -252,18 +324,11 @@
|
|||
|
||||
<script>
|
||||
import {
|
||||
getRole,
|
||||
delRole,
|
||||
addRole,
|
||||
updateRole,
|
||||
dataScope,
|
||||
changeRoleStatus,
|
||||
deptTreeSelect,
|
||||
} from '@/api/system/role'
|
||||
import {
|
||||
treeselect as menuTreeselect,
|
||||
roleMenuTreeselect,
|
||||
} from '@/api/system/menu'
|
||||
addCompleteSetToolsApi,
|
||||
queryCompleteSetToolsApi,
|
||||
getCompleteSetToolsApi,
|
||||
delCompleteSetToolsApi,
|
||||
} from '@/api/store/completeTools.js'
|
||||
import {
|
||||
getProData,
|
||||
getUnitData,
|
||||
|
|
@ -276,6 +341,7 @@ import {
|
|||
getLeaseApplyAuditListAll,
|
||||
getCostBearingApi,
|
||||
getAgreementInfoByIdApi,
|
||||
getHoldingPoleSelListApi,
|
||||
} from '@/api/claimAndRefund/receive'
|
||||
import { getInfo } from '@/api/login'
|
||||
export default {
|
||||
|
|
@ -392,6 +458,7 @@ export default {
|
|||
},
|
||||
//领料详情集合
|
||||
leaseApplyDetails: [],
|
||||
wholeTypeName: '',
|
||||
},
|
||||
typeList: [
|
||||
{ id: '0', name: '工程租赁' },
|
||||
|
|
@ -500,6 +567,9 @@ export default {
|
|||
costBearingList: [],
|
||||
isCost: false,
|
||||
propsKey: 1000,
|
||||
holdingPoleSelList: [],
|
||||
wholeTypeNameList: [],
|
||||
wholeTypeItemsList: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -511,6 +581,8 @@ export default {
|
|||
|
||||
this.getCostBearingFun()
|
||||
|
||||
this.getHoldingPoleSelListData()
|
||||
|
||||
// this.GetDeviceTypeTree()
|
||||
// this.getList();
|
||||
if (this.$route.query.taskId && !this.$route.query.isBack) {
|
||||
|
|
@ -789,28 +861,59 @@ export default {
|
|||
if (!valid) {
|
||||
return false
|
||||
} else {
|
||||
this.queryParams.leaseApplyDetails = this.leaseApplyDetails
|
||||
if (this.queryParams.leaseApplyDetails.length == 0) {
|
||||
this.$message.error('请添加机具类型')
|
||||
if (
|
||||
this.queryParams.leaseApplyDetails.length === 0 &&
|
||||
this.wholeTypeNameList.length === 0
|
||||
) {
|
||||
this.$message.error('请添加机具类型或成套设备')
|
||||
return
|
||||
}
|
||||
|
||||
let canSave = true
|
||||
try {
|
||||
this.queryParams.leaseApplyDetails.forEach((item) => {
|
||||
if (item.num == 0) {
|
||||
this.$message.error(
|
||||
'机具类型库存量为零无法领料',
|
||||
)
|
||||
throw new Error()
|
||||
}
|
||||
if (item.preNum == '') {
|
||||
this.$message.error('请填写预领数量')
|
||||
throw new Error()
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
throw e
|
||||
|
||||
if (this.queryParams.leaseApplyDetails.length > 0) {
|
||||
this.queryParams.leaseApplyDetails =
|
||||
this.leaseApplyDetails
|
||||
try {
|
||||
this.queryParams.leaseApplyDetails.forEach(
|
||||
(item) => {
|
||||
if (item.num == 0) {
|
||||
this.$message.error(
|
||||
'机具类型库存量为零无法领料',
|
||||
)
|
||||
throw new Error()
|
||||
}
|
||||
if (item.preNum == '') {
|
||||
this.$message.error('请填写预领数量')
|
||||
throw new Error()
|
||||
}
|
||||
},
|
||||
)
|
||||
} catch (e) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
if (this.wholeTypeNameList.length > 0) {
|
||||
const wholeTypeList = []
|
||||
this.wholeTypeNameList.forEach((i) => {
|
||||
i.childrenList.forEach((e) => {
|
||||
const items = {
|
||||
companyId: '101',
|
||||
guigeCn: e.deviceType,
|
||||
preNum: e.deviceNum,
|
||||
typeCn: e.typeName,
|
||||
typeId: e.deviceTypeId,
|
||||
wholeTypeName: i.wholeTypeName,
|
||||
}
|
||||
|
||||
wholeTypeList.push(items)
|
||||
})
|
||||
})
|
||||
|
||||
this.queryParams.leaseApplyDetails = wholeTypeList
|
||||
}
|
||||
|
||||
if (!canSave) {
|
||||
return false
|
||||
}
|
||||
|
|
@ -1022,6 +1125,43 @@ export default {
|
|||
this.$delete(this.queryParams, 'costBearingParty')
|
||||
}
|
||||
},
|
||||
|
||||
/* 获取抱杆下拉数据 */
|
||||
async getHoldingPoleSelListData() {
|
||||
const { data: res } = await getHoldingPoleSelListApi()
|
||||
this.holdingPoleSelList = res
|
||||
},
|
||||
/* 抱杆成套设备change事件 */
|
||||
onChangeWholeTypeName(val) {
|
||||
const selLable = this.holdingPoleSelList.find((e) => e.id === val)
|
||||
const wholeTypeNameData = {
|
||||
id: val,
|
||||
wholeTypeName: selLable.wholeTypeName,
|
||||
childrenList: [],
|
||||
}
|
||||
queryCompleteSetToolsApi(wholeTypeNameData).then((res) => {
|
||||
wholeTypeNameData.childrenList = res.data
|
||||
const isREpeat = this.wholeTypeNameList.find(
|
||||
(e) => e.id === val,
|
||||
)
|
||||
if (!isREpeat) {
|
||||
this.wholeTypeNameList.push(wholeTypeNameData)
|
||||
} else {
|
||||
this.$modal.msgError(
|
||||
'当前抱杆成套设备已添加,不可重复添加!',
|
||||
)
|
||||
}
|
||||
|
||||
console.log(this.wholeTypeNameList, '处理后的数据---')
|
||||
})
|
||||
|
||||
this.queryParams.wholeTypeName = ''
|
||||
},
|
||||
|
||||
/* 删除 */
|
||||
onHandelDelete(index) {
|
||||
this.wholeTypeNameList.splice(index, 1)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@
|
|||
/>
|
||||
<el-table-column
|
||||
prop="typeModelName"
|
||||
label="主体设备"
|
||||
label="抱杆设备"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
|
|
@ -162,21 +162,21 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="主体设备"
|
||||
label="抱杆设备"
|
||||
prop="mainDevice"
|
||||
class="is-required"
|
||||
>
|
||||
<el-cascader
|
||||
clearable
|
||||
filterable
|
||||
ref="mainDeviceRef"
|
||||
placeholder="请选择主体设备"
|
||||
:options="deviceTypeTreeNew"
|
||||
:props="deviceTypeTreeProps"
|
||||
v-model="addCompleteForm.mainDevice"
|
||||
@change="selMainDevice"
|
||||
:show-all-levels="false"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择抱杆设备"
|
||||
:options="deviceTypeTreeNew"
|
||||
:props="deviceTypeTreeProps"
|
||||
:disabled="mainDeviceDisabled"
|
||||
v-model="addCompleteForm.mainDevice"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="配套设备" prop="assortDevice">
|
||||
|
|
@ -405,6 +405,7 @@ export default {
|
|||
assortDevice: '',
|
||||
}
|
||||
this.tempList = []
|
||||
this.mainDeviceDisabled = false
|
||||
this.open = true
|
||||
},
|
||||
// 编辑
|
||||
|
|
@ -418,12 +419,20 @@ export default {
|
|||
const queryParams = {
|
||||
id: row.id,
|
||||
wholeTypeName: row.wholeTypeName,
|
||||
pageNum: 1,
|
||||
pageSize: 99999,
|
||||
// pageNum: 1,
|
||||
// pageSize: 99999,
|
||||
}
|
||||
const { rows: res } = await queryCompleteSetToolsApi(queryParams)
|
||||
const { data: res } = await queryCompleteSetToolsApi(queryParams)
|
||||
this.tempList = res
|
||||
this.open = true
|
||||
|
||||
this.$nextTick(() => {
|
||||
const mainDeviceRef = this.$refs.mainDeviceRef
|
||||
const input = mainDeviceRef.$el.querySelector('input')
|
||||
if (input) {
|
||||
input.value = this.tempList[0].deviceType
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除当前行
|
||||
|
|
@ -462,6 +471,13 @@ export default {
|
|||
*/
|
||||
//主体设备选择
|
||||
selMainDevice(val) {
|
||||
if (val.length < 4) {
|
||||
this.$modal.msgError(
|
||||
'请选择第四级规格型号的数据,如未添加可以添加后再操作!',
|
||||
)
|
||||
this.addCompleteForm.mainDevice = []
|
||||
return
|
||||
}
|
||||
this.$message.closeAll()
|
||||
const checkNode = this.$refs['mainDeviceRef'].getCheckedNodes()
|
||||
this.recursionGetDeviceName(
|
||||
|
|
@ -474,7 +490,7 @@ export default {
|
|||
deviceType: checkNode[0].label, // 设备型号
|
||||
deviceTypeId: val[val.length - 1], // 设备Id
|
||||
deviceNum: '', // 数量
|
||||
deviceAscription: '主体设备', // 所属类型
|
||||
deviceAscription: '抱杆设备', // 所属类型
|
||||
ascriptionType: 1, // 所属类型 1 主体设备 2 配套设备
|
||||
typeName: this.deviceName,
|
||||
}
|
||||
|
|
@ -500,6 +516,13 @@ export default {
|
|||
},
|
||||
// 配套设备选择
|
||||
selAssortDevice(val) {
|
||||
if (val.length < 4) {
|
||||
this.$modal.msgError(
|
||||
'请选择第四级规格型号的数据,如未添加可以添加后再操作!',
|
||||
)
|
||||
this.addCompleteForm.assortDevice = []
|
||||
return
|
||||
}
|
||||
this.$message.closeAll()
|
||||
const checkNode = this.$refs['assortDeviceRef'].getCheckedNodes()
|
||||
this.recursionGetDeviceName(
|
||||
|
|
@ -524,7 +547,7 @@ export default {
|
|||
this.tempList[0].deviceTypeId === assortDeviceObj.deviceTypeId
|
||||
) {
|
||||
this.$message.error(
|
||||
'所选设备已作为主体设备,不可再作为配套设备!',
|
||||
'所选设备已作为抱杆设备,不可再作为配套设备!',
|
||||
)
|
||||
return
|
||||
}
|
||||
|
|
@ -568,7 +591,7 @@ export default {
|
|||
)
|
||||
|
||||
if (!isMainDevice) {
|
||||
this.$message.error('请添加主体设备!')
|
||||
this.$message.error('请添加抱杆设备!')
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -189,6 +189,18 @@
|
|||
prop="allNum"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="报废数量"
|
||||
align="center"
|
||||
prop="scrapNum"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="预报废数量"
|
||||
align="center"
|
||||
prop="preScrapNum"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<!-- <el-table-column label="总保有量资产(万元)" align="center" prop="proName" :show-overflow-tooltip="true" /> -->
|
||||
<el-table-column
|
||||
label="是否计数"
|
||||
|
|
|
|||
Loading…
Reference in New Issue