This commit is contained in:
faiz 2024-05-11 14:28:36 +08:00
parent 66c1a4a0c9
commit a38eb84f1e
5 changed files with 53 additions and 40 deletions

View File

@ -96,7 +96,7 @@ export function cancelOrderStatusFilter(status) {
export function orderPayType(type) { export function orderPayType(type) {
const typeMap = { const typeMap = {
'0': '消费券支付', '0': '余额支付',
'1': '微信支付', '1': '微信支付',
'2': '小程序', '2': '小程序',
'3': '微信支付', '3': '微信支付',

View File

@ -79,7 +79,7 @@
class="selWidth" class="selWidth"
@change="getList(1),getCardList()" @change="getList(1),getCardList()"
> >
<el-option label="消费券" value="0" /> <el-option label="余额" value="0" />
<el-option label="微信" value="1" /> <el-option label="微信" value="1" />
<el-option label="支付宝" value="2" /> <el-option label="支付宝" value="2" />
<el-option label="铸源星" value="7" /> <el-option label="铸源星" value="7" />

View File

@ -113,7 +113,7 @@
class="selWidth" class="selWidth"
@change="getList(1)" @change="getList(1)"
> >
<el-option label="消费券" value="0" /> <el-option label="余额" value="0" />
<el-option label="微信" value="1" /> <el-option label="微信" value="1" />
<el-option label="支付宝" value="2" /> <el-option label="支付宝" value="2" />
<el-option label="铸源星" value="7" /> <el-option label="铸源星" value="7" />

View File

@ -1007,26 +1007,21 @@
controls-position="right" controls-position="right"
/> />
<el-input <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]" v-model="scope.row[iii]"
type="text" type="text"
size="small" size="small"
:disabled="virStatus&&(formThead[iii].title === '依据链接' || formThead[iii].title === '商品编号')" :disabled="isVirStatus(iii)"
@input="handleCost(scope.row,iii,$event,'batchAdd')" @input="handleCost(scope.row,iii,$event,'batchAdd')"
class="priceBox" class="priceBox"
/> />
<el-input-number <el-input-number
v-if="formThead[iii].title !== '付费会员价' && v-if="isForbiddens(iii)"
formThead[iii].title !== '商品编号' &&
formThead[iii].title !== '依据链接' &&
formThead[iii].title !== '售价' &&
formThead[iii].title !== '市场价' &&
formThead[iii].title !== '库存'"
v-model="scope.row[iii]" v-model="scope.row[iii]"
:min="0" :min="0"
size="small" size="small"
class="priceBox" class="priceBox"
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'" :disabled="isForbidden(iii)"
controls-position="right" controls-position="right"
@blur="memberPrice(formThead[iii], scope.row)" @blur="memberPrice(formThead[iii], scope.row)"
/> />
@ -1048,7 +1043,7 @@
</div> </div>
<div v-else> <div v-else>
<el-input <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]" v-model="scope.row[iii]"
type="text" type="text"
size="small" size="small"
@ -1070,7 +1065,7 @@
type="number" type="number"
min="0" min="0"
size="small" size="small"
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'" :disabled="isForbidden(iii)"
class="priceBox" class="priceBox"
controls-position="right" controls-position="right"
/> />
@ -1181,26 +1176,21 @@
controls-position="right" controls-position="right"
/> />
<el-input <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]" v-model="scope.row[iii]"
type="text" type="text"
size="small" size="small"
:disabled="virStatus&&(formThead[iii].title === '依据链接' || formThead[iii].title === '商品编号')" :disabled="isVirStatus(iii)"
@input="handleCost(scope.row,iii,$event)" @input="handleCost(scope.row,iii,$event)"
class="priceBox" class="priceBox"
/> />
<el-input-number <el-input-number
v-if="formThead[iii].title !== '付费会员价' && v-if="isForbiddens(iii)"
formThead[iii].title !== '商品编号' &&
formThead[iii].title !== '依据链接' &&
formThead[iii].title !== '售价' &&
formThead[iii].title !== '市场价' &&
formThead[iii].title !== '库存'"
v-model="scope.row[iii]" v-model="scope.row[iii]"
:min="0" :min="0"
size="small" size="small"
class="priceBox" class="priceBox"
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'" :disabled="isForbidden(iii)"
controls-position="right" controls-position="right"
@blur="memberPrice(formThead[iii], scope.row)" @blur="memberPrice(formThead[iii], scope.row)"
/> />
@ -1223,11 +1213,11 @@
<div v-else> <div v-else>
<el-input <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]" v-model="scope.row[iii]"
type="text" type="text"
size="small" size="small"
:disabled="virStatus&&(formThead[iii].title === '依据链接' || formThead[iii].title === '商品编号')" :disabled="isVirStatus(iii)"
@input="handleCost(scope.row,iii,$event)" @input="handleCost(scope.row,iii,$event)"
class="priceBox" class="priceBox"
/> />
@ -1237,7 +1227,7 @@
:min="0" :min="0"
type="number" type="number"
size="small" size="small"
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'" :disabled="isForbidden(iii)"
class="priceBox" class="priceBox"
controls-position="right" controls-position="right"
/> />
@ -1363,26 +1353,21 @@
class="priceBox" class="priceBox"
/> --> /> -->
<el-input <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]" v-model="scope.row[iii]"
type="text" type="text"
size="small" size="small"
:disabled="virStatus&&(formThead[iii].title === '依据链接' || formThead[iii].title === '商品编号')" :disabled="isVirStatus(iii)"
@input="handleCost(scope.row,iii,$event)" @input="handleCost(scope.row,iii,$event)"
class="priceBox" class="priceBox"
/> />
<el-input-number <el-input-number
v-if="formThead[iii].title !== '付费会员价' && v-if="isForbiddens(iii)"
formThead[iii].title !== '商品编号' &&
formThead[iii].title !== '依据链接' &&
formThead[iii].title !== '售价' &&
formThead[iii].title !== '市场价' &&
formThead[iii].title !== '库存'"
v-model="scope.row[iii]" v-model="scope.row[iii]"
:min="0" :min="0"
size="small" size="small"
class="priceBox" class="priceBox"
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'" :disabled="isForbidden(iii)"
controls-position="right" controls-position="right"
@blur="memberPrice(formThead[iii], scope.row)" @blur="memberPrice(formThead[iii], scope.row)"
/> />
@ -1411,12 +1396,12 @@
class="priceBox" class="priceBox"
/> --> /> -->
<el-input <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]" v-model="scope.row[iii]"
type="text" type="text"
size="small" size="small"
:class="scope.row[iii]" :class="scope.row[iii]"
:disabled="virStatus&&(formThead[iii].title === '依据链接' || formThead[iii].title === '商品编号')" :disabled="isVirStatus(iii)"
@input="handleCost(scope.row,iii,$event)" @input="handleCost(scope.row,iii,$event)"
class="priceBox" class="priceBox"
/> />
@ -1435,7 +1420,7 @@
type="number" type="number"
size="small" size="small"
class="priceBox" class="priceBox"
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'" :disabled="isForbidden(iii)"
controls-position="right" controls-position="right"
/> />
</div> </div>
@ -2637,6 +2622,25 @@ export default {
window.removeEventListener('popstate', this.goBack, false) window.removeEventListener('popstate', this.goBack, false)
}, },
methods: { 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(){ onsubmit(){
this.dialogVisible = false this.dialogVisible = false
}, },

View File

@ -169,7 +169,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<a <a
v-if="formThead[iii].title == '依据链接'" v-if="formThead[iii].title == '依据链接'"
:href="scope.row[iii]" :href="isValidURL(scope.row[iii])"
target="_blank" target="_blank"
>{{ scope.row[iii] }}</a >{{ scope.row[iii] }}</a
> >
@ -208,7 +208,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<a <a
v-if="formThead[iii].title == '依据链接'" v-if="formThead[iii].title == '依据链接'"
:href="scope.row[iii]" :href="isValidURL(scope.row[iii])"
target="_blank" target="_blank"
>{{ scope.row[iii] }}</a >{{ scope.row[iii] }}</a
> >
@ -857,6 +857,15 @@ export default {
filters: { filters: {
}, },
methods: { 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){ getType(val){
var regex = /(?:\.([^.]+))?$/; var regex = /(?:\.([^.]+))?$/;
let suffix = regex.exec(val.url)[1] let suffix = regex.exec(val.url)[1]