Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
60d3d7c3
提交
60d3d7c3
编写于
11月 08, 2021
作者:
lyf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加业务类型
上级
b4b0fb05
变更
5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
72 行增加
和
121 行删除
+72
-121
env-config.js
src/utils/env-config.js
+1
-1
index.js
src/utils/goods/index.js
+11
-0
create-good.vue
src/views/goods/create-good.vue
+57
-120
forms.js
src/views/goods/forms.js
+1
-0
rules.js
src/views/goods/rules.js
+2
-0
未找到文件。
src/utils/env-config.js
浏览文件 @
60d3d7c3
...
...
@@ -10,7 +10,7 @@ export const envConfig = {
// baseUrl: 'https://uat-sc.yunqueyi.com/',
// baseUrl: 'http://10.177.15.150:10401/',
// baseUrl: 'http://10.177.15.150:11905/',
baseUrl
:
'https://sc.yunqueyi.com/'
,
baseUrl
:
'https://
dev-
sc.yunqueyi.com/'
,
// baseUrl: 'https://test1-sc.yunqueyi.com/',
// baseUrl: 'https://sc.yunqueyi.com/',
// baseUrl: 'https://uat-sc.yunqueyi.com/',
...
...
src/utils/goods/index.js
浏览文件 @
60d3d7c3
...
...
@@ -133,3 +133,14 @@ export const getTypeCodeList = () => {
});
};
export
const
getBusinessCategory
=
()
=>
{
return
fetch
({
headers
,
url
:
getBaseUrl
(
`store/category/businessCategory/0`
),
method
:
"get"
,
description
:
"查询业务类型"
,
});
};
src/views/goods/create-good.vue
浏览文件 @
60d3d7c3
...
...
@@ -45,8 +45,7 @@
maxlength=
"40"
show-word-limit
></el-input>
<span
class=
"word-tip"
>
此文案可摘取药品说明书【功能主治】or【适应症】
</span>
<!--
<span
class=
"word-num"
>
{{
(
formData
.
goodsDescription
).
replace
(
/
\s
+/g
,
""
).
length
}}
/1000
</span>
-->
<span
class=
"word-tip"
>
此文案可摘取药品说明书【功能主治】or【适应症】
</span>
</el-col>
</el-form-item>
...
...
@@ -59,7 +58,7 @@
:before-upload=
"beforeUploadPic"
multiple
:on-exceed=
"imgExceed"
:limit=
"6"
:limit=
"6"
>
<div
class=
"file-pics"
v-if=
"fileGoodsList.length > 0"
:key=
"index"
v-for=
"(item,index) in fileGoodsList"
>
<img
:src=
"item.url"
@
mouseover
.
stop=
"headIndex=index"
class=
"bg-img"
/>
...
...
@@ -92,27 +91,40 @@
:show-file-list=
"false"
:disabled=
"videoList.length == 1"
:limit=
"1"
action=
"#"
class=
"bg-uploader"
action=
"#"
class=
"bg-uploader"
>
<video
id=
"introVideoLecture"
:src=
"videoModel.videoFullPath"
controls
preload
style=
"width: 100%;"
v-if=
"videoList.length == 1"
>
视频
</video>
</video>
<img
class=
"bg-img"
src=
"../../assets/image/video.png"
v-if=
"videoList.length
<1
"
/>
<div
class=
"limit-text"
v-if=
"videoList.length
<1
"
>
<p>
建议大小:20M以内
</p>
<p>
仅支持MP4格式
</p>
<P>
视频名称必须包含3个下划线:举例(YQ_01_02_03.mp4)
</P>
</div>
<p>
仅支持MP4格式
</p>
<P>
视频名称必须包含3个下划线:举例(YQ_01_02_03.mp4)
</P>
</div>
</el-upload>
<el-progress
:text-inside=
"true"
:stroke-width=
"16"
:percentage=
"uploadProgress"
status=
"success"
class=
"video-progress"
v-show=
"uploadProgress>0&&uploadProgress
<100
"
>
</el-progress>
<el-button
class=
"dl-video"
icon=
"el-icon-delete"
circle
@
click=
"deleteVideo"
v-if=
"videoList.length == 1"
></el-button>
</el-form-item>
<el-form-item
label=
"业务类型"
prop=
"businessCategoryId"
>
<el-select
v-model=
"formData3.businessCategoryId"
placeholder=
"请选择业务类型"
size=
"small"
>
<el-option
v-for=
"item in businessCategoryList"
:key=
"item.id"
:label=
"item.categoryName"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"商品类型"
prop=
"goodsType"
>
<el-select
v-model=
"formData3.goodsType"
...
...
@@ -128,6 +140,8 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"是否支持售后"
prop=
"expressLimitFlag"
v-if=
"storeType
<
3
"
>
<el-radio-group
v-model=
"formData3.expressLimitFlag"
:disabled=
"!hasRepoFlag"
>
<el-radio
:label=
"1"
>
是
</el-radio>
...
...
@@ -135,7 +149,7 @@
</el-radio-group>
<p
class=
"backTip"
v-if=
"!hasRepoFlag"
@
click=
"goShopDeatil"
>
若需设置商品支持售后,需先至店铺页
<span
class=
"ad-back"
>
设置售后地址
</span></p>
</el-form-item>
</div>
</el-form>
...
...
@@ -628,18 +642,6 @@
format=
"yyyy-MM-dd HH:mm:ss"
></el-date-picker>
</el-form-item>
<!--
<el-form-item
label=
"商品使用日期"
prop=
"endTime"
>
<el-col
:span=
"13"
>
<el-input
size=
"small"
v-model=
"formData2.endTime"
placeholder=
"请输入商品使用日期"
style=
"width:70%;"
></el-input>
<span
class=
"word-num"
></span>
</el-col>
</el-form-item>
-->
<el-form-item
label=
"检测说明"
>
<el-upload
:file-list=
"goodsCheckList"
...
...
@@ -707,44 +709,19 @@
<el-radio
:label=
"1"
>
零售
</el-radio>
<el-radio
:label=
"2"
:disabled=
"commissionFlag == 1"
>
批发
</el-radio>
</el-radio-group>
<!--
<el-select-->
<!-- v-model="formData.saleType"-->
<!-- placeholder="请选择销售方式"-->
<!-- size="small"-->
<!-- @change="getSaleType(formData.saleType,2)">-->
<!--
<el-option-->
<!-- v-for="item in saleTypeList"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- >
</el-option>
-->
<!--
</el-select>
-->
</el-form-item>
</div>
<div
class=
"inline"
v-if=
"formData.saleType == 1"
>
<el-form-item
label=
"零售价"
prop=
"optPrice"
>
<el-col
:span=
"20"
>
<!--
<el-input-->
<!-- @input="$forceUpdate();"-->
<!-- size="small"-->
<!-- v-model="formData.optPrice"-->
<!-- placeholder="请输入零售价"-->
<!-- >
</el-input>
-->
<el-input-number
class=
"stock-com"
@
input=
"$forceUpdate();"
v-model=
"formData.optPrice"
size=
"small"
:precision=
"2"
:min=
"0.00"
:max=
"99999.99"
></el-input-number>
<!--
<span
class=
"word-num"
>
{{
(
formData
.
name
).
replace
(
/
\s
+/g
,
""
).
length
}}
/60
</span>
-->
</el-col>
</el-form-item>
</div>
<div
class=
"inline"
v-if=
"formData.saleType == 2"
>
<el-form-item
label=
"批发价"
prop=
"optPrice"
>
<el-col
:span=
"20"
>
<!--
<el-input-->
<!-- @input="$forceUpdate();"-->
<!-- size="small"-->
<!-- v-model="formData.optPrice"-->
<!-- placeholder="请输入批发价">
</el-input>
-->
<el-input-number
class=
"stock-com"
@
input=
"$forceUpdate();"
v-model=
"formData.optPrice"
size=
"small"
:precision=
"2"
:min=
"0"
:max=
"99999.99"
></el-input-number>
</el-col>
</el-form-item>
...
...
@@ -758,14 +735,6 @@
<span
class=
"sp sp-r"
@
click=
"changeStock(2)"
><i
class=
"el-icon-plus"
></i></span>
</div>
<p
class=
"error-message"
v-if=
"!isgoodStock"
>
库存不能为0
</p>
<!--
<el-input
size=
"small"
v-model=
"formData.name"
placeholder=
"请输入库存"
></el-input>
-->
<!--
<el-input-number
readonly
size=
"small"
v-model=
"formData.stock"
></el-input-number>
-->
<!--
<span
class=
"word-num"
>
{{
(
formData
.
name
).
replace
(
/
\s
+/g
,
""
).
length
}}
/60
</span>
-->
</el-col>
</el-form-item>
</div>
...
...
@@ -774,10 +743,7 @@
<el-form-item
label=
"最小起购件数"
prop=
"leastCount"
class=
"required-label"
>
<el-col
:span=
"20"
>
<div
class=
"stock-com"
style=
"width: 500px;display:flex"
>
<el-input-number
class=
"stock-com"
@
input=
"$forceUpdate();"
v-model=
"formData.leastCount"
size=
"small"
:precision=
"0"
:min=
"0"
:max=
"9999"
></el-input-number>
<!--
<span
class=
"sp sp-l"
@
click=
"minusCount(1)"
><i
class=
"el-icon-minus"
></i></span>
<span
class=
"sp sp-c"
>
{{
formData
.
leastCount
}}
</span>
<span
class=
"sp sp-r"
@
click=
"plusCount(1)"
><i
class=
"el-icon-plus"
></i></span>
-->
<el-input-number
class=
"stock-com"
@
input=
"$forceUpdate();"
v-model=
"formData.leastCount"
size=
"small"
:precision=
"0"
:min=
"0"
:max=
"9999"
></el-input-number>
<span
class=
"word-num"
style=
"margin-left: 10px;"
>
最高9999件哦
</span>
</div>
<p
class=
"error-message"
v-if=
"formData.leastCount
<
=
0
"
>
最小起购件数不能为0
</p>
...
...
@@ -799,18 +765,12 @@
<el-col
:span=
"20"
style=
"width: 300%;"
>
<div
class=
"stock-com"
style=
"width: 500px;display:flex"
>
<el-input-number
class=
"stock-com"
@
input=
"$forceUpdate();"
v-model=
"formData.mostCount"
size=
"small"
:precision=
"0"
:min=
"-1"
:max=
"9999"
></el-input-number>
<!--
<span
class=
"sp sp-l"
@
click=
"minusCount(2)"
><i
class=
"el-icon-minus"
></i></span>
<span
class=
"sp sp-c"
>
{{
formData
.
mostCount
}}
</span>
<span
class=
"sp sp-r"
@
click=
"plusCount(2)"
><i
class=
"el-icon-plus"
></i></span>
-->
<span
class=
"word-num"
style=
"margin-left: 10px;"
>
数值为-1时,代表单次购买上限已无限制(最高9999件哦)
</span>
</div>
<p
class=
"error-message"
v-if=
"formData.mostCount === 0"
>
单次购买上限不能为0
</p>
<!--
<p
class=
"error-message"
v-if=
"formData.mostCount
<
=
-1
"
>
单次购买上限已无限制
</p>
-->
</el-col>
</el-form-item>
</div>
<div
class=
"inline"
v-if=
"formData.saleType == 1"
>
<el-form-item
label=
"第三方商品编码"
>
<el-col
:span=
"20"
>
...
...
@@ -836,16 +796,6 @@
</div>
</div>
<!--
</el-form>
-->
<!--
<el-form-->
<!-- ref="formData"-->
<!-- :model="formData"-->
<!-- :rules="rules"-->
<!-- label-width="150px"-->
<!-- label-suffix=":"-->
<!-- class="basic-form"-->
<!-- >-->
<div
class=
"basic-item-icon"
v-if=
"formData.saleType == 1"
>
<div
class=
"part-tit"
>
限购条件
</div>
<div
v-for=
"(item, index) in buyLimitDtoList"
:key=
"index"
>
...
...
@@ -901,7 +851,6 @@
</div>
<span
slot=
"footer"
class=
"dialog-footer"
style=
"text-align: right;"
>
<!--
<el-button
@
click=
"centerDialogVisible = false"
>
取 消
</el-button>
-->
<el-button
type=
"primary"
@
click=
"updateStock"
>
完成
</el-button>
</span>
</el-dialog>
...
...
@@ -914,7 +863,7 @@
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
{
isEmptyUtils
}
from
"@/utils/index"
;
import
{
doUpload
,
getFilePath
,
createFilePath
}
from
"../../utils/qiniu-util"
;
import
{
updateGoods
,
updateStock
,
dosageAll
,
getDeparts
,
getGoodsList
,
getGoodDetails
,
updateGoodsV2
,
getHospitalInfoByStoreId
,
getCheckPackageIdList
,
getTypeCodeList
}
from
'@/utils/goods'
;
import
{
updateGoods
,
updateStock
,
dosageAll
,
getDeparts
,
getGoodsList
,
getGoodDetails
,
updateGoodsV2
,
getHospitalInfoByStoreId
,
getCheckPackageIdList
,
getTypeCodeList
,
getBusinessCategory
}
from
'@/utils/goods'
;
import
{
getStoreAdressRepot
}
from
"@/utils/shop"
;
import
Cropper
from
'@/components/common/cropper.vue'
import
{
originRules1
,
originRules2
,
originRules
,
originRules3
}
from
'./rules'
;
...
...
@@ -1055,12 +1004,13 @@
videoModel
:{
videoFullPath
:
''
},
businessCategoryList
:[],
sumFile
:
0
,
uploadProgress
:
0
,
// 上传视频进度条
}
},
computed
:
{
idMedicEdit
()
{
idMedicEdit
()
{
return
this
.
isEdit
&&
!
this
.
isCheckServe
;;
}
},
...
...
@@ -1088,6 +1038,7 @@
this
.
curmbThird
=
this
.
title
;
this
.
formData
.
storeId
=
Number
(
storeId
)
||
''
;
this
.
getTypeCodeList
();
this
.
getBusinessCategory
();
this
.
getLever
(
0
,
1
)
dosageAll
().
then
((
res
)
=>
{
this
.
doseAll
=
res
.
data
...
...
@@ -1120,8 +1071,16 @@
}
},
methods
:
{
// 获取业务类型
getBusinessCategory
(){
getBusinessCategory
().
then
((
res
)
=>
{
if
(
res
.
code
==
'000000'
)
{
this
.
businessCategoryList
=
res
.
data
}
}).
catch
((
err
)
=>
{})
},
// 判断imgurl是否有效
checkImgExists
(
imgurl
)
{
checkImgExists
(
imgurl
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
ImgObj
=
new
Image
()
ImgObj
.
src
=
imgurl
...
...
@@ -1169,12 +1128,12 @@
};
const
{
goodsInfo
,
medicalService
,
buyLimitDtoList
,
hasRepoFlag
}
=
res
.
data
;
const
{
goodsName
,
goodsDescription
,
goodsType
,
expressLimitFlag
,
goodsHeaderImages
=
[],
goodsVideoList
=
[]
}
=
goodsInfo
;
const
{
goodsName
,
goodsDescription
,
goodsType
,
businessCategoryId
,
expressLimitFlag
,
goodsHeaderImages
=
[],
goodsVideoList
=
[]
}
=
goodsInfo
;
this
.
formData
=
{...
this
.
formData
,
...
goodsInfo
};
this
.
formData2
=
medicalService
;
this
.
formData
=
{
...
this
.
formData
,
...
this
.
formData2
};
this
.
formData3
=
{
goodsName
,
goodsDescription
,
goodsHeaderImages
,
goodsVideoList
,
goodsType
,
expressLimitFlag
};
this
.
formData3
=
{
goodsName
,
goodsDescription
,
goodsHeaderImages
,
goodsVideoList
,
goodsType
,
businessCategoryId
,
expressLimitFlag
};
this
.
buyLimitDtoList
=
buyLimitDtoList
;
this
.
hasRepoFlag
=
hasRepoFlag
;
this
.
$set
(
this
.
formData2
,
'suitableArr'
,
this
.
formData
.
suitable
.
split
(
','
));
...
...
@@ -1185,14 +1144,14 @@
this
.
goodsCheckList
=
this
.
getImges
(
medicalService
.
goodsCheckImages
,
goodsType
);
if
(
goodsInfo
.
goodsVideoList
.
length
>
0
)
{
this
.
videoList
.
push
(
goodsInfo
.
goodsVideoList
[
0
]);
this
.
videoModel
.
videoFullPath
=
this
.
videoList
[
0
].
goodsImgUrl
;
this
.
videoModel
.
videoFullPath
=
this
.
videoList
[
0
].
goodsImgUrl
;
}
let
newImgList
=
[];
this
.
fileGoodsList
.
map
((
item
,
index
)
=>
{
this
.
checkImgExists
(
item
.
imageUrl
).
then
(()
=>
{
newImgList
.
push
(
item
)
}).
catch
(()
=>
{
newImgList
=
this
.
fileGoodsList
.
splice
(
index
,
1
);
newImgList
=
this
.
fileGoodsList
.
splice
(
index
,
1
);
})
})
this
.
fileGoodsList
=
newImgList
;
...
...
@@ -1225,13 +1184,13 @@
});
}
const
{
goodsList
,
hasRepoFlag
}
=
res
.
data
;
const
{
goodsName
,
goodsDescription
,
goodsType
,
expressLimitFlag
,
goodsHeaderImages
=
[],
goodsVideoList
=
[]
}
=
goodsList
[
0
];
const
{
goodsName
,
goodsDescription
,
goodsType
,
businessCategoryId
,
expressLimitFlag
,
goodsHeaderImages
=
[],
goodsVideoList
=
[]
}
=
goodsList
[
0
];
this
.
formData1
=
goodsList
[
0
];
this
.
formData
=
goodsList
[
0
];
this
.
formData3
=
{
goodsName
,
goodsDescription
,
goodsHeaderImages
,
goodsVideoList
,
goodsType
,
expressLimitFlag
};
this
.
formData3
=
{
goodsName
,
goodsDescription
,
goodsHeaderImages
,
goodsVideoList
,
goodsType
,
businessCategoryId
,
expressLimitFlag
};
this
.
hasRepoFlag
=
hasRepoFlag
;
this
.
buyLimitDtoList
=
this
.
formData
.
buyLimitDtoList
;
this
.
formData
.
optPrice
=
this
.
formData
.
costPrice
/
100
;
this
.
formData
.
optPrice
=
this
.
formData
.
costPrice
/
100
;
this
.
fileGoodsList
=
this
.
getImges
(
goodsList
[
0
].
goodsImgList
,
1
);
this
.
fileIntrList
=
this
.
getImges
(
goodsList
[
0
].
medicImgList
,
2
);
this
.
formData
.
stock
=
this
.
formData
.
goodsStock
;
...
...
@@ -1245,10 +1204,10 @@
this
.
checkImgExists
(
item
.
imageUrl
).
then
(()
=>
{
newImgList
.
push
(
item
)
}).
catch
(()
=>
{
newImgList
=
this
.
fileGoodsList
.
splice
(
index
,
1
);
newImgList
=
this
.
fileGoodsList
.
splice
(
index
,
1
);
})
})
this
.
fileGoodsList
=
newImgList
;
this
.
fileGoodsList
=
newImgList
;
if
(
this
.
isMedic
){
this
.
getLever
(
5
,
2
,
1
)
}
else
{
...
...
@@ -1370,31 +1329,9 @@
});
},
// 销售方式
getSaleType
(
saleType
,
type
){
},
getGoodsTypes
(
goodsType
,
type
){
this
.
goodsType
=
goodsType
;
// if(goodsType == 5){
// this.isMedic = true;
// this.isCheckServe = false;
// this.getLever(goodsType,type);
// } else if(goodsType == 337){
// this.isMedic = false;
// this.isCheckServe = true;
// getHospitalInfoByStoreId(this.storeId).then(({code,message,data})=>{
// this.formData2.hospitalName = data.hospital;
// })
// getCheckPackageIdList().then(res=>{
// console.log(`getCheckPackageIdList`, res);
// this.checkPackageIdList = res.data;
// })
// }else{
// this.isMedic = false;
// this.isCheckServe = false;
// };
if
(
goodsType
==
337
){
this
.
isMedic
=
false
;
this
.
isCheckServe
=
true
;
...
...
@@ -1525,7 +1462,7 @@
formNameList
=
[
'formData'
,
'formData2'
,
'formData3'
];
this
.
formData
=
{
...
this
.
formData
,
...
this
.
formData3
,...
this
.
formData2
};
}
else
{
formNameList
=
[
'formData'
,
'formData1'
,
'formData3'
];
this
.
formData
=
{
...
this
.
formData
,...
this
.
formData1
,...
this
.
formData3
};
}
...
...
@@ -1937,7 +1874,7 @@
}
else
{
this
.
$message
.
error
(
res
.
message
);
}
})
})
},
// 视频
deleteVideo
(
videoList
)
{
...
...
@@ -1954,7 +1891,7 @@
}
else
{
this
.
doVideoUpload
(
file
,
1
);
}
}
},
handleRemoveVideo
(
file
,
videoList
)
{
//console.log(this.videoList);
...
...
@@ -2021,7 +1958,7 @@
// let videoPath = createFilePath(file,file.name)
doUpload
(
self
,
file
,
self
.
videoModel
.
videoPath
,
"preview4"
,
"uploadProgress1"
,
""
).
then
(
function
(
result
)
{
""
).
then
(
function
(
result
)
{
console
.
log
(
'成功result'
,
result
);
self
.
videoModel
.
videoFullPath
=
result
.
fullPath
;
// self.model.size = result.size;
...
...
@@ -2037,10 +1974,10 @@
deleteFlag
:
0
}
self
.
videoList
.
push
(
fileItem
);
self
.
$message
.
success
(
'上传成功'
);
self
.
$message
.
success
(
'上传成功'
);
console
.
log
(
'sumFile'
,
self
.
sumFile
,
'videoList'
,
self
.
videoList
);
return
false
;
});
});
},
},
}
...
...
@@ -2308,5 +2245,5 @@
}
}
</
style
>
src/views/goods/forms.js
浏览文件 @
60d3d7c3
...
...
@@ -75,6 +75,7 @@ const form3 = {
goodsHeaderImages
:
[],
goodsVideoList
:
[],
goodsType
:
""
,
businessCategoryId
:
""
,
expressLimitFlag
:
0
,
//是否支持退货退款
};
...
...
src/views/goods/rules.js
浏览文件 @
60d3d7c3
...
...
@@ -124,6 +124,8 @@ const rules3 = {
goodsHeaderImages: [
{ required: true, message: "
请上传商品头图
", trigger: "
blur
" },
],
businessCategoryId: [{ required: true, message: "
请选择业务类型
", trigger: "
change
" }],
goodsType: [{ required: true, message: "
请选择商品类型
", trigger: "
change
" }],
};
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录