Commit dfec8cdb by zhaopanyu

zpy 10.27

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