Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
9d32f836
提交
9d32f836
编写于
11月 12, 2020
作者:
tao.wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改bug
上级
84ba7c43
变更
3
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
100 行增加
和
108 行删除
+100
-108
create-good.vue
src/views/goods/create-good.vue
+91
-103
forms.js
src/views/goods/forms.js
+5
-5
rules.js
src/views/goods/rules.js
+4
-0
未找到文件。
src/views/goods/create-good.vue
浏览文件 @
9d32f836
...
@@ -114,7 +114,7 @@
...
@@ -114,7 +114,7 @@
v-model=
"formData1.barCode"
v-model=
"formData1.barCode"
placeholder=
"请输入条形码"
placeholder=
"请输入条形码"
></el-input>
></el-input>
<span
class=
"fast-opt"
@
click=
"fastInput"
>
快速录入
</span>
<span
class=
"fast-opt"
@
click=
"fastInput
(1)
"
>
快速录入
</span>
<span
class=
"word-num"
>
(点击可快速录入下面的药品信息)
</span>
<span
class=
"word-num"
>
(点击可快速录入下面的药品信息)
</span>
</el-col>
</el-col>
</el-form-item>
</el-form-item>
...
@@ -409,8 +409,8 @@
...
@@ -409,8 +409,8 @@
v-model=
"formData2.barCode"
v-model=
"formData2.barCode"
placeholder=
"请输入条形码"
placeholder=
"请输入条形码"
></el-input>
></el-input>
<
span
class=
"fast-opt"
@
click=
"fastInput
"
>
快速录入
</span>
<
!--
<span
class=
"fast-opt"
@
click=
"fastInput(2)
"
>
快速录入
</span>
<span
class=
"word-num"
>
(点击可快速录入下面的药品信息)
</span>
<span
class=
"word-num"
>
(点击可快速录入下面的药品信息)
</span>
-->
</el-col>
</el-col>
</el-form-item>
</el-form-item>
<!--
<el-form-item
label=
"检测登记表"
prop=
"checkPackageId"
>
<!--
<el-form-item
label=
"检测登记表"
prop=
"checkPackageId"
>
...
@@ -786,6 +786,7 @@
...
@@ -786,6 +786,7 @@
rules
:
{},
rules
:
{},
rules1
:
{},
rules1
:
{},
rules2
:
{},
rules2
:
{},
goodsId
:
0
,
// 新增时传0,更新时必需>0
// 不同类型服务的表单通用字段
// 不同类型服务的表单通用字段
// 不同类型服务的表单通用字段
// 不同类型服务的表单通用字段
// 不同类型服务的表单通用字段
// 不同类型服务的表单通用字段
...
@@ -844,25 +845,14 @@
...
@@ -844,25 +845,14 @@
this
.
allDeparts
=
res
.
data
this
.
allDeparts
=
res
.
data
})
})
if
(
id
!=
'add'
){
if
(
id
!=
'add'
){
// let goods = Object.assign(this.goodsInfo,{})
// this.formData = {...goods}
// console.log(goods)
this
.
formData
.
goodsId
=
id
;
this
.
getDetailByEdit
(
id
,
goodsType
);
this
.
getDetailByEdit
(
id
,
goodsType
);
}
}
},
},
methods
:
{
methods
:
{
//eidt状态
//eidt状态
getDetailByEdit
(
id
,
goodsType
){
async
getDetailByEdit
(
id
,
goodsType
){
let
parm
=
{
this
.
goodsId
=
id
;
goodsIdList
:[
id
],
goodsName
:
''
,
goodsType
:
''
,
pageNo
:
1
,
pageSize
:
10
,
}
// this.isMedic = this.formData.goodsType == 5 ? true : false
// this.isMedic = this.formData.goodsType == 5 ? true : false
// this.isCheckServe = this.formData.goodsType == 337 ? true : false
// this.isCheckServe = this.formData.goodsType == 337 ? true : false
if
(
goodsType
==
5
){
if
(
goodsType
==
5
){
...
@@ -872,7 +862,8 @@
...
@@ -872,7 +862,8 @@
}
}
if
(
goodsType
==
337
){
if
(
goodsType
==
337
){
getGoodDetails
(
id
).
then
((
res
)
=>
{
const
res
=
await
getGoodDetails
(
id
);
console
.
log
(
`========================>`
,
res
);
console
.
log
(
`========================>`
,
res
);
if
(
res
.
code
!=
'000000'
){
if
(
res
.
code
!=
'000000'
){
return
this
.
$message
({
return
this
.
$message
({
...
@@ -891,10 +882,11 @@
...
@@ -891,10 +882,11 @@
this
.
formData1
=
goodsInfo
;
this
.
formData1
=
goodsInfo
;
this
.
formData2
=
medicalService
;
this
.
formData2
=
medicalService
;
// this.formData = Object.assign(goodsInfo, medicalService);
// this.formData = Object.assign(goodsInfo, medicalService);
this
.
formData
=
{
...
goodsInfo
,
...
medicalService
};
this
.
formData
=
{
...
this
.
formData
,
...
goodsInfo
,
...
medicalService
};
this
.
formData
.
suitableArr
=
this
.
formData
.
suitable
.
split
(
','
);
this
.
formData2
.
suitableArr
=
this
.
formData
.
suitable
.
split
(
','
);
this
.
formData
.
optPrice
=
this
.
formData
.
costPrice
/
100
;
this
.
formData
.
optPrice
=
this
.
formData
.
costPrice
/
100
;
this
.
formData
.
stock
=
this
.
formData
.
goodsStock
;
this
.
formData
.
stock
=
this
.
formData
.
goodsStock
;
// this.formData.checkType;
// this.formData.checkType;
// this.formData.otc1 = this.formData.otc ? '1' : '0'
// this.formData.otc1 = this.formData.otc ? '1' : '0'
this
.
fileGoodsList
=
this
.
getImges
(
goodsInfo
.
goodsHeaderImages
,
1
);
this
.
fileGoodsList
=
this
.
getImges
(
goodsInfo
.
goodsHeaderImages
,
1
);
...
@@ -906,10 +898,14 @@
...
@@ -906,10 +898,14 @@
};
};
});
}
else
{
}
else
{
getGoodsList
(
parm
).
then
((
res
)
=>
{
const
res
=
await
getGoodsList
({
goodsIdList
:[
id
],
goodsName
:
''
,
goodsType
:
''
,
pageNo
:
1
,
pageSize
:
10
,
});
if
(
res
.
code
!=
'000000'
){
if
(
res
.
code
!=
'000000'
){
return
this
.
$message
({
return
this
.
$message
({
message
:
res
.
message
,
message
:
res
.
message
,
...
@@ -950,8 +946,6 @@
...
@@ -950,8 +946,6 @@
...
originRules
...
originRules
};
};
});
}
}
console
.
log
(
this
.
formData
);
console
.
log
(
this
.
formData
);
...
@@ -977,9 +971,9 @@
...
@@ -977,9 +971,9 @@
},
},
//快速录入
//快速录入
fastInput
(){
fastInput
(
type
){
///medications/query/{approvalnumber}
///medications/query/{approvalnumber}
if
(
this
.
formData
.
barCode
==
''
){
if
(
this
.
formData
1
.
barCode
==
''
){
this
.
$refs
.
formData
.
validateField
(
"barCode"
)
this
.
$refs
.
formData
.
validateField
(
"barCode"
)
return
;
return
;
}
}
...
@@ -1094,7 +1088,6 @@
...
@@ -1094,7 +1088,6 @@
]
]
return
a
return
a
},
},
//获取分类
//获取分类
getLever
(
id
,
type
,
parm
){
getLever
(
id
,
type
,
parm
){
...
@@ -1199,21 +1192,17 @@
...
@@ -1199,21 +1192,17 @@
this
.
fileIntrList
[
j
].
imageSort
=
j
+
1
this
.
fileIntrList
[
j
].
imageSort
=
j
+
1
}
}
// this.formData.goodsHeaderImages = this.fileGoodsList;
// this.formData.specificationImages = this.fileIntrList;
// this.isgoodsImages = this.formData.goodsHeaderImages.length == 0 ? false :true;
// this.isSpecification_url = this.formData.specificationImages.length == 0 ? false : true
this
.
formData
.
categoryId
=
this
.
formData
.
goodsType
this
.
formData
.
categoryId
=
this
.
formData
.
goodsType
this
.
formData
.
otc
=
this
.
formData
.
otc1
==
1
?
true
:
false
this
.
formData
.
otc
=
this
.
formData
.
otc1
==
1
?
true
:
false
this
.
isgoodStock
=
this
.
formData
.
stock
>
0
?
true
:
false
this
.
isgoodStock
=
this
.
formData
.
stock
>
0
?
true
:
false
console
.
log
(
this
.
isgoodStock
);
this
.
formData
.
goodsId
=
this
.
goodsId
;
// console.log(this.isgoodStock);
this
.
formData
.
goodsImages
=
this
.
fileGoodsList
;
this
.
formData
.
goodsImages
=
this
.
fileGoodsList
;
this
.
formData
.
goodsHeaderImages
=
this
.
fileGoodsList
;
this
.
formData
.
goodsHeaderImages
=
this
.
fileGoodsList
;
this
.
formData
.
specificationImages
=
this
.
fileIntrList
;
this
.
formData
.
specificationImages
=
this
.
fileIntrList
;
this
.
isgoodsImages
=
this
.
formData
.
goodsImages
.
length
==
0
?
false
:
true
;
this
.
isgoodsImages
=
this
.
formData
.
goodsImages
.
length
==
0
?
false
:
true
;
// 如果是【药品】类型的商品
// 如果是【药品】类型的商品
if
(
this
.
isMedic
){
if
(
this
.
isMedic
){
if
(
!
this
.
isgoodsImages
){
if
(
!
this
.
isgoodsImages
){
return
;
return
;
}
}
...
@@ -1232,6 +1221,8 @@
...
@@ -1232,6 +1221,8 @@
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
//alert('submit!');
//alert('submit!');
this
.
formData
.
costPrice
=
this
.
formData
.
optPrice
*
100
this
.
formData
.
hasChanged
=
true
;
this
.
updateGoodsInfo
();
this
.
updateGoodsInfo
();
}
else
{
}
else
{
console
.
log
(
'error submit!!'
);
console
.
log
(
'error submit!!'
);
...
@@ -1241,10 +1232,7 @@
...
@@ -1241,10 +1232,7 @@
},
},
//更新商品
//更新商品
updateGoodsInfo
(){
updateGoodsInfo
(){
this
.
formData
.
costPrice
=
this
.
formData
.
optPrice
*
100
this
.
formData
.
hasChanged
=
true
;
console
.
log
(
'提交值'
,
this
.
formData
);
console
.
log
(
'提交值'
,
this
.
formData
);
const
submieFn
=
this
.
isCheckServe
?
updateGoodsV2
:
updateGoods
;
const
submieFn
=
this
.
isCheckServe
?
updateGoodsV2
:
updateGoods
;
submieFn
(
this
.
formData
).
then
((
res
)
=>
{
submieFn
(
this
.
formData
).
then
((
res
)
=>
{
if
(
res
.
code
!==
'000000'
)
{
if
(
res
.
code
!==
'000000'
)
{
...
...
src/views/goods/forms.js
浏览文件 @
9d32f836
...
@@ -24,12 +24,12 @@ const form2 = {
...
@@ -24,12 +24,12 @@ const form2 = {
hospitalName
:
''
,
hospitalName
:
''
,
hospitalType
:
''
,
hospitalType
:
''
,
hospitalId
:
0
,
hospitalId
:
0
,
goodsId
:
0
,
// 新增时传0,更新时必需>0
medicalServiceId
:
0
,
// 新增时传0,更新时必需>0
medicalServiceId
:
0
,
// 新增时传0,更新时必需>0
goodsCheckImages
:
[],
goodsCheckImages
:
[],
checkItem
:
''
,
checkItem
:
''
,
checkStandard
:
''
,
checkStandard
:
''
,
useCount
:
0
,
useCount
:
1
,
checkType
:
''
,
checkType
:
''
,
suitable
:
''
,
suitable
:
''
,
suitableStr
:
''
,
suitableStr
:
''
,
...
@@ -43,9 +43,8 @@ const form = {
...
@@ -43,9 +43,8 @@ const form = {
// categoryId:'',
// categoryId:'',
// otc:false,
// otc:false,
// discountPrice:'',
// discountPrice:'',
// stock:0,
// goodsStock:0,
// specificationImages:[],
// specificationImages:[],
// goodsId: 0, // 新增时传0,更新时必需>0
id
:
0
,
id
:
0
,
goodsName
:
''
,
goodsName
:
''
,
goodsDescription
:
''
,
goodsDescription
:
''
,
...
@@ -58,7 +57,8 @@ const form = {
...
@@ -58,7 +57,8 @@ const form = {
storeId
:
''
,
storeId
:
''
,
optPrice
:
''
,
optPrice
:
''
,
goodsStock
:
0
,
goodsStock
:
0
,
stock
:
0
stock
:
0
,
externalGoodsCode
:
''
};
};
...
...
src/views/goods/rules.js
浏览文件 @
9d32f836
...
@@ -23,6 +23,10 @@ const checkProjectStr = (rule, value, callback) => {
...
@@ -23,6 +23,10 @@ const checkProjectStr = (rule, value, callback) => {
};
};
const rules1 = {
const rules1 = {
barCode: [
{ required: true, message: "
请输入条形码
", trigger: "
submit
" },
{ validator: checkBarcode, trigger: "
submit
" }
],
medicCommonName:[
medicCommonName:[
{ required: true, message: "
请输入商品通用名称
", trigger: "
blur
" }
{ required: true, message: "
请输入商品通用名称
", trigger: "
blur
" }
],
],
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录