Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
29977bce
提交
29977bce
编写于
3月 17, 2022
作者:
shuang.zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
获取全部商品分类
上级
e18787c2
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
34 行增加
和
34 行删除
+34
-34
index.js
src/utils/goods/index.js
+11
-0
create-good-new.vue
src/views/goods/create-good-new.vue
+23
-34
未找到文件。
src/utils/goods/index.js
浏览文件 @
29977bce
...
@@ -201,3 +201,14 @@ export const saveMedList = (data) => {
...
@@ -201,3 +201,14 @@ export const saveMedList = (data) => {
});
});
};
};
// 获取商品分类 / store / commodity / categorys / cascade / listAll;
export
const
getGoodsListAll
=
(
params
)
=>
{
return
fetch
({
headers
,
url
:
getBaseUrl
(
`store/commodity/categorys/cascade/listAll`
),
method
:
"get"
,
params
,
description
:
"查询商品类别"
,
});
};
\ No newline at end of file
src/views/goods/create-good-new.vue
浏览文件 @
29977bce
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
<el-cascader
<el-cascader
size=
"small"
size=
"small"
ref=
"cascader"
ref=
"cascader"
:options=
"goodsCategoryList"
:props=
"cascaderProps"
:props=
"cascaderProps"
clearable
clearable
filterable
filterable
...
@@ -691,7 +692,7 @@
...
@@ -691,7 +692,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
,
getGoodsCascadeList
,
getMedList
,
getCategorysList
,
saveMedList
}
from
'@/utils/goods'
;
import
{
updateGoods
,
updateStock
,
getGoodsList
,
getGoodDetails
,
updateGoodsV2
,
getContractList
,
getCooperationProjectList
,
getMedList
,
getCategorysList
,
saveMedList
,
getGoodsListAll
}
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'
;
...
@@ -715,36 +716,10 @@
...
@@ -715,36 +716,10 @@
goodsCategoryIdList
:
[],
goodsCategoryIdList
:
[],
cascaderProps
:
{
cascaderProps
:
{
multiple
:
true
,
multiple
:
true
,
lazy
:
true
,
value
:
'id'
,
checkStrictly
:
true
,
label
:
'categoryName'
,
lazyLoad
:
(
node
,
resolve
)
=>
{
children
:
'children'
console
.
log
(
'lazyLoad'
,
node
);
// checkStrictly: true
const
{
level
,
root
,
value
}
=
node
;
console
.
log
(
'lazyLoad'
,
node
);
const
caLevel
=
level
+
1
;
const
params
=
{
parentId
:
0
,
categoryLevel
:
caLevel
};
if
(
!
root
)
{
params
.
parentId
=
value
;
params
.
categoryLevel
=
caLevel
;
}
getGoodsCascadeList
(
params
.
parentId
,
params
.
categoryLevel
).
then
((
res
)
=>
{
const
{
code
}
=
res
;
const
{
data
}
=
res
;
if
(
code
!==
'000000'
)
{
resolve
([]);
return
;
}
const
nodes
=
data
.
map
(
item
=>
({
value
:
item
.
id
,
label
:
item
.
categoryName
}));
// 通过调用resolve将子节点数据返回,通知组件数据加载完成
resolve
(
nodes
);
});
}
},
},
isNewMeddialog
:
false
,
// 新增药品弹窗
isNewMeddialog
:
false
,
// 新增药品弹窗
isSelectGoods
:
false
,
// 是否选择了添加药品
isSelectGoods
:
false
,
// 是否选择了添加药品
...
@@ -842,7 +817,8 @@
...
@@ -842,7 +817,8 @@
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
,
pageSize
:
10
,
totalRows
:
0
,
totalRows
:
0
,
isAddServe
:
false
// 新增药品时 添加的是否为服务类 || 虚拟商品
isAddServe
:
false
,
// 新增药品时 添加的是否为服务类 || 虚拟商品
goodsCategoryList
:
[]
}
}
},
},
computed
:
{
computed
:
{
...
@@ -884,8 +860,18 @@
...
@@ -884,8 +860,18 @@
if
(
this
.
formData
.
incrType
==
null
||
this
.
formData
.
incrType
===
''
)
{
if
(
this
.
formData
.
incrType
==
null
||
this
.
formData
.
incrType
===
''
)
{
this
.
formData
.
incrType
=
2
;
this
.
formData
.
incrType
=
2
;
}
}
this
.
getGoodsListAll
();
},
},
methods
:
{
methods
:
{
getGoodsListAll
()
{
getGoodsListAll
().
then
(
res
=>
{
if
(
res
.
code
==
'000000'
)
{
this
.
goodsCategoryList
=
res
.
data
;
console
.
log
(
this
.
goodsCategoryList
,
'goodsCategoryListgoodsCategoryList'
)
}
console
.
log
(
res
,
'getGoodsListAll'
)
})
},
// 取消
// 取消
cancelComplete
()
{
cancelComplete
()
{
this
.
$confirm
(
'取消后您填写的信息将不会被保存'
,
'确认取消吗?'
,
{
this
.
$confirm
(
'取消后您填写的信息将不会被保存'
,
'确认取消吗?'
,
{
...
@@ -1130,7 +1116,7 @@
...
@@ -1130,7 +1116,7 @@
});
});
}
}
const
{
goodsList
,
hasRepoFlag
}
=
res
.
data
;
const
{
goodsList
,
hasRepoFlag
}
=
res
.
data
;
const
{
goodsName
,
goodsDescription
,
goodsType
,
expressLimitFlag
,
goodsHeaderImages
=
[],
goodsVideoList
=
[],
contractId
,
cooperationProjectId
,
medicationId
,
goodsCategoryIdArr
:
goodsCategoryIdList
}
=
goodsList
[
0
];
const
{
goodsName
,
goodsDescription
,
goodsType
,
expressLimitFlag
,
goodsHeaderImages
=
[],
goodsVideoList
=
[],
contractId
,
cooperationProjectId
,
medicationId
,
goodsCategoryIdArr
}
=
goodsList
[
0
];
const
goodDet
=
goodsList
[
0
];
const
goodDet
=
goodsList
[
0
];
goodDet
.
otc1
=
goodDet
.
otc
?
'1'
:
'0'
;
goodDet
.
otc1
=
goodDet
.
otc
?
'1'
:
'0'
;
// 查询药品列表
// 查询药品列表
...
@@ -1140,7 +1126,10 @@
...
@@ -1140,7 +1126,10 @@
this
.
isContract
=
Boolean
(
contractId
);
this
.
isContract
=
Boolean
(
contractId
);
// this.formData1 = goodDet;
// this.formData1 = goodDet;
this
.
formData
=
goodDet
;
this
.
formData
=
goodDet
;
this
.
formData3
=
{
goodsName
,
goodsDescription
,
goodsHeaderImages
,
goodsVideoList
,
goodsType
,
expressLimitFlag
,
contractId
,
cooperationProjectId
,
goodsCategoryIdList
};
this
.
formData3
=
{
goodsName
,
goodsDescription
,
goodsHeaderImages
,
goodsVideoList
,
goodsType
,
expressLimitFlag
,
contractId
,
cooperationProjectId
,
};
const
arr
=
[[
40116
],[
40117
,
40118
,
40119
,
]]
this
.
formData3
.
goodsCategoryIdList
=
arr
;
console
.
log
(
this
.
formData3
.
goodsCategoryIdList
,
'this.formData3.goodsCategoryIdListthis.formData3.goodsCategoryIdList'
)
this
.
hasRepoFlag
=
hasRepoFlag
;
this
.
hasRepoFlag
=
hasRepoFlag
;
this
.
buyLimitDtoList
=
this
.
formData
.
buyLimitDtoList
;
this
.
buyLimitDtoList
=
this
.
formData
.
buyLimitDtoList
;
this
.
formData
.
optPrice
=
this
.
formData
.
costPrice
/
100
;
this
.
formData
.
optPrice
=
this
.
formData
.
costPrice
/
100
;
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录