提交 3ba9c2c3 编写于 作者: zhongyao.qiao's avatar zhongyao.qiao

feat 库存校验

上级 6d768caa
此差异已折叠。
......@@ -6,7 +6,7 @@
"private": true,
"license": "GPL",
"scripts": {
"dev": "cross-env BUILD_ENV=development node build/dev-server.js",
"dev": "cross-env BUILD_ENV=test node build/dev-server.js",
"local": "cross-env BUILD_ENV=development node build/dev-server.js",
"build": "node build/build.js",
"build:dev": "cross-env BUILD_ENV=development node build/build.js",
......@@ -28,7 +28,7 @@
"iscroll": "^5.2.0",
"js-cookie": "^2.2.0",
"js-md5": "^0.7.3",
"jsencrypt": "^3.2.1",
"jsencrypt": "^3.3.1",
"jspdf": "^1.5.3",
"node-sass": "^4.9.2",
"pdfh5": "^1.3.9",
......
......@@ -3,7 +3,7 @@ import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './router/router'
import store from './store/'
const mixins = require('@/utils/mixins');
import mixins from '@/utils/mixins';
import FastClick from 'fastclick'
import vueFilters from '@/utils/filter'
import draggable from 'vuedraggable'
......@@ -30,14 +30,14 @@ Vue.use(VueVideoPlayer);
Vue.use(ElementUI)
// 注册所有公用过滤器
for(let key in vueFilters) {
for (let key in vueFilters) {
Vue.filter(key, vueFilters[key])
}
if ('addEventListener' in document) {
document.addEventListener('DOMContentLoaded', function() {
FastClick.attach(document.body);
}, false);
document.addEventListener('DOMContentLoaded', function () {
FastClick.attach(document.body);
}, false);
}
Vue.use(VueRouter)
......@@ -45,43 +45,43 @@ const router = new VueRouter({
routes,
mode: 'hash',
strict: process.env.NODE_ENV !== 'production',
scrollBehavior (to, from, savedPosition) {
if (savedPosition) {
return savedPosition
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition
} else {
if (from.meta.keepAlive) {
from.meta.savedPosition = document.body.scrollTop;
}
return { x: 0, y: to.meta.savedPosition || 0 }
return { x: 0, y: to.meta.savedPosition || 0 }
}
}
})
import utils from '@/utils/followup/followupUtils';
router.beforeEach((to, from, next) => {
if(to.meta.checkAuth){
utils.checkAuthFunc().then(res=>{
if(res==3){
if(to.meta.doctorAuth){
utils.getDoctorAuth(router).then(resAuth=>{
if(resAuth==3){
next()
}else{
next(false)
return
}
})
return
}
next();
}else{
next({ path: "/home" });
return
}
})
return
}
next()
if (to.meta.checkAuth) {
utils.checkAuthFunc().then(res => {
if (res == 3) {
if (to.meta.doctorAuth) {
utils.getDoctorAuth(router).then(resAuth => {
if (resAuth == 3) {
next()
} else {
next(false)
return
}
})
return
}
next();
} else {
next({ path: "/home" });
return
}
})
return
}
next()
});
// 加入混合
......
此差异已折叠。
......@@ -3,13 +3,6 @@
*/
export const envConfig = {
development: {
// // baseUrl: 'http://10.177.15.180:10202/',
// // baseUrl: 'http://192.168.140.14:10201/',
// baseUrl: 'https://test1-sc.yunqueyi.com/',
// baseUrl: 'https://uat-sc.yunqueyi.com/',
// baseUrl: 'http://10.177.15.150:10401/',
// baseUrl: 'http://10.177.15.150:11905/',
baseUrl: 'https://dev-sc.yunqueyi.com/',
// baseUrl: 'https://test1-sc.yunqueyi.com/',
// baseUrl: 'https://sc.yunqueyi.com/',
......
......@@ -2,7 +2,7 @@ import fetch from '../fetch';
import { getBaseUrl } from '@/utils/index'
let headers = {
'Content-Type': 'application/json;charset=UTF-8',
token: localStorage.getItem('storageToken'),
token: localStorage.getItem('storageToken'),
};
export const getGoodsList = (params) => {
return fetch({
......@@ -23,13 +23,13 @@ export const getGoodDetails = (goodsId) => {
}
export const uploadExcel = data => {
// return utils.checkAuth(()=>{
return fetch({
headers,
url: getBaseUrl(`store/goods/import`),
method: 'post',
data: data,
description: '上传excel文件',
})
return fetch({
headers,
url: getBaseUrl(`store/goods/import`),
method: 'post',
data: data,
description: '上传excel文件',
})
// })
}
//
......@@ -213,11 +213,21 @@ export const getGoodsListAll = (params) => {
});
};
// 条形码获取信息
export const getBarcodeData =(barCode) => {
export const getBarcodeData = (barCode) => {
return fetch({
headers,
url: getBaseUrl(`store/admin/medical/queryByBarcode/${barCode}`),
method: "get",
description: "条形码获取信息",
});
}
\ No newline at end of file
}
export const getGoodsStock = (params) => {
return fetch({
headers,
url: getBaseUrl('store/qianfang/storage/queryStorageStock'),
method: "get",
params,
description: "查询药品库存",
});
};
\ No newline at end of file
此差异已折叠。
......@@ -32,6 +32,7 @@ const form = {
saleType: 1,
minWhole: 1,
expressLimitFlag: 0, //是否支持退货退款
availableStock: "",
};
const form3 = {
......
......@@ -959,7 +959,7 @@ import {
getMedList,
saveMedList,
updateGoods,
updateStock,
getGoodsStock,
} from "@/utils/goods";
import { isEmptyUtils } from "@/utils/index";
import { createFilePath, doUpload, getFilePath } from "@/utils/qiniu-util";
......@@ -1617,7 +1617,6 @@ export default {
},
updateStock() {
let r = /^\+?[1-9][0-9]*$/;
//造假 接口来了删掉
if (this.stock.num <= 0) {
return this.$message({
message: "增加库存数量不得为0",
......@@ -1642,6 +1641,16 @@ export default {
this.formData.decrStock = Number(this.stock.num);
this.formData.incrStock = "";
} else if (this.stock.type == 2) {
if (
this.formData3.availableStock > 0 &&
this.formData3.availableStock <
this.formData.goodsStock + this.stock.num
) {
return this.$message({
message: `最大可用库存:${this.formData3.availableStock}`,
type: "warning",
});
}
this.formData.stock =
Number(this.stock.num) + Number(this.formData.goodsStock);
this.formData.incrStock = Number(this.stock.num);
......@@ -1664,6 +1673,24 @@ export default {
num: "",
placeholderTxt: txt,
};
if (this.formData3.medicationId) {
getGoodsStock({
medicationId: this.formData3.medicationId,
medicationDetailId: this.formData3.medicationDetailId,
})
.then((res) => {
if (res.code != "000000") {
return this.$message({
message: res.message,
type: "error",
});
}
this.formData.availableStock = res.data;
})
.catch((err) => {
console.log(err);
});
}
this.stockDio = true;
},
complete() {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册