Commit 3155e159 by 张立顺

Merge branch 'SAAS+V5.6.4' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into SAAS+V5.6.4
2 parents fe17c40e d6eeb4ad
......@@ -8,8 +8,10 @@
:clearable="true" :maxlength="50" @input="event => searchInput(event, 'commodityCode')" />
</template>
<template slot="type">
<el-input :style="{ width: '100%' }" placeholder="请输入商品编码" v-model.trim="searchForm['type']" :clearable="true"
:maxlength="50" @input="event => searchInput(event, 'type')" />
<!-- <el-input :style="{ width: '100%' }" placeholder="请输入商品编码" v-model.trim="searchForm['type']" :clearable="true"
:maxlength="50" @input="event => searchInput(event, 'type')" /> -->
<el-input :style="{ width: '100%' }" placeholder="请输入商品编码" v-model.trim="searchForm['type']" :clearable="true"
:maxlength="50" />
</template>
<template slot="thirdPartyCode">
<el-input :style="{ width: '100%' }" placeholder="请输入第三方编码" v-model.trim="searchForm['thirdPartyCode']"
......
......@@ -269,7 +269,7 @@
>{{ subItem.label }}</el-radio
>
</el-radio-group>
<el-tooltip class="item" effect="dark" placement="top">
<el-tooltip v-if="item.name === 'financeCheckFlag'" class="item" effect="dark" placement="top">
<template slot="content">
<p style="width: 260px">
<i class="el-icon-info"></i
......@@ -280,6 +280,22 @@
</el-tooltip>
</el-form-item>
</div>
<div v-if="item.type === 'datePicker' && formData.sellPriceValidType == '2'">
<el-form-item
:prop="item.name"
:label="item.label ? item.label + ':' : ''"
:id="item.name"
:label-width="item.label ? '180px' : '0px'"
class="dis-in-block"
:style="{ 'margin-bottom': !item.type ? '0px' : '22px' }"
>
<template >
<el-date-picker v-model="formData[item.name]" type="daterange" :style="{ width: item.width || formItemWidth }" range-separator="至" format="yyyy-MM-dd" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期"> </el-date-picker>
</template>
</el-form-item>
</div>
<!-- 按钮 -->
<div v-if="item.type === 'button'">
<el-form-item
......@@ -638,7 +654,13 @@ export default {
message: "请选择是否开启财务规则校验",
trigger: "change"
}
]
],
sellPriceValidType: [
{ required: true, message: "请选择售价有效期", trigger: "change" }
],
tempValidDate: [
{ required: true, message: "请选择有效期", trigger: "blur" }
],
},
storeSelected: [],
relateStoreVisible: false,
......@@ -1230,7 +1252,14 @@ export default {
handleUp(e) {
this.$refs[this.formRef + "d2FormRuleForm"].validate((valid, options) => {
if (valid) {
this.$emit("handleAddConfirm", { ...this.formData, num: e })
const { tempValidDate } = this.formData;
let tempValidStartDate = '';
let tempValidEndDate = '';
if(this.formData.sellPriceValidType == '2'){
tempValidStartDate = tempValidDate[0] || '';
tempValidEndDate = tempValidDate[1] || '';
}
this.$emit("handleAddConfirm", { ...this.formData, tempValidStartDate, tempValidEndDate, num: e })
} else {
var needRuleList = Object.keys(options)
this.jumpScroll(needRuleList[0])
......
......@@ -14,7 +14,7 @@ import { getMerchantGoodsInfo, addOrUpdateAPI, checkGroundingLog } from '@api/gr
import groundingForm from "./components/groundingForm.vue"
import { BaseData, sceneCodeList } from '@/common/constants.js'
import { mapActions } from 'vuex'
import { deepClone } from '@/common/util'
import { deepClone, Util } from '@/common/util'
import { baseConfig } from '@/main'
import { filterSpecsStr, convertYuanToWan } from "../filterOption"
export default {
......@@ -177,6 +177,23 @@ export default {
width: '432px',
unit: true,
handleInput: true
},{
name: 'sellPriceValidType',
label: '售价有效期',
type: 'flagRadio',
radioGroupList: [{
label: '终生有效',
value: 1
}, {
label: '临时有效',
value: 2
}]
}, {
name: 'tempValidDate',
label: '有效期',
type: 'datePicker',
maxlength: 120,
width: '432px'
}, {
name: 'financeCheckFlag',
label: '财务规则校验',
......@@ -234,6 +251,8 @@ export default {
voucherList: [],
validMinSellPriceFlag: true,
validMinSellPrice: 'Y',
sellPriceValidType: 1,
tempValidDate: [],
financeCheckFlag: 'N'
},
secondGoodsList: [],
......@@ -303,6 +322,13 @@ export default {
})
res.merchantGoodsRefList = res.merchantGoodsRefList || [] // 上架门店
res.voucherList = res.voucherList || [] // 上架凭证
let tempValidDate = [];
if(res?.sellPriceValidType && res?.sellPriceValidType == 2 ){
if(res?.tempValidStartDate && res?.tempValidEndDate){
tempValidDate = [Util.dateFormate(res?.tempValidStartDate, 'YYYY-MM-DD'), Util.dateFormate(res?.tempValidEndDate, 'YYYY-MM-DD')]
}
}
res.tempValidDate = tempValidDate
res.upgradeGoods = {
...res?.upgradeGoods,
goodsName: res.goodsInfo.goodsName,
......@@ -313,7 +339,9 @@ export default {
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(res?.upgradeGoods),
carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
upgradeCommodityCode: res?.upgradeGoods?.commodityCode
upgradeCommodityCode: res?.upgradeGoods?.commodityCode,
sellPriceValidType: res?.sellPriceValidType ? res?.sellPriceValidType + '' : '1',
tempValidDate: tempValidDate,
}
this.editData = res || {}
this.$nextTick(() => {
......@@ -364,14 +392,19 @@ export default {
})
// 整理上传凭证数据
delete formObj?.productType
const params = {
let params = {
saveDraft: num === 2, // 是否存草稿
id: data.id,
...formObj,
merchantGoodsRefList: arr,
voucherList: fileArr,
existCheck,
validMinSellPrice: data?.validMinSellPrice
validMinSellPrice: data?.validMinSellPrice,
tempValidStartDate: data?.tempValidStartDate || '',
tempValidEndDate: data?.tempValidEndDate || '',
}
if(params.tempValidDate){
delete params.tempValidDate
}
if (data?.goodsType == 1 && data?.sceneType != 1) return this.$message.warning('太阳膜类商品仅支持上架至精品升级场景')
if (this.extendedPosiType.includes(data.goodsType) && data?.sceneType != 0) return this.$message.warning('延保类商品仅支持上架至会员/权益升级场景')
......@@ -381,7 +414,12 @@ export default {
upgradeGoodsId: formObj.upgradeGoodsId,
position: formObj.position || '',
sceneType: formObj.sceneType,
merchantIdList: arr?.map(val => { return val.merchantId })
merchantIdList: arr?.map(val => { return val.merchantId }),
tempValidStartDate: data?.tempValidStartDate || '',
tempValidEndDate: data?.tempValidEndDate || '',
}
if(params.tempValidDate){
delete params.tempValidDate
}
if ((num == 1 || num == 3) && !baseConfig.supplierCode.includes(data.supplierCode)) { // 第三方商品无需走审核流程不用提示
this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', {
......
......@@ -3,8 +3,8 @@
<d2-container class="edit-commodity">
<div class="" v-if="show">
<detail ref="d2GroundingDetail" :rules="rules" form-name="grounding" :origin-data="editData" :form-list="editForm"
:product-service-item-list="productServiceItemList" @handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose"></detail>
:product-service-item-list="productServiceItemList" @handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose"></detail>
</div>
</d2-container>
</template>
......@@ -41,6 +41,7 @@ export default {
warrantyTypeStr: [{ required: true }],
djCost: [{ required: true }],
thirdPartyCost: [{ required: true }],
sellPriceValidType: [{ required: true }],
financeCheckFlagStr: [{ required: true }]
},
editForm: [{
......@@ -134,6 +135,9 @@ export default {
label: '第三方成本',
unit: true
}, {
name: 'sellPriceValidType',
label: '售价有效期',
}, {
name: 'financeCheckFlagStr',
label: '财务规则校验'
}]
......@@ -221,6 +225,13 @@ export default {
res.positionStr = deepClone(this.positionTypeList)?.filter(val => res?.position == val.position)[0]?.confName || ''
res.supplierCode = res?.goodsInfo?.supplierCode
res.financeCheckFlagStr = res?.financeCheckFlag == 'Y' ? '开启' : res?.financeCheckFlag == 'N' ? '关闭' : '-'
let sellPriceValidTxt = ''
if (res?.sellPriceValidType == 2 && res?.tempValidStartDate && res?.tempValidEndDate) {
sellPriceValidTxt = `${Util.dateFormate(res?.tempValidStartDate, 'YYYY-MM-DD')} 至 ${Util.dateFormate(res?.tempValidEndDate, 'YYYY-MM-DD')}`
}
res.sellPriceValidType = res?.sellPriceValidType == 1 ? '终生有效' : res?.sellPriceValidType == 2 ? sellPriceValidTxt : '-'
res.upgradeGoods = {
...res.upgradeGoods,
goodsName: res.goodsInfo.goodsName,
......
......@@ -337,13 +337,13 @@ export default {
? Util.dateFormate(res.orderTime, "YYYY-MM-DD HH:mm:ss")
: "--";
res.status
= res.status === 0 ? "待审核" : res.status == 1 ? "已审核" : "已失效";
= res.status === 0 ? "待审核" : res.status == 1 ? "已审核" : res.status == 3 ? "已驳回" : "已失效";
res.failType = res.failType
? res.failType == 1
? "退款"
: res.failType == 2
? "撤单"
: "错单"
: res.failType == 3 ? "错单" : "--"
: "--";
this.detailInfo = res;
......
......@@ -6,8 +6,11 @@
<glsx-combi-form class="edit-form-container" ref="editFormRef" :label-width="labelWidth" :form-obj="detailInfo"
:form-data="item.editFormData">
<div slot="storePhoto" slot-scope="scope">
<glskPreview class="photoCon" v-if="detailInfo[scope.scope.name]"
:image-url-arr="detailInfo[scope.scope.name]" :pic-options="{ ...picOptions, type: 'image' }">
<glskPreview
class="photoCon"
v-if="detailInfo[scope.scope.name]"
:image-url-arr="getOssPreviewUrls(scope.scope.name)"
:pic-options="{ ...picOptions, type: 'image' }">
</glskPreview>
<div v-else>-</div>
</div>
......@@ -439,7 +442,10 @@ export default {
const data = await getDeliveryOrderDetail({ id: this.id })
this.loading = false
if (data.confirmImages) {
data.confirmImages = data.confirmImages.split(",")
// 逗号分隔的交付图片链接,按“逗号+http”分割,避免后续带有 quality,q_100 时被误拆
data.confirmImages = data.confirmImages
.split(/,\s*(?=https?:\/\/)/)
.map(item => item.trim())
// data.confirmImagesList = data.confirmImages.map(item => item.fileUrl)
}
// else data.confirmImages = []
......@@ -457,6 +463,18 @@ export default {
this.loading = false
}
},
getOssImageUrl(url) {
if (!url) return url
if (url.includes('x-oss-process=')) return url
const param = 'x-oss-process=image/format,jpg/quality,q_100'
const sep = url.includes('?') ? '&' : '?'
return `${url}${sep}${param}`
},
getOssPreviewUrls(fieldName) {
const urls = this.detailInfo && this.detailInfo[fieldName]
if (!urls || !Array.isArray(urls)) return []
return urls.map(url => this.getOssImageUrl(url))
},
async getLogList() {
const data = await getDeliveryOrderOpLog({
deliveryOrderId: this.deliveryOrderId
......
......@@ -32,11 +32,7 @@
">
<glsx-preview
:key="preIndex"
:image-url-arr="
detailInfo[item.key]
? detailInfo[item.key]
: []
"
:image-url-arr="getImgPreviewUrls(item)"
:pic-options="{
...picOptions,
type: item.type
......@@ -171,11 +167,7 @@
v-if="customItem[item.fieldValue]">
<glsx-preview
:key="customIndex"
:image-url-arr="
customItem[item.fieldValue]
? customItem[item.fieldValue]
: []
"
:image-url-arr="getCustomImageUrls(customItem, item)"
:video-img="true"
:pic-options="{
...picOptions,
......@@ -639,6 +631,26 @@ export default {
if (!str || typeof str !== "string") return []
return str.split(/,\s*(?=https?:\/\/)/).map((s) => s.trim()).filter(Boolean)
},
getOssImageUrl(url) {
if (!url) return url
if (url.includes("x-oss-process=")) return url
const param = "x-oss-process=image/format,jpg/quality,q_100"
const sep = url.includes("?") ? "&" : "?"
return `${url}${sep}${param}`
},
// 顶部 imgList(如车辆图片)预览使用的 URL 列表
getImgPreviewUrls(item) {
const urls = this.detailInfo && this.detailInfo[item.key]
if (!urls || !Array.isArray(urls)) return []
return urls.map(url => this.getOssImageUrl(url))
},
// 自定义字段图片/视频预览使用的 URL 列表
getCustomImageUrls(customItem, configItem) {
const urls = customItem && customItem[configItem.fieldValue]
if (!urls || !Array.isArray(urls)) return []
if (customItem.otherType === "video") return urls
return urls.map(url => this.getOssImageUrl(url))
},
getFileType(url) {
// 图片扩展名
const imageExtensions = [
......
......@@ -59,11 +59,9 @@
</div>
<el-image
class="img"
:src="img[item.imgKey]"
:src="getOssImageUrl(img[item.imgKey])"
fit="contain"
:preview-src-list="
detailInfo[item.previewKey]
"
:preview-src-list="detailInfo[item.previewKey]"
lazy
></el-image>
</div>
......@@ -787,7 +785,7 @@ export default {
// 处理 carImages (保持原有逻辑)
if (data.carImages) {
data.carImages = JSON.parse(data.carImages)
data.carImagesList = data.carImages.map(item => item.fileUrl)
data.carImagesList = data.carImages.map(item => this.getOssImageUrl(item.fileUrl))
} else {
data.carImages = []
data.carImagesList = []
......@@ -990,6 +988,13 @@ export default {
window.open(fileList[0].fileUrl)
}
},
getOssImageUrl(url) {
if (!url) return url
if (url.includes('x-oss-process=')) return url
const param = 'x-oss-process=image/format,jpg/quality,q_100'
const sep = url.includes('?') ? '&' : '?'
return `${url}${sep}${param}`
},
getFileTypeFromUrl(url) {
if (!url) return 'file'
const pathname = url.split('?')[0]
......@@ -1018,7 +1023,7 @@ export default {
// this.imgList = url
console.log("url", url)
url.map((item) => {
this.imgList.push(item.fileUrl)
this.imgList.push(this.getOssImageUrl(item.fileUrl))
this.imgUrlName = item.fileName
})
// this.imgList = url.map((item) => item[name])
......@@ -1030,7 +1035,7 @@ export default {
this.imgVisible = !this.imgVisible
this.initialIndex = 0
url.map((item) => {
this.imgList.push(item.fileUrl)
this.imgList.push(this.getOssImageUrl(item.fileUrl))
this.imgUrlName = item.fileName
})
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!