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 @@ ...@@ -8,8 +8,10 @@
:clearable="true" :maxlength="50" @input="event => searchInput(event, 'commodityCode')" /> :clearable="true" :maxlength="50" @input="event => searchInput(event, 'commodityCode')" />
</template> </template>
<template slot="type"> <template slot="type">
<el-input :style="{ width: '100%' }" placeholder="请输入商品编码" v-model.trim="searchForm['type']" :clearable="true" <!-- <el-input :style="{ width: '100%' }" placeholder="请输入商品编码" v-model.trim="searchForm['type']" :clearable="true"
:maxlength="50" @input="event => searchInput(event, 'type')" /> :maxlength="50" @input="event => searchInput(event, 'type')" /> -->
<el-input :style="{ width: '100%' }" placeholder="请输入商品编码" v-model.trim="searchForm['type']" :clearable="true"
:maxlength="50" />
</template> </template>
<template slot="thirdPartyCode"> <template slot="thirdPartyCode">
<el-input :style="{ width: '100%' }" placeholder="请输入第三方编码" v-model.trim="searchForm['thirdPartyCode']" <el-input :style="{ width: '100%' }" placeholder="请输入第三方编码" v-model.trim="searchForm['thirdPartyCode']"
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
>{{ subItem.label }}</el-radio >{{ subItem.label }}</el-radio
> >
</el-radio-group> </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"> <template slot="content">
<p style="width: 260px"> <p style="width: 260px">
<i class="el-icon-info"></i <i class="el-icon-info"></i
...@@ -280,6 +280,22 @@ ...@@ -280,6 +280,22 @@
</el-tooltip> </el-tooltip>
</el-form-item> </el-form-item>
</div> </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'"> <div v-if="item.type === 'button'">
<el-form-item <el-form-item
...@@ -638,7 +654,13 @@ export default { ...@@ -638,7 +654,13 @@ export default {
message: "请选择是否开启财务规则校验", message: "请选择是否开启财务规则校验",
trigger: "change" trigger: "change"
} }
] ],
sellPriceValidType: [
{ required: true, message: "请选择售价有效期", trigger: "change" }
],
tempValidDate: [
{ required: true, message: "请选择有效期", trigger: "blur" }
],
}, },
storeSelected: [], storeSelected: [],
relateStoreVisible: false, relateStoreVisible: false,
...@@ -1230,7 +1252,14 @@ export default { ...@@ -1230,7 +1252,14 @@ export default {
handleUp(e) { handleUp(e) {
this.$refs[this.formRef + "d2FormRuleForm"].validate((valid, options) => { this.$refs[this.formRef + "d2FormRuleForm"].validate((valid, options) => {
if (valid) { 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 { } else {
var needRuleList = Object.keys(options) var needRuleList = Object.keys(options)
this.jumpScroll(needRuleList[0]) this.jumpScroll(needRuleList[0])
......
...@@ -14,7 +14,7 @@ import { getMerchantGoodsInfo, addOrUpdateAPI, checkGroundingLog } from '@api/gr ...@@ -14,7 +14,7 @@ import { getMerchantGoodsInfo, addOrUpdateAPI, checkGroundingLog } from '@api/gr
import groundingForm from "./components/groundingForm.vue" import groundingForm from "./components/groundingForm.vue"
import { BaseData, sceneCodeList } from '@/common/constants.js' import { BaseData, sceneCodeList } from '@/common/constants.js'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { deepClone } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import { filterSpecsStr, convertYuanToWan } from "../filterOption" import { filterSpecsStr, convertYuanToWan } from "../filterOption"
export default { export default {
...@@ -177,6 +177,23 @@ export default { ...@@ -177,6 +177,23 @@ export default {
width: '432px', width: '432px',
unit: true, unit: true,
handleInput: 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', name: 'financeCheckFlag',
label: '财务规则校验', label: '财务规则校验',
...@@ -234,6 +251,8 @@ export default { ...@@ -234,6 +251,8 @@ export default {
voucherList: [], voucherList: [],
validMinSellPriceFlag: true, validMinSellPriceFlag: true,
validMinSellPrice: 'Y', validMinSellPrice: 'Y',
sellPriceValidType: 1,
tempValidDate: [],
financeCheckFlag: 'N' financeCheckFlag: 'N'
}, },
secondGoodsList: [], secondGoodsList: [],
...@@ -303,6 +322,13 @@ export default { ...@@ -303,6 +322,13 @@ export default {
}) })
res.merchantGoodsRefList = res.merchantGoodsRefList || [] // 上架门店 res.merchantGoodsRefList = res.merchantGoodsRefList || [] // 上架门店
res.voucherList = res.voucherList || [] // 上架凭证 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 = {
...res?.upgradeGoods, ...res?.upgradeGoods,
goodsName: res.goodsInfo.goodsName, goodsName: res.goodsInfo.goodsName,
...@@ -313,7 +339,9 @@ export default { ...@@ -313,7 +339,9 @@ export default {
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '', positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(res?.upgradeGoods), specificationData: this.filterSpecsStr(res?.upgradeGoods),
carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'), 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.editData = res || {}
this.$nextTick(() => { this.$nextTick(() => {
...@@ -364,14 +392,19 @@ export default { ...@@ -364,14 +392,19 @@ export default {
}) })
// 整理上传凭证数据 // 整理上传凭证数据
delete formObj?.productType delete formObj?.productType
const params = { let params = {
saveDraft: num === 2, // 是否存草稿 saveDraft: num === 2, // 是否存草稿
id: data.id, id: data.id,
...formObj, ...formObj,
merchantGoodsRefList: arr, merchantGoodsRefList: arr,
voucherList: fileArr, voucherList: fileArr,
existCheck, 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 (data?.goodsType == 1 && data?.sceneType != 1) return this.$message.warning('太阳膜类商品仅支持上架至精品升级场景')
if (this.extendedPosiType.includes(data.goodsType) && data?.sceneType != 0) return this.$message.warning('延保类商品仅支持上架至会员/权益升级场景') if (this.extendedPosiType.includes(data.goodsType) && data?.sceneType != 0) return this.$message.warning('延保类商品仅支持上架至会员/权益升级场景')
...@@ -381,7 +414,12 @@ export default { ...@@ -381,7 +414,12 @@ export default {
upgradeGoodsId: formObj.upgradeGoodsId, upgradeGoodsId: formObj.upgradeGoodsId,
position: formObj.position || '', position: formObj.position || '',
sceneType: formObj.sceneType, 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)) { // 第三方商品无需走审核流程不用提示 if ((num == 1 || num == 3) && !baseConfig.supplierCode.includes(data.supplierCode)) { // 第三方商品无需走审核流程不用提示
this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', { this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', {
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<d2-container class="edit-commodity"> <d2-container class="edit-commodity">
<div class="" v-if="show"> <div class="" v-if="show">
<detail ref="d2GroundingDetail" :rules="rules" form-name="grounding" :origin-data="editData" :form-list="editForm" <detail ref="d2GroundingDetail" :rules="rules" form-name="grounding" :origin-data="editData" :form-list="editForm"
:product-service-item-list="productServiceItemList" @handleAddConfirm="handleAddConfirm" :product-service-item-list="productServiceItemList" @handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose"></detail> @handleClose="handleAddClose"></detail>
</div> </div>
</d2-container> </d2-container>
</template> </template>
...@@ -41,6 +41,7 @@ export default { ...@@ -41,6 +41,7 @@ export default {
warrantyTypeStr: [{ required: true }], warrantyTypeStr: [{ required: true }],
djCost: [{ required: true }], djCost: [{ required: true }],
thirdPartyCost: [{ required: true }], thirdPartyCost: [{ required: true }],
sellPriceValidType: [{ required: true }],
financeCheckFlagStr: [{ required: true }] financeCheckFlagStr: [{ required: true }]
}, },
editForm: [{ editForm: [{
...@@ -134,6 +135,9 @@ export default { ...@@ -134,6 +135,9 @@ export default {
label: '第三方成本', label: '第三方成本',
unit: true unit: true
}, { }, {
name: 'sellPriceValidType',
label: '售价有效期',
}, {
name: 'financeCheckFlagStr', name: 'financeCheckFlagStr',
label: '财务规则校验' label: '财务规则校验'
}] }]
...@@ -221,6 +225,13 @@ export default { ...@@ -221,6 +225,13 @@ export default {
res.positionStr = deepClone(this.positionTypeList)?.filter(val => res?.position == val.position)[0]?.confName || '' res.positionStr = deepClone(this.positionTypeList)?.filter(val => res?.position == val.position)[0]?.confName || ''
res.supplierCode = res?.goodsInfo?.supplierCode res.supplierCode = res?.goodsInfo?.supplierCode
res.financeCheckFlagStr = res?.financeCheckFlag == 'Y' ? '开启' : res?.financeCheckFlag == 'N' ? '关闭' : '-' 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 = {
...res.upgradeGoods, ...res.upgradeGoods,
goodsName: res.goodsInfo.goodsName, goodsName: res.goodsInfo.goodsName,
......
...@@ -337,13 +337,13 @@ export default { ...@@ -337,13 +337,13 @@ export default {
? Util.dateFormate(res.orderTime, "YYYY-MM-DD HH:mm:ss") ? Util.dateFormate(res.orderTime, "YYYY-MM-DD HH:mm:ss")
: "--"; : "--";
res.status res.status
= res.status === 0 ? "待审核" : res.status == 1 ? "已审核" : "已失效"; = res.status === 0 ? "待审核" : res.status == 1 ? "已审核" : res.status == 3 ? "已驳回" : "已失效";
res.failType = res.failType res.failType = res.failType
? res.failType == 1 ? res.failType == 1
? "退款" ? "退款"
: res.failType == 2 : res.failType == 2
? "撤单" ? "撤单"
: "错单" : res.failType == 3 ? "错单" : "--"
: "--"; : "--";
this.detailInfo = res; this.detailInfo = res;
......
...@@ -6,8 +6,11 @@ ...@@ -6,8 +6,11 @@
<glsx-combi-form class="edit-form-container" ref="editFormRef" :label-width="labelWidth" :form-obj="detailInfo" <glsx-combi-form class="edit-form-container" ref="editFormRef" :label-width="labelWidth" :form-obj="detailInfo"
:form-data="item.editFormData"> :form-data="item.editFormData">
<div slot="storePhoto" slot-scope="scope"> <div slot="storePhoto" slot-scope="scope">
<glskPreview class="photoCon" v-if="detailInfo[scope.scope.name]" <glskPreview
:image-url-arr="detailInfo[scope.scope.name]" :pic-options="{ ...picOptions, type: 'image' }"> class="photoCon"
v-if="detailInfo[scope.scope.name]"
:image-url-arr="getOssPreviewUrls(scope.scope.name)"
:pic-options="{ ...picOptions, type: 'image' }">
</glskPreview> </glskPreview>
<div v-else>-</div> <div v-else>-</div>
</div> </div>
...@@ -439,7 +442,10 @@ export default { ...@@ -439,7 +442,10 @@ export default {
const data = await getDeliveryOrderDetail({ id: this.id }) const data = await getDeliveryOrderDetail({ id: this.id })
this.loading = false this.loading = false
if (data.confirmImages) { 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) // data.confirmImagesList = data.confirmImages.map(item => item.fileUrl)
} }
// else data.confirmImages = [] // else data.confirmImages = []
...@@ -457,6 +463,18 @@ export default { ...@@ -457,6 +463,18 @@ export default {
this.loading = false 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() { async getLogList() {
const data = await getDeliveryOrderOpLog({ const data = await getDeliveryOrderOpLog({
deliveryOrderId: this.deliveryOrderId deliveryOrderId: this.deliveryOrderId
......
...@@ -32,11 +32,7 @@ ...@@ -32,11 +32,7 @@
"> ">
<glsx-preview <glsx-preview
:key="preIndex" :key="preIndex"
:image-url-arr=" :image-url-arr="getImgPreviewUrls(item)"
detailInfo[item.key]
? detailInfo[item.key]
: []
"
:pic-options="{ :pic-options="{
...picOptions, ...picOptions,
type: item.type type: item.type
...@@ -171,11 +167,7 @@ ...@@ -171,11 +167,7 @@
v-if="customItem[item.fieldValue]"> v-if="customItem[item.fieldValue]">
<glsx-preview <glsx-preview
:key="customIndex" :key="customIndex"
:image-url-arr=" :image-url-arr="getCustomImageUrls(customItem, item)"
customItem[item.fieldValue]
? customItem[item.fieldValue]
: []
"
:video-img="true" :video-img="true"
:pic-options="{ :pic-options="{
...picOptions, ...picOptions,
...@@ -639,6 +631,26 @@ export default { ...@@ -639,6 +631,26 @@ export default {
if (!str || typeof str !== "string") return [] if (!str || typeof str !== "string") return []
return str.split(/,\s*(?=https?:\/\/)/).map((s) => s.trim()).filter(Boolean) 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) { getFileType(url) {
// 图片扩展名 // 图片扩展名
const imageExtensions = [ const imageExtensions = [
......
...@@ -59,11 +59,9 @@ ...@@ -59,11 +59,9 @@
</div> </div>
<el-image <el-image
class="img" class="img"
:src="img[item.imgKey]" :src="getOssImageUrl(img[item.imgKey])"
fit="contain" fit="contain"
:preview-src-list=" :preview-src-list="detailInfo[item.previewKey]"
detailInfo[item.previewKey]
"
lazy lazy
></el-image> ></el-image>
</div> </div>
...@@ -787,7 +785,7 @@ export default { ...@@ -787,7 +785,7 @@ export default {
// 处理 carImages (保持原有逻辑) // 处理 carImages (保持原有逻辑)
if (data.carImages) { if (data.carImages) {
data.carImages = JSON.parse(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 { } else {
data.carImages = [] data.carImages = []
data.carImagesList = [] data.carImagesList = []
...@@ -990,6 +988,13 @@ export default { ...@@ -990,6 +988,13 @@ export default {
window.open(fileList[0].fileUrl) 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) { getFileTypeFromUrl(url) {
if (!url) return 'file' if (!url) return 'file'
const pathname = url.split('?')[0] const pathname = url.split('?')[0]
...@@ -1018,7 +1023,7 @@ export default { ...@@ -1018,7 +1023,7 @@ export default {
// this.imgList = url // this.imgList = url
console.log("url", url) console.log("url", url)
url.map((item) => { url.map((item) => {
this.imgList.push(item.fileUrl) this.imgList.push(this.getOssImageUrl(item.fileUrl))
this.imgUrlName = item.fileName this.imgUrlName = item.fileName
}) })
// this.imgList = url.map((item) => item[name]) // this.imgList = url.map((item) => item[name])
...@@ -1030,7 +1035,7 @@ export default { ...@@ -1030,7 +1035,7 @@ export default {
this.imgVisible = !this.imgVisible this.imgVisible = !this.imgVisible
this.initialIndex = 0 this.initialIndex = 0
url.map((item) => { url.map((item) => {
this.imgList.push(item.fileUrl) this.imgList.push(this.getOssImageUrl(item.fileUrl))
this.imgUrlName = item.fileName 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!