| | |
| | | v-model="form.ks" |
| | | placeholder="请选择科室" |
| | | style="width: 200" |
| | | @change="idFn" |
| | | > |
| | | <el-option |
| | | v-for="item in departmentOptions" |
| | | :key="item.value" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | :value="item.label" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | deptTreeSelect().then((response) => { |
| | | this.departmentOptions = response.data[0].children; |
| | | console.log(response, 999); |
| | | }, |
| | | |
| | | idFn(value) { |
| | | console.log("Selected Value:", value); |
| | | this.departmentOptions.forEach((item) => { |
| | | console.log(this.departmentOptions, 333); |
| | | console.log(item, 555); |
| | | |
| | | if (item.value == value) { |
| | | this.form.ks = item.label; |
| | | } |
| | | }); |
| | | }, |
| | | /* getDeptTree() { |
| | | deptTreeSelect().then((response) => { |
| | | this.deptOption = response.data; |
| | | }); |
| | | }, */ |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | |
| | | |
| | | handleSelectionChange1(selection) { |
| | | this.ChangeList = selection; |
| | | this.ids = selection.map((item) => item.aid); |
| | | this.ids = selection.map((item) => item.id); |
| | | this.single = selection.length !== 1; |
| | | this.multiple = !selection.length; |
| | | if (selection.length > 1) { |
| | |
| | | |
| | | /* 弹框确定按钮 */ |
| | | submit() { |
| | | console.log(this.ChangeList, 123); |
| | | |
| | | this.ChangeList.forEach((item) => { |
| | | console.log(item.title, 6363); |
| | | this.form.jymc = item.title; |
| | | console.log(this.form.adviceBt, 2525); |
| | | |
| | | this.form.jynr = item.advice; |
| | | // this.sfxmId = parseInt(item.id); |
| | |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "添加体检项目建议规则新表"; |
| | | deptTreeSelect().then((response) => { |
| | | this.departmentOptions = response.data[0].children; |
| | | console.log(response, 999); |
| | | }); |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | |
| | | this.open = true; |
| | | this.title = "修改体检项目建议规则新表"; |
| | | }); |
| | | deptTreeSelect().then((response) => { |
| | | this.departmentOptions = response.data[0].children; |
| | | console.log(response, 999); |
| | | }); |
| | | }, |
| | | |
| | | submitForm() { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | this.columns.forEach((column) => { |
| | | if (column.htmlType === "checkbox") { |
| | | // 将选中的 checkbox 值用逗号分隔 |
| | | this.form[column.javaField] = |
| | | this.form[column.javaField].join(","); |
| | | } |
| | | }); |
| | | if (this.table.sub) { |
| | | this.form.subclassNameList = this.subclassNameList; // 假设 subclassNameList 是子表格的数据 |
| | | } |
| | | if (this.form[pkColumn.javaField] != null) { |
| | | if (this.form.id != null) { |
| | | updateAdvicerules(this.form).then((response) => { |
| | | console.log(response, 1111333); |
| | | |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); // 刷新列表 |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | // 如果主键字段为空,进行新增操作 |
| | | addAdvicerules(this.form).then((response) => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); // 刷新列表 |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | handleDelete(row) { |
| | | const pkValue = row[pkColumn.javaField] || this.ids; // 获取主键值,如果row中没有主键值,则使用this.ids |
| | | console.log(row,6677); |
| | | |
| | | const pkValue = row.id; // 获取主键值,如果row中没有主键值,则使用this.ids |
| | | this.$modal |
| | | .confirm(`是否确认删除${functionName}编号为"${pkValue}"的数据项?`) |
| | | .confirm(`是否确认删除${row.ks}编号为"${pkValue}"的数据项?`) |
| | | .then(() => { |
| | | return delAdvicerules(pkValue); // 调用删除接口,传入主键值 |
| | | }) |