| | |
| | | > |
| | | <el-form-item label="单位类型" prop="isZybUnit"> |
| | | <el-radio-group v-model="form.isZybUnit"> |
| | | <el-radio :label="false">普通单位</el-radio> |
| | | <el-radio :label="true">职业病单位</el-radio> |
| | | <el-radio :label="0">普通单位</el-radio> |
| | | <el-radio :label="1">职业病单位</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item |
| | |
| | | id: "", |
| | | // 表单参数 |
| | | form: { |
| | | isZybUnit: false, |
| | | isZybUnit: 0, |
| | | }, |
| | | lastXianPrice: 0, |
| | | forms: { |
| | |
| | | return this.sfzs === "Y"; |
| | | }, |
| | | }, |
| | | |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | |
| | | validTime: null, |
| | | wbm: null, |
| | | deleted: null, |
| | | isZybUnit: 0 |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.form.isZybUnit = 0; |
| | | this.open = true; |
| | | this.title = "添加体检单位信息维护"; |
| | | }, |
| | |
| | | this.reset(); |
| | | const drugManufacturerId = row.drugManufacturerId || this.ids; |
| | | getComp(drugManufacturerId).then((response) => { |
| | | this.form = response.data; |
| | | // 不要直接赋值整个 response.data,而是逐个属性赋值 |
| | | Object.assign(this.form, response.data); |
| | | this.form.isZybUnit = response.data.isZybUnit === true ? 1 : 0; |
| | | console.log('修改时的 isZybUnit 值:', this.form.isZybUnit); |
| | | this.open = true; |
| | | this.title = "修改体检单位信息维护"; |
| | | }); |
| | |
| | | new Big(0) |
| | | ).toNumber(); |
| | | }); |
| | | // ---------------------------------------------------------- |
| | | }) |
| | | .catch(() => { |
| | | this.youhui = oldValue; |
| | |
| | | submitForm() { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | const submitData = { |
| | | ...this.form, |
| | | isZybUnit: Boolean(this.form.isZybUnit) // 转换为布尔值 |
| | | }; |
| | | if (this.form.drugManufacturerId != null) { |
| | | updateComp(this.form).then((response) => { |
| | | updateComp(submitData).then((response) => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | if ( |
| | | this.form.cnName && |
| | | this.form.contactPerson && |
| | | this.form.contactPhone |
| | | ) { |
| | | addComp(this.form).then((response) => { |
| | | if (this.form.cnName && this.form.contactPerson && this.form.contactPhone) { |
| | | addComp(submitData).then((response) => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |