提交 c73d1deb 编写于 作者: shuang.zhou's avatar shuang.zhou

更换条形码接口

上级 92fa618f
...@@ -212,3 +212,12 @@ export const getGoodsListAll = (params) => { ...@@ -212,3 +212,12 @@ export const getGoodsListAll = (params) => {
description: "查询商品类别", description: "查询商品类别",
}); });
}; };
// 条形码获取信息
export const getBarcodeData =(barCode) => {
return fetch({
headers,
url: getBaseUrl(`store/admin/medical/queryByBarcode/${barCode}`),
method: "get",
description: "条形码获取信息",
});
}
\ No newline at end of file
...@@ -3,8 +3,8 @@ const form1 = { ...@@ -3,8 +3,8 @@ const form1 = {
medicCommonName: "", // 产品通用名称 medicCommonName: "", // 产品通用名称
barCode: "", // 条形码 barCode: "", // 条形码
medicGoodsName: "", // 商品名称 medicGoodsName: "", // 商品名称
size: "", // 规格 specifications: "", // 规格
manufacturer: "", // 生产企业 productionCompany: "", // 生产企业
medicalCategoryId: "", // 药品分类 medicalCategoryId: "", // 药品分类
}; };
......
export const kk = {
data: {
smallStoreList: [
{
id: 14913,
certifyId: null,
tradeMedicalLibId: 7561,
productName: null,
goodsName: null,
barCode: "TMP7561",
usedFlag: 1,
categoryName: 1,
categoryIdLevel2: null,
categoryIdLevel3: null,
categoryIdLevel4: null,
category: "药品",
status: 3,
refuseContent: null,
modifiedTime: "2022-03-01 13:43:01",
lastModifiedPerson: null,
createTime: "2022-03-01 13:43:01",
},
{
id: 14912,
certifyId: null,
tradeMedicalLibId: 0,
productName: "ahhah",
goodsName: "jaksdh",
barCode: "TMP1646104308791",
usedFlag: null,
categoryName: 5,
categoryIdLevel2: 504,
categoryIdLevel3: -1,
categoryIdLevel4: -1,
category: "服务/系统服务",
status: 2,
refuseContent: null,
modifiedTime: "2022-03-01 11:11:49",
lastModifiedPerson: "周爽",
createTime: "2022-03-01 11:11:49",
},
{
id: 14911,
certifyId: null,
tradeMedicalLibId: 7560,
productName: null,
goodsName: null,
barCode: "TMP7560",
usedFlag: 1,
categoryName: 1,
categoryIdLevel2: null,
categoryIdLevel3: null,
categoryIdLevel4: null,
category: "药品",
status: 3,
refuseContent: null,
modifiedTime: "2022-02-28 17:17:35",
lastModifiedPerson: null,
createTime: "2022-02-28 17:17:35",
},
{
id: 14910,
certifyId: 77,
tradeMedicalLibId: 7559,
productName: "1",
goodsName: "1",
barCode: "11111",
usedFlag: 1,
categoryName: 1,
categoryIdLevel2: 100,
categoryIdLevel3: 10001,
categoryIdLevel4: 100011,
category: "药品/西药/抗微生物药/青霉素类",
status: 3,
refuseContent: null,
modifiedTime: "2022-02-27 15:32:25",
lastModifiedPerson: "金涛",
createTime: "2022-02-27 13:37:05",
},
{
id: 14908,
certifyId: 76,
tradeMedicalLibId: 7548,
productName: "红霉素1",
goodsName: "红霉素1",
barCode: "HMS0001",
usedFlag: 1,
categoryName: 1,
categoryIdLevel2: 100,
categoryIdLevel3: 10001,
categoryIdLevel4: 100011,
category: "药品/西药/抗微生物药/青霉素类",
status: 3,
refuseContent: null,
modifiedTime: "2022-02-27 13:28:59",
lastModifiedPerson: "金涛",
createTime: "2022-02-27 11:43:12",
},
{
id: 14909,
certifyId: null,
tradeMedicalLibId: 7558,
productName: "",
goodsName: "",
barCode: "TMP7558",
usedFlag: 1,
categoryName: 0,
categoryIdLevel2: -1,
categoryIdLevel3: -1,
categoryIdLevel4: -1,
category: "",
status: 2,
refuseContent: null,
modifiedTime: "2022-02-27 13:27:32",
lastModifiedPerson: "金涛",
createTime: "2022-02-27 13:27:32",
},
{
id: 14906,
certifyId: null,
tradeMedicalLibId: 7557,
productName: "",
goodsName: "",
barCode: "TMP7557",
usedFlag: 1,
categoryName: null,
categoryIdLevel2: null,
categoryIdLevel3: null,
categoryIdLevel4: null,
category: "",
status: 3,
refuseContent: null,
modifiedTime: "2022-02-24 14:55:41",
lastModifiedPerson: null,
createTime: "2022-02-24 14:55:41",
},
{
id: 14905,
certifyId: null,
tradeMedicalLibId: 7556,
productName: "",
goodsName: "",
barCode: "232332",
usedFlag: 1,
categoryName: 1,
categoryIdLevel2: null,
categoryIdLevel3: null,
categoryIdLevel4: null,
category: "药品",
status: 3,
refuseContent: null,
modifiedTime: "2022-02-24 14:40:50",
lastModifiedPerson: null,
createTime: "2022-02-24 14:40:50",
},
{
id: 14904,
certifyId: null,
tradeMedicalLibId: 7555,
productName: "",
goodsName: "",
barCode: "32423",
usedFlag: 1,
categoryName: 1,
categoryIdLevel2: null,
categoryIdLevel3: null,
categoryIdLevel4: null,
category: "药品",
status: 3,
refuseContent: null,
modifiedTime: "2022-02-24 14:18:15",
lastModifiedPerson: null,
createTime: "2022-02-24 14:18:15",
},
{
id: 14903,
certifyId: null,
tradeMedicalLibId: 7554,
productName: "",
goodsName: "",
barCode: "TMP7554",
usedFlag: 1,
categoryName: null,
categoryIdLevel2: null,
categoryIdLevel3: null,
categoryIdLevel4: null,
category: "",
status: 3,
refuseContent: null,
modifiedTime: "2022-02-23 18:57:14",
lastModifiedPerson: null,
createTime: "2022-02-23 18:57:13",
},
],
pageNo: 1,
pageSize: 10,
totalPage: 1490,
totalNum: 14893,
},
code: "000000",
message: "成功",
requestId: "8ac3d50b-82ab-4c33-a460-36b9fa52d724",
};
export const params = {
productName: "",
letterPinyin: "",
goodsName: "",
categoryName: "",
categoryIdLevel2: "",
categoryIdLevel3: "",
categoryIdLevel4: "",
barCode: "",
status: "",
goodsFlag: 1,
pageSize: 10,
pageNo: 1,
};
export const hh = {
filterName: "博尔诚",
applySource: "2",
letterPinyin: "",
goodsName: "",
categoryName: "",
categoryIdLevel2: "",
categoryIdLevel3: "",
categoryIdLevel4: "",
barCode: "",
status: "",
goodsFlag: 1,
pageSize: 10,
pageNo: 1,
};
\ No newline at end of file
...@@ -37,8 +37,8 @@ const rules1 = { ...@@ -37,8 +37,8 @@ const rules1 = {
trigger: "blur", trigger: "blur",
}, },
], ],
size: [{ required: true, message: "请输入规格", trigger: "blur" }], specifications: [{ required: true, message: "请输入规格", trigger: "blur" }],
manufacturer: [ productionCompany: [
{ required: true, message: "请输入生产企业", trigger: "blur" }, { required: true, message: "请输入生产企业", trigger: "blur" },
], ],
medicalCategoryId: [ medicalCategoryId: [
......
...@@ -496,11 +496,11 @@ ...@@ -496,11 +496,11 @@
</el-col> </el-col>
</el-form-item> </el-form-item>
<!-- 规格 --> <!-- 规格 -->
<el-form-item label="规格" prop="size" v-if="![4,5].includes(formData1.medicalCategoryId)"> <el-form-item label="规格" prop="specifications" v-if="![4,5].includes(formData1.medicalCategoryId)">
<el-col :span="18"> <el-col :span="18">
<el-input <el-input
size="small" size="small"
v-model="formData1.size" v-model="formData1.specifications"
placeholder="请输入规格" placeholder="请输入规格"
style="width:70%;" style="width:70%;"
></el-input> ></el-input>
...@@ -509,11 +509,11 @@ ...@@ -509,11 +509,11 @@
</el-col> </el-col>
</el-form-item> </el-form-item>
<!-- 生产企业 --> <!-- 生产企业 -->
<el-form-item label="生产企业" prop="manufacturer" v-if="![4,5].includes(formData1.medicalCategoryId)"> <el-form-item label="生产企业" prop="productionCompany" v-if="![4,5].includes(formData1.medicalCategoryId)">
<el-col :span="16"> <el-col :span="16">
<el-input <el-input
size="small" size="small"
v-model="formData1.manufacturer" v-model="formData1.productionCompany"
placeholder="请输入生产企业" placeholder="请输入生产企业"
style="width:70%;" style="width:70%;"
></el-input> ></el-input>
...@@ -536,7 +536,7 @@ ...@@ -536,7 +536,7 @@
import { openLoading, closeLoading, signFigures } from "@/utils/utils"; import { openLoading, closeLoading, signFigures } from "@/utils/utils";
import { isEmptyUtils } from "@/utils/index"; import { isEmptyUtils } from "@/utils/index";
import { doUpload, getFilePath, createFilePath } from "@/utils/qiniu-util"; import { doUpload, getFilePath, createFilePath } from "@/utils/qiniu-util";
import { updateGoods ,updateStock,getGoodsList, getGoodDetails, updateGoodsV2,getContractList, getCooperationProjectList,getMedList,getCategorysList,saveMedList,getGoodsListAll} from '@/utils/goods'; import { updateGoods ,updateStock,getGoodsList, getGoodDetails, updateGoodsV2,getContractList, getCooperationProjectList,getMedList,getCategorysList,saveMedList,getGoodsListAll,getBarcodeData} from '@/utils/goods';
import { getStoreAdressRepot } from "@/utils/shop"; import { getStoreAdressRepot } from "@/utils/shop";
import Cropper from '@/components/common/cropper.vue' import Cropper from '@/components/common/cropper.vue'
import { originRules1, originRules, originRules3 } from './common/rules'; import { originRules1, originRules, originRules3 } from './common/rules';
...@@ -751,7 +751,7 @@ ...@@ -751,7 +751,7 @@
this.isAddServe = true; this.isAddServe = true;
} }
this.$refs.formData1.clearValidate(); this.$refs.formData1.clearValidate();
const formData1Arr = ['medicCommonName','barCode','medicGoodsName','approvalNumber','size','manufacturer']; const formData1Arr = ['medicCommonName','barCode','medicGoodsName','approvalNumber','specifications','productionCompany'];
formData1Arr.map(item => { formData1Arr.map(item => {
this.formData1[item] = ''; this.formData1[item] = '';
}) })
...@@ -1051,14 +1051,16 @@ ...@@ -1051,14 +1051,16 @@
}, },
//快速录入 //快速录入
fastInput(type){ fastInput(type){
///medications/query/{approvalnumber} const code = this.formData1.barCode.trim();
if(this.formData1.barCode == ''){ if(code == ''){
this.$refs.formData1.validateField("barCode") // this.$refs.formData1.validateField("barCode")
this.$message({
message: '请输入条形码',
type: 'error'
});
return; return;
} }
// this.GET("store/medications/query/"+this.formData.approvalNumber).then(res => { getBarcodeData(code).then((res) => {
this.GET(`store/medications/query/barcode/${this.formData1.barCode}`).then(res => {
console.log(res)
if(res.code != '000000'){ if(res.code != '000000'){
return this.$message({ return this.$message({
message: res.message, message: res.message,
...@@ -1071,49 +1073,11 @@ ...@@ -1071,49 +1073,11 @@
type: 'warning' type: 'warning'
}); });
} }
const {imageList,medicationInfo} = res.data const {medicCommonName, medicGoodsName,medicalDetailFieldMap,approvalNumber} = res.data;
// this.formData1.medicationId = medicationInfo.id; const {productionCompany,specifications} = medicalDetailFieldMap;
this.formData1.approvalNumber = medicationInfo.approvalNumber; let fastParm = {medicCommonName,medicGoodsName ,specifications, productionCompany,approvalNumber}
// const {medicCommonName,
// medicGoodsName,
// dosageId,
// size,
// otc,
// usage,
// categoryIdLevel2,
// categoryIdLevel3,
// categoryIdLevel4,
// categoryIdLevel5,
// manufacturer,
// department,
// treatDisease,
// expiredTime} = medicationInfo
// let fastParm = {
// medicCommonName,
// medicGoodsName,
// dosageId,
// size,
// otc,
// usage,
// categoryIdLevel2,
// categoryIdLevel3,
// categoryIdLevel4,
// categoryIdLevel5,
// manufacturer,
// department,
// treatDisease,
// expiredTime,
// }
// this.formData1.otc1 = this.formData1.otc ? '1' : '0'
const {medicCommonName, medicGoodsName, size, manufacturer} = medicationInfo
let fastParm = {medicCommonName,medicGoodsName ,size, manufacturer}
this.formData1 = Object.assign(this.formData1,fastParm) this.formData1 = Object.assign(this.formData1,fastParm)
})
// this.goodDisabled = medicationInfo.medicalCategoryId ? true : false
// this.fileIntrList = this.getImges(imageList,2)
});
}, },
updateStock(){ updateStock(){
let r = /^\+?[1-9][0-9]*$/; let r = /^\+?[1-9][0-9]*$/;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册