|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
<template>
|
|
|
|
|
<el-card style="margin: 5px;margin-top: -20px">
|
|
|
|
|
<el-form :model="formData" ref="dataForm" label-width="100px" style="margin-bottom: -15px">
|
|
|
|
|
<el-form :model="formData" ref="dataForm" :rules="rules" label-width="100px" style="margin-bottom: -15px">
|
|
|
|
|
<el-button-group style="display: flex;margin: 0px 0 10px 80%; height: 35px">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
@ -11,7 +11,7 @@
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item class="query-form-item" label="部门:">
|
|
|
|
|
<el-form-item class="query-form-item" prop="deptCode" label="部门:">
|
|
|
|
|
<el-select v-model="formData.deptCode"
|
|
|
|
|
placeholder="请选择部门"
|
|
|
|
|
clearable="true"
|
|
|
|
@ -30,7 +30,7 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item class="query-form-item" label="仓库:">
|
|
|
|
|
<el-form-item class="query-form-item" prop="invCode" label="仓库:">
|
|
|
|
|
<el-select v-model="formData.invCode"
|
|
|
|
|
placeholder="请选择仓库"
|
|
|
|
|
clearable="true"
|
|
|
|
@ -50,12 +50,12 @@
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item label="原始编码:">
|
|
|
|
|
<el-form-item class="query-form-item" prop="originCode" label="原始编码:">
|
|
|
|
|
<el-input v-model="formData.originCode" placeholder="请输入编码" style="width: 90%" clearable></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item label="物资编码:">
|
|
|
|
|
<el-form-item class="query-form-item" prop="code" label="物资编码:">
|
|
|
|
|
<el-input v-model="formData.code" placeholder="请输入编码" style="width: 90%" clearable disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
@ -63,13 +63,13 @@
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item label="设备名称:">
|
|
|
|
|
<el-form-item class="query-form-item" prop="deviceName" label="设备名称:">
|
|
|
|
|
<el-input v-model="formData.deviceName" placeholder="请输入设备名称" style="width: 90%"
|
|
|
|
|
clearable></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item label="规格型号:">
|
|
|
|
|
<el-form-item class="query-form-item" prop="ggxh" label="规格型号:">
|
|
|
|
|
<el-input v-model="formData.ggxh" placeholder="请输入规格型号" style="width: 90%" clearable></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
@ -186,12 +186,27 @@ export default {
|
|
|
|
|
return {
|
|
|
|
|
deptList: [],
|
|
|
|
|
invList: [],
|
|
|
|
|
userList: []
|
|
|
|
|
userList: [],
|
|
|
|
|
rules: {
|
|
|
|
|
deptCode: [
|
|
|
|
|
{required: true, message: '请选择部门', trigger: 'change'}
|
|
|
|
|
],
|
|
|
|
|
invCode: [
|
|
|
|
|
{required: true, message: '请选择仓库', trigger: 'change'}
|
|
|
|
|
],
|
|
|
|
|
deviceName: [
|
|
|
|
|
{required: true, message: '请输入设备名称', trigger: 'blur'}
|
|
|
|
|
],
|
|
|
|
|
originCode: [
|
|
|
|
|
{required: true, message: '请输入原始编码', trigger: 'blur'}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
deptChange() {
|
|
|
|
|
this.formData.invCode = null;
|
|
|
|
|
this.formData.manager = null;
|
|
|
|
|
this.invList = [];
|
|
|
|
|
this.getInvList();
|
|
|
|
|
this.getDeptUserList();
|
|
|
|
@ -217,7 +232,7 @@ export default {
|
|
|
|
|
this.userList = [];
|
|
|
|
|
let params = {deptId: null};
|
|
|
|
|
this.deptList.forEach((item) => {
|
|
|
|
|
if (item.code === this.formData.fromDeptCode) {
|
|
|
|
|
if (item.code === this.formData.deptCode) {
|
|
|
|
|
params.deptId = item.id;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -226,17 +241,24 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
submit() {
|
|
|
|
|
let formName = isBlank(this.formData.id) ? "add" : "edit";
|
|
|
|
|
saveDeptDevice(this.formData, formName).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.$message.success("添加成功");
|
|
|
|
|
this.closeDialog();
|
|
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
|
|
debugger
|
|
|
|
|
if (!valid) {
|
|
|
|
|
this.$message.error("请完善必填信息");
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message);
|
|
|
|
|
let formName = isBlank(this.formData.id) ? "add" : "edit";
|
|
|
|
|
saveDeptDevice(this.formData, formName).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.$message.success("添加成功");
|
|
|
|
|
this.closeDialog();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message);
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
this.$message.error(error.message);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
this.$message.error(error.message);
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|