Commit dfec8cdb by zhaopanyu

zpy 10.27

parent b3218b57
......@@ -56,8 +56,8 @@
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="仪器分类" prop="instrumentTypeName">
<treeselect v-model="form.instrumentTypeName" :options="equiList" :normalizer="normalizer"
<el-form-item label="仪器分类" prop="instrumentTypeId">
<treeselect v-model="form.instrumentTypeId" :options="equiList" :normalizer="normalizer"
placeholder="选择" clearable style="width: 100%" noOptionsText="暂无数据" />
</el-form-item>
</el-col>
......@@ -90,7 +90,7 @@
<!-- 仪器库存修改弹窗 -->
<el-dialog title="仪器库存" :visible.sync="open" width="30%" show-close>
<el-form :model="form" ref="form" size="small" label-width="108px">
<el-form :model="postForm" ref="postForm" size="small" label-width="108px">
<el-row>
<el-col :span="20">
<el-form-item label="仪器名称">
......@@ -198,7 +198,7 @@ export default {
// 弹窗
form: {
instrumentName: "",
instrumentTypeId: "",
instrumentTypeId: null,
instrumentTypeName: null,
instrumentModel: "",
instrumentNum: "",
......@@ -296,10 +296,10 @@ export default {
// 0新增、1编辑、2查看
handleOption(type, item) {
this.collectionForm = {
this.form = {
id: '',
instrumentName: "",
instrumentTypeId: "",
instrumentTypeId: null,
instrumentTypeName: null,
instrumentModel: "",
instrumentNum: "",
......@@ -399,36 +399,40 @@ export default {
},
// 仪器确定
submitparentForm: function () {
const useId = this.form.useId
this.form.useName = useId == '' ? '' : this.equiList.find(item => item.userId == useId).userName
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
if (this.form.id != "") {
// 调用修改接口
editInst(this.form).then(response => {
console.log('this.form', this.form);
console.log('修改成功', response);
this.$modal.msgSuccess("修改成功");
this.dialogTableVisible = false;
this.getList();
this.enuqLeader();
}).catch(error => {
});
} else {
// 调用新增接口
addInst(this.form).then(response => {
console.log('新增成功', response);
this.$modal.msgSuccess("新增成功");
this.dialogTableVisible = false;
this.getList();
}).catch(error => {
});
}
}
});
},
reset() {
// 这里需要重置对话框表单
this.form = {
id: null,
instrumentName: null,
instrumentTypeId: '',
instrumentTypeId: null,
instrumentTypeName: null,
instrumentModel: null,
instrumentNum: null,
......@@ -454,7 +458,7 @@ export default {
this.$modal.msgSuccess("删除成功");
this.getList();
}).catch(error => {
this.$modal.closeLoading();
// this.$modal.closeLoading();
});
} else {
// 批量删除
......
......@@ -73,8 +73,8 @@
</el-col>
<el-col :span="10">
<el-form-item label="参赛老师" prop="teacherId">
<el-select v-model="form.teacherId" placeholder="请选择" clearable style="width: 100%;"
:disabled="nowType == 2 ? true : false">
<el-select v-model="form.teacherId
" placeholder="请选择" clearable style="width: 100%;" :disabled="nowType == 2 ? true : false">
<el-option v-for="(item, index) in teacherList" :key="index" :label="item.userName"
:value="item.userId"></el-option>
</el-select>
......@@ -125,8 +125,8 @@
class="avatar" />
<i v-if="form.schoolAccessoryList.length === 0" class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="备注1">
......@@ -386,26 +386,35 @@ export default {
remark2: '',
remark3: '',
schoolAccessoryList: [],
}
};
this.nowType = type;
if (type != 0) {
const id = row.id
const id = row.id;
getCompetitionxq(id).then(response => {
console.log(response.data, 'chakan');
if (response.code == 200) {
Object.keys(this.form).forEach(key => {
if (response.data[key]) {
this.$set(this.form, key, response.data[key]);
const teacherId = this.form.teacherId
this.form.teacherName = teacherId == '' ? '' : this.teacherList.find(item => item.userId == teacherId).userName
console.log(this.form.teacherName, 'this.form.teacherName');
}
if (response.data.schoolAccessoryList && response.data.schoolAccessoryList.length > 0) {
this.imageUrls = response.data.schoolAccessoryList.map(item => item.accessoryUrl); // 将所有证书照片的地址赋值给 imageUrls
this.imageUrls = response.data.schoolAccessoryList.map(item => item.accessoryUrl);
}
})
});
}
})
});
}
this.dialogVisible = true;
},
//查询老师
getTeacher() {
getTeacher().then(response => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment