edit
This commit is contained in:
parent
66c1a4a0c9
commit
a38eb84f1e
|
@ -96,7 +96,7 @@ export function cancelOrderStatusFilter(status) {
|
|||
|
||||
export function orderPayType(type) {
|
||||
const typeMap = {
|
||||
'0': '消费券支付',
|
||||
'0': '余额支付',
|
||||
'1': '微信支付',
|
||||
'2': '小程序',
|
||||
'3': '微信支付',
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
class="selWidth"
|
||||
@change="getList(1),getCardList()"
|
||||
>
|
||||
<el-option label="消费券" value="0" />
|
||||
<el-option label="余额" value="0" />
|
||||
<el-option label="微信" value="1" />
|
||||
<el-option label="支付宝" value="2" />
|
||||
<el-option label="铸源星" value="7" />
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option label="消费券" value="0" />
|
||||
<el-option label="余额" value="0" />
|
||||
<el-option label="微信" value="1" />
|
||||
<el-option label="支付宝" value="2" />
|
||||
<el-option label="铸源星" value="7" />
|
||||
|
|
|
@ -1007,26 +1007,21 @@
|
|||
controls-position="right"
|
||||
/>
|
||||
<el-input
|
||||
v-if="formThead[iii].title === '商品编号' || formThead[iii].title === '依据链接' || formThead[iii].title === '售价' || formThead[iii].title === '市场价'"
|
||||
v-if="isSpecification(iii)"
|
||||
v-model="scope.row[iii]"
|
||||
type="text"
|
||||
size="small"
|
||||
:disabled="virStatus&&(formThead[iii].title === '依据链接' || formThead[iii].title === '商品编号')"
|
||||
:disabled="isVirStatus(iii)"
|
||||
@input="handleCost(scope.row,iii,$event,'batchAdd')"
|
||||
class="priceBox"
|
||||
/>
|
||||
<el-input-number
|
||||
v-if="formThead[iii].title !== '付费会员价' &&
|
||||
formThead[iii].title !== '商品编号' &&
|
||||
formThead[iii].title !== '依据链接' &&
|
||||
formThead[iii].title !== '售价' &&
|
||||
formThead[iii].title !== '市场价' &&
|
||||
formThead[iii].title !== '库存'"
|
||||
v-if="isForbiddens(iii)"
|
||||
v-model="scope.row[iii]"
|
||||
:min="0"
|
||||
size="small"
|
||||
class="priceBox"
|
||||
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'"
|
||||
:disabled="isForbidden(iii)"
|
||||
controls-position="right"
|
||||
@blur="memberPrice(formThead[iii], scope.row)"
|
||||
/>
|
||||
|
@ -1048,7 +1043,7 @@
|
|||
</div>
|
||||
<div v-else>
|
||||
<el-input
|
||||
v-if="formThead[iii].title === '商品编号' || formThead[iii].title === '依据链接' || formThead[iii].title === '售价' || formThead[iii].title === '市场价'"
|
||||
v-if="isSpecification(iii)"
|
||||
v-model="scope.row[iii]"
|
||||
type="text"
|
||||
size="small"
|
||||
|
@ -1070,7 +1065,7 @@
|
|||
type="number"
|
||||
min="0"
|
||||
size="small"
|
||||
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'"
|
||||
:disabled="isForbidden(iii)"
|
||||
class="priceBox"
|
||||
controls-position="right"
|
||||
/>
|
||||
|
@ -1181,26 +1176,21 @@
|
|||
controls-position="right"
|
||||
/>
|
||||
<el-input
|
||||
v-if="formThead[iii].title === '商品编号' || formThead[iii].title === '依据链接' || formThead[iii].title === '售价' || formThead[iii].title === '市场价'"
|
||||
v-if="isSpecification(iii)"
|
||||
v-model="scope.row[iii]"
|
||||
type="text"
|
||||
size="small"
|
||||
:disabled="virStatus&&(formThead[iii].title === '依据链接' || formThead[iii].title === '商品编号')"
|
||||
:disabled="isVirStatus(iii)"
|
||||
@input="handleCost(scope.row,iii,$event)"
|
||||
class="priceBox"
|
||||
/>
|
||||
<el-input-number
|
||||
v-if="formThead[iii].title !== '付费会员价' &&
|
||||
formThead[iii].title !== '商品编号' &&
|
||||
formThead[iii].title !== '依据链接' &&
|
||||
formThead[iii].title !== '售价' &&
|
||||
formThead[iii].title !== '市场价' &&
|
||||
formThead[iii].title !== '库存'"
|
||||
v-if="isForbiddens(iii)"
|
||||
v-model="scope.row[iii]"
|
||||
:min="0"
|
||||
size="small"
|
||||
class="priceBox"
|
||||
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'"
|
||||
:disabled="isForbidden(iii)"
|
||||
controls-position="right"
|
||||
@blur="memberPrice(formThead[iii], scope.row)"
|
||||
/>
|
||||
|
@ -1223,11 +1213,11 @@
|
|||
|
||||
<div v-else>
|
||||
<el-input
|
||||
v-if="formThead[iii].title === '商品编号' || formThead[iii].title === '依据链接' || formThead[iii].title === '售价' || formThead[iii].title === '市场价'"
|
||||
v-if="isSpecification(iii)"
|
||||
v-model="scope.row[iii]"
|
||||
type="text"
|
||||
size="small"
|
||||
:disabled="virStatus&&(formThead[iii].title === '依据链接' || formThead[iii].title === '商品编号')"
|
||||
:disabled="isVirStatus(iii)"
|
||||
@input="handleCost(scope.row,iii,$event)"
|
||||
class="priceBox"
|
||||
/>
|
||||
|
@ -1237,7 +1227,7 @@
|
|||
:min="0"
|
||||
type="number"
|
||||
size="small"
|
||||
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'"
|
||||
:disabled="isForbidden(iii)"
|
||||
class="priceBox"
|
||||
controls-position="right"
|
||||
/>
|
||||
|
@ -1363,26 +1353,21 @@
|
|||
class="priceBox"
|
||||
/> -->
|
||||
<el-input
|
||||
v-if="formThead[iii].title === '商品编号' || formThead[iii].title === '依据链接' || formThead[iii].title === '售价' || formThead[iii].title === '市场价'"
|
||||
v-if="isSpecification(iii)"
|
||||
v-model="scope.row[iii]"
|
||||
type="text"
|
||||
size="small"
|
||||
:disabled="virStatus&&(formThead[iii].title === '依据链接' || formThead[iii].title === '商品编号')"
|
||||
:disabled="isVirStatus(iii)"
|
||||
@input="handleCost(scope.row,iii,$event)"
|
||||
class="priceBox"
|
||||
/>
|
||||
<el-input-number
|
||||
v-if="formThead[iii].title !== '付费会员价' &&
|
||||
formThead[iii].title !== '商品编号' &&
|
||||
formThead[iii].title !== '依据链接' &&
|
||||
formThead[iii].title !== '售价' &&
|
||||
formThead[iii].title !== '市场价' &&
|
||||
formThead[iii].title !== '库存'"
|
||||
v-if="isForbiddens(iii)"
|
||||
v-model="scope.row[iii]"
|
||||
:min="0"
|
||||
size="small"
|
||||
class="priceBox"
|
||||
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'"
|
||||
:disabled="isForbidden(iii)"
|
||||
controls-position="right"
|
||||
@blur="memberPrice(formThead[iii], scope.row)"
|
||||
/>
|
||||
|
@ -1411,12 +1396,12 @@
|
|||
class="priceBox"
|
||||
/> -->
|
||||
<el-input
|
||||
v-if="formThead[iii].title === '商品编号' || formThead[iii].title === '依据链接' || formThead[iii].title === '售价' || formThead[iii].title === '市场价'"
|
||||
v-if="isSpecification(iii)"
|
||||
v-model="scope.row[iii]"
|
||||
type="text"
|
||||
size="small"
|
||||
:class="scope.row[iii]"
|
||||
:disabled="virStatus&&(formThead[iii].title === '依据链接' || formThead[iii].title === '商品编号')"
|
||||
:disabled="isVirStatus(iii)"
|
||||
@input="handleCost(scope.row,iii,$event)"
|
||||
class="priceBox"
|
||||
/>
|
||||
|
@ -1435,7 +1420,7 @@
|
|||
type="number"
|
||||
size="small"
|
||||
class="priceBox"
|
||||
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'"
|
||||
:disabled="isForbidden(iii)"
|
||||
controls-position="right"
|
||||
/>
|
||||
</div>
|
||||
|
@ -2637,6 +2622,25 @@ export default {
|
|||
window.removeEventListener('popstate', this.goBack, false)
|
||||
},
|
||||
methods: {
|
||||
// 输入的联动的
|
||||
isSpecification(iii){
|
||||
let arr = ['商品编号','依据链接','售价','市场价']
|
||||
return arr.includes(this.formThead[iii].title)
|
||||
},
|
||||
// 审核后禁止编辑
|
||||
isVirStatus(iii){
|
||||
let arr = ['依据链接','商品编号']
|
||||
return this.virStatus&&arr.includes(this.formThead[iii].title)
|
||||
},
|
||||
isForbidden(iii){
|
||||
let arr = ['成本价','占比','成长值']
|
||||
let forbidden = ['库存','重量(KG)','体积(m³)']
|
||||
return arr.includes(this.formThead[iii].title) || (this.virStatus&&forbidden.includes(this.formThead[iii].title))
|
||||
},
|
||||
isForbiddens(iii){
|
||||
let arr = ['付费会员价','商品编号','依据链接','售价','市场价','库存']
|
||||
return !arr.includes(this.formThead[iii].title)
|
||||
},
|
||||
onsubmit(){
|
||||
this.dialogVisible = false
|
||||
},
|
||||
|
|
|
@ -169,7 +169,7 @@
|
|||
<template slot-scope="scope">
|
||||
<a
|
||||
v-if="formThead[iii].title == '依据链接'"
|
||||
:href="scope.row[iii]"
|
||||
:href="isValidURL(scope.row[iii])"
|
||||
target="_blank"
|
||||
>{{ scope.row[iii] }}</a
|
||||
>
|
||||
|
@ -208,7 +208,7 @@
|
|||
<template slot-scope="scope">
|
||||
<a
|
||||
v-if="formThead[iii].title == '依据链接'"
|
||||
:href="scope.row[iii]"
|
||||
:href="isValidURL(scope.row[iii])"
|
||||
target="_blank"
|
||||
>{{ scope.row[iii] }}</a
|
||||
>
|
||||
|
@ -857,6 +857,15 @@ export default {
|
|||
filters: {
|
||||
},
|
||||
methods: {
|
||||
isValidURL(url) {
|
||||
// (http|https):\/\/([\w.]+\/?)\S*
|
||||
var pattern = /^(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;
|
||||
if(!pattern.test(url)){
|
||||
return `https://${url}`
|
||||
}
|
||||
return url
|
||||
// return pattern.test(url);
|
||||
},
|
||||
getType(val){
|
||||
var regex = /(?:\.([^.]+))?$/;
|
||||
let suffix = regex.exec(val.url)[1]
|
||||
|
|
Loading…
Reference in New Issue