| | |
| | | <a-form :form="form"> |
| | | <a-form-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请输入中文名称" |
| | | |
| | | @input="custChinaNameChange" |
| | | v-decorator="['custChinaName', { rules: [{ required: true, message: '请输入中文名称!' }] }]" /> |
| | | </a-form-item> |
| | | <a-form-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | |
| | | |
| | | <a-form-item label="助记码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <!-- <a-input placeholder="请输入助记码" v-decorator="['mnemonicCode']" /> --> |
| | | <a-input-search :disabled="disabled" placeholder="请输入助记码" v-decorator="['mnemonicCode']" @search="onSearch" /> |
| | | <!-- <a-input-search :disabled="disabled" placeholder="请输入助记码" v-decorator="['mnemonicCode']" @search="onSearch" /> --> |
| | | <a-input placeholder="请输入助记码" v-decorator="['mnemonicCode', { rules: [{ required: true, message: '请输入助记码!' }] }]" /> |
| | | </a-form-item> |
| | | |
| | | <a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | |
| | | const custTypeOption = this.$options |
| | | this.custTypeData = custTypeOption.filters['dictData']('base_customer_type') |
| | | }, |
| | | onSearch() { |
| | | let mnemonicCode = this.form.getFieldValue('mnemonicCode'); |
| | | if (!mnemonicCode) { |
| | | this.$message.warning("请输入助记码") |
| | | /*中文名称值改变调用的方法*/ |
| | | custChinaNameChange(){ |
| | | let custChinaNameValue = this.form.getFieldValue('custChinaName'); |
| | | console.log(typeof custChinaNameValue) |
| | | console.log("custChinaNameValue:"+custChinaNameValue); |
| | | if(!custChinaNameValue){ |
| | | this.form.setFieldsValue({ |
| | | mnemonicCode: '' |
| | | }) |
| | | return |
| | | } |
| | | if (custChinaNameValue!=undefined&&!custChinaNameValue.trim().length) { |
| | | this.form.setFieldsValue({ |
| | | mnemonicCode: '' |
| | | }) |
| | | return |
| | | } |
| | | /*调用获取助记码接口*/ |
| | | BaseZjmList({ |
| | | 'name': mnemonicCode |
| | | 'name': custChinaNameValue |
| | | }).then((res) => { |
| | | if (res.success) { |
| | | if (res.data) { |
| | |
| | | mnemonicCode: this.zjCode |
| | | }) |
| | | } else { |
| | | this.$message.warning("助记码生成失败") |
| | | // this.$message.warning("助记码生成失败") |
| | | this.form.setFieldsValue({ |
| | | mnemonicCode: '' |
| | | }) |
| | | } |
| | | } else { |
| | | this.$message.error('新增失败:' + JSON.stringify(res.message)) |
| | | this.$message.error('助记码生成失败:' + JSON.stringify(res.message)) |
| | | } |
| | | }).finally((res) => { |
| | | this.confirmLoading = false |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 提交表单 |
| | | */ |
| | |
| | | } |
| | | } |
| | | if (values.mnemonicCode && !this.zjCode) { |
| | | this.$message.warning("请点击搜索助记码!") |
| | | this.$message.warning("助记码不能为空!") |
| | | return |
| | | } |
| | | this.confirmLoading = true |