领料出库
This commit is contained in:
parent
21eb93dc29
commit
5832a7f9ca
|
|
@ -26,7 +26,7 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="租赁单位" prop="leaseUnitId">
|
||||
<el-form-item label="租赁单位" prop="unitId">
|
||||
<el-cascader
|
||||
v-model="unitId"
|
||||
:show-all-levels="false"
|
||||
|
|
@ -36,10 +36,11 @@
|
|||
clearable
|
||||
collapse-tags
|
||||
@change="uniteChange"
|
||||
placeholder="请选择退料单位"
|
||||
:disabled="isEdit"
|
||||
placeholder="请选择租赁单位"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="租赁工程" prop="leaseProjectId">
|
||||
<el-form-item label="租赁工程" prop="projectId">
|
||||
<el-cascader
|
||||
v-model="projectId"
|
||||
:show-all-levels="false"
|
||||
|
|
@ -49,6 +50,7 @@
|
|||
clearable
|
||||
collapse-tags
|
||||
@change="projectChange"
|
||||
:disabled="isEdit"
|
||||
placeholder="请选择租赁工程"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
|
|
@ -278,14 +280,14 @@ export default {
|
|||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
leaseUnitId: [
|
||||
unitId: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择租赁单位",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
leaseProjectId: [
|
||||
projectId: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择租赁工程",
|
||||
|
|
@ -339,16 +341,18 @@ export default {
|
|||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
this.projectInfoList();
|
||||
this.equipmentType();
|
||||
if (this.isEdit) {
|
||||
console.log("isEdit", this.isEdit);
|
||||
this.taskId = this.editTaskId;
|
||||
this.id = this.editId;
|
||||
|
||||
this.getTaskInfo();
|
||||
this.equipmentType();
|
||||
} else {
|
||||
this.projectInfoList();
|
||||
this.equipmentType();
|
||||
}
|
||||
// this.projectInfoList();
|
||||
// this.equipmentType();
|
||||
},
|
||||
methods: {
|
||||
uniteChange(val) {
|
||||
|
|
@ -358,11 +362,10 @@ export default {
|
|||
} else if (val && val.length == 0) {
|
||||
this.maForm.unitId = "";
|
||||
}
|
||||
// this.$set(this.maForm, "leaseProjectId", null);
|
||||
getListProject({ unitId: this.maForm.unitId }).then((response) => {
|
||||
this.projectList = response.data;
|
||||
});
|
||||
this.unitTemp = this.unitid;
|
||||
// this.unitTemp = this.unitid;
|
||||
},
|
||||
projectChange(val) {
|
||||
if (val && val.length > 0) {
|
||||
|
|
@ -373,8 +376,7 @@ export default {
|
|||
getListUnite({ projectId: this.maForm.projectId }).then((response) => {
|
||||
this.uniteList = response.data;
|
||||
});
|
||||
// this.maForm.leaseProjectId = val;
|
||||
this.projectTemp = this.projectId;
|
||||
// this.projectTemp = this.projectId;
|
||||
},
|
||||
/** 租赁单位和工程-下拉选 */
|
||||
projectInfoList() {
|
||||
|
|
@ -389,8 +391,7 @@ export default {
|
|||
getListUnite({ projectId: null }).then((response) => {
|
||||
this.uniteList = response.data;
|
||||
});
|
||||
console.log("maForm", this.maForm.leaseUnitId);
|
||||
getListProject({ unitId: this.maForm.leaseUnitId }).then((response) => {
|
||||
getListProject({ unitId: this.maForm.unitId }).then((response) => {
|
||||
this.projectList = response.data;
|
||||
});
|
||||
}
|
||||
|
|
@ -490,12 +491,36 @@ export default {
|
|||
// this.loading = true;
|
||||
await getApplyInfo(this.id).then((response) => {
|
||||
this.maForm = response.data.leaseApplyInfo;
|
||||
console.log("this.maForm", this.maForm);
|
||||
this.maForm.unitId = response.data.leaseApplyInfo.leaseUnitId;
|
||||
this.maForm.projectId = response.data.leaseApplyInfo.leaseProjectId;
|
||||
this.unitId = this.treeParentsById(this.uniteList, this.maForm.unitId);
|
||||
this.projectId = this.treeParentsById(
|
||||
this.projectList,
|
||||
this.maForm.projectId
|
||||
);
|
||||
this.equipmentList = response.data.leaseApplyDetailsList;
|
||||
// this.loading = false;
|
||||
});
|
||||
await this.projectInfoList();
|
||||
},
|
||||
|
||||
//单位,工程树结构数据获取父
|
||||
treeParentsById(list, id) {
|
||||
for (let i in list) {
|
||||
if (list[i].id == id) {
|
||||
//查询到就返回该数组对象的value
|
||||
return [list[i].id];
|
||||
}
|
||||
if (list[i].children) {
|
||||
let node = this.treeParentsById(list[i].children, id);
|
||||
if (node !== undefined) {
|
||||
//查询到把父节把父节点加到数组前面
|
||||
node.unshift(list[i].id);
|
||||
return node;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.roleId);
|
||||
|
|
@ -505,6 +530,7 @@ export default {
|
|||
/** 保存按钮操作 */
|
||||
handleSave() {
|
||||
// console.log(this.equipmentList)
|
||||
console.log("maForm", this.maForm);
|
||||
if (this.equipmentList.length > 0) {
|
||||
this.$refs["maForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
|
|
@ -523,6 +549,8 @@ export default {
|
|||
.then(function () {})
|
||||
.then(() => {
|
||||
if (this.isEdit) {
|
||||
this.maForm.leaseUnitId = this.maForm.unitId;
|
||||
this.maForm.leaseProjectId = this.maForm.projectId;
|
||||
console.log("编辑");
|
||||
this.loading = true;
|
||||
updateApplyInfo({
|
||||
|
|
|
|||
|
|
@ -8,39 +8,33 @@
|
|||
:inline="true"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item label="租赁单位" prop="leaseUnitId">
|
||||
<el-select
|
||||
v-model="maForm.leaseUnitId"
|
||||
<el-form-item label="租赁单位" prop="unitId">
|
||||
<el-cascader
|
||||
v-model="unitId"
|
||||
:show-all-levels="false"
|
||||
:options="uniteList"
|
||||
:props="selectTreeProps"
|
||||
filterable
|
||||
clearable
|
||||
collapse-tags
|
||||
@change="uniteChange"
|
||||
disabled
|
||||
placeholder="请选择租赁单位"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 240px"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in uniteList"
|
||||
:key="item.unitId"
|
||||
:label="item.unitName"
|
||||
:value="item.unitId"
|
||||
/>
|
||||
</el-select>
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="租赁工程" prop="leaseProjectId">
|
||||
<el-select
|
||||
v-model="maForm.leaseProjectId"
|
||||
placeholder="请选择租赁工程"
|
||||
clearable
|
||||
<el-form-item label="租赁工程" prop="projectId">
|
||||
<el-cascader
|
||||
v-model="projectId"
|
||||
:show-all-levels="false"
|
||||
:options="projectList"
|
||||
:props="selectTreeProps"
|
||||
filterable
|
||||
style="width: 240px"
|
||||
clearable
|
||||
collapse-tags
|
||||
@change="projectChange"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in projectList"
|
||||
:key="item.proId"
|
||||
:label="item.proName"
|
||||
:value="item.proId"
|
||||
/>
|
||||
</el-select>
|
||||
placeholder="请选择租赁工程"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="领料人" prop="leasePerson">
|
||||
<el-input
|
||||
|
|
@ -175,12 +169,21 @@ export default {
|
|||
projectList: [],
|
||||
// 表格数据
|
||||
equipmentList: [],
|
||||
unitId: null,
|
||||
projectId: null,
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
rowData: {},
|
||||
maForm: {
|
||||
leaseUnitId: undefined,
|
||||
leaseProjectId: undefined,
|
||||
unitId: undefined,
|
||||
projectId: undefined,
|
||||
},
|
||||
selectTreeProps: {
|
||||
children: "children",
|
||||
label: "name",
|
||||
// multiple: false,
|
||||
value: "id",
|
||||
// multiple: true,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
|
@ -206,11 +209,35 @@ export default {
|
|||
this.loading = true;
|
||||
getApplyInfo(this.id).then((response) => {
|
||||
this.maForm = response.data.leaseApplyInfo;
|
||||
this.maForm.unitId = response.data.leaseApplyInfo.leaseUnitId;
|
||||
this.maForm.projectId = response.data.leaseApplyInfo.leaseProjectId;
|
||||
this.unitId = this.treeParentsById(this.uniteList, this.maForm.unitId);
|
||||
this.projectId = this.treeParentsById(
|
||||
this.projectList,
|
||||
this.maForm.projectId
|
||||
);
|
||||
this.equipmentList = response.data.leaseApplyDetailsList;
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//单位,工程树结构数据获取父
|
||||
treeParentsById(list, id) {
|
||||
for (let i in list) {
|
||||
if (list[i].id == id) {
|
||||
//查询到就返回该数组对象的value
|
||||
return [list[i].id];
|
||||
}
|
||||
if (list[i].children) {
|
||||
let node = this.treeParentsById(list[i].children, id);
|
||||
if (node !== undefined) {
|
||||
//查询到把父节把父节点加到数组前面
|
||||
node.unshift(list[i].id);
|
||||
return node;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
|
|
|
|||
Loading…
Reference in New Issue