|
@@ -146,10 +146,10 @@ export default {
|
|
|
CommonForm
|
|
|
},
|
|
|
data() {
|
|
|
- let reg = /^[a-zA-Z0-9:.,?!@/();,)(-]{0,10000}[#$^]?$/;
|
|
|
+ let reg = /[\u4E00-\u9FA5\uF900-\uFA2D]/;
|
|
|
let checkFrequency = (rule, value, callback) => {
|
|
|
let pycode = this.$refs.pycode.value;
|
|
|
- if (!reg.test(pycode && pycode.trim())) {
|
|
|
+ if (reg.test(pycode && pycode.trim())) {
|
|
|
callback('术语拼音仅支持字母、数字和标点符号');
|
|
|
} else {
|
|
|
callback();
|
|
@@ -370,7 +370,6 @@ export default {
|
|
|
min_prod_unit, //最小制剂单位(药品代码通用名属性)
|
|
|
stand_reg_JiXin //标准注册剂型(药品代码通用名属性)
|
|
|
};
|
|
|
- console.log(params.min_pack_num, 'min_pack_num');
|
|
|
if (this.isEdit) {
|
|
|
params = { ...params, id: this.id };
|
|
|
}
|
|
@@ -423,7 +422,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- this.$refs.form.validate(valid => {
|
|
|
+ this.$refs.form.validate(async valid => {
|
|
|
if (valid) {
|
|
|
if (!goOn) return;
|
|
|
this.saveDisable = true;
|
|
@@ -432,37 +431,87 @@ export default {
|
|
|
this.saveDisable = false;
|
|
|
return;
|
|
|
}
|
|
|
- api.saveEntity(params).then(res => {
|
|
|
- if (res.data.code === '0') {
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: '保存成功',
|
|
|
- type: 'success',
|
|
|
- duration: 1000
|
|
|
+ let res = await api.dataEntityVerify(params);
|
|
|
+ if (!res.data.data) {
|
|
|
+ this.$alert(`${res.data.msg}`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ api.saveEntity(params).then(res => {
|
|
|
+ if (res.data.code === '0') {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '保存成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1000
|
|
|
+ });
|
|
|
+ this.$router.push({
|
|
|
+ name: 'KnowledgeManage',
|
|
|
+ params: Object.assign({}, this.$route.params, {
|
|
|
+ currentPage: numberpage
|
|
|
+ })
|
|
|
+ });
|
|
|
+ } else if (res.data.code === '00020007') {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.msg,
|
|
|
+ type: 'error',
|
|
|
+ duration: 1000
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.msg,
|
|
|
+ type: 'error',
|
|
|
+ duration: 1000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.saveDisable = false;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.saveDisable = false;
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '保存失败',
|
|
|
+ type: 'error',
|
|
|
+ duration: 1000
|
|
|
+ });
|
|
|
});
|
|
|
- this.$router.push({
|
|
|
- name: 'KnowledgeManage',
|
|
|
- params: Object.assign({}, this.$route.params, {
|
|
|
- currentPage: numberpage
|
|
|
- })
|
|
|
- });
|
|
|
- } else if (res.data.code === '00020007') {
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: res.data.msg,
|
|
|
- type: 'error',
|
|
|
- duration: 1000
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: res.data.msg,
|
|
|
- type: 'error',
|
|
|
- duration: 1000
|
|
|
- });
|
|
|
- }
|
|
|
- this.saveDisable = false;
|
|
|
- });
|
|
|
+ } else if (res.data.data) {
|
|
|
+ api.saveEntity(params).then(res => {
|
|
|
+ if (res.data.code === '0') {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '保存成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1000
|
|
|
+ });
|
|
|
+ this.$router.push({
|
|
|
+ name: 'KnowledgeManage',
|
|
|
+ params: Object.assign({}, this.$route.params, {
|
|
|
+ currentPage: numberpage
|
|
|
+ })
|
|
|
+ });
|
|
|
+ } else if (res.data.code === '00020007') {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.msg,
|
|
|
+ type: 'error',
|
|
|
+ duration: 1000
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.msg,
|
|
|
+ type: 'error',
|
|
|
+ duration: 1000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.saveDisable = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
} else {
|
|
|
goOn = false;
|
|
|
}
|