Commit 4d576aee by 张晓玮

Merge branch 'dev_v4.25.0' into 'develop'

Dev v4.25.0

See merge request !222
2 parents 47ab436e f29f97c9
Showing 41 changed files with 1049 additions and 277 deletions
...@@ -59,4 +59,17 @@ export function getAllGoodsList(data) { ...@@ -59,4 +59,17 @@ export function getAllGoodsList(data) {
export function batchUpdateStatus(data) { export function batchUpdateStatus(data) {
data.method = `${path}merchantGoodsInfo.updateBatchOffShelf` data.method = `${path}merchantGoodsInfo.updateBatchOffShelf`
return request(data, 'post') return request(data, 'post')
}
// 批量复制
export function batchUpdateBatchCopy(data) {
data.method = `${path}merchantGoodsInfo.updateBatchCopy`
return request(data, 'post')
}
// 校验上架记录中是否已存在
export function checkGroundingLog(data) {
data.method = `${path}merchantGoodsInfo.existsCount`
return request(data, 'post')
} }
\ No newline at end of file \ No newline at end of file
...@@ -315,3 +315,9 @@ export function insertOrUpdateDiversionMerchantRef(data) { ...@@ -315,3 +315,9 @@ export function insertOrUpdateDiversionMerchantRef(data) {
data.method = `${path2}diversionMerchant.insertOrUpdateDiversionMerchantRef` data.method = `${path2}diversionMerchant.insertOrUpdateDiversionMerchantRef`
return request(data, "post") return request(data, "post")
} }
// 获取服务中心所有门店 支持园区店关键字搜索
export function getAccountMerchantList(data) {
data.method = `${path}merchant.page.withYq`
return request(data, "post")
}
...@@ -96,3 +96,9 @@ export function uploadPDF(data) { ...@@ -96,3 +96,9 @@ export function uploadPDF(data) {
data.method = `${path}smartcarlife.common.uploadPdf` data.method = `${path}smartcarlife.common.uploadPdf`
return request(data, RequestMethods.POST, ["file"]) return request(data, RequestMethods.POST, ["file"])
} }
// 获取太阳膜类商品部位属性
export function getPositionList(data) {
data.method = `${path}smartcarlife.goodsPosition.list`
return request(data)
}
\ No newline at end of file \ No newline at end of file
...@@ -29,7 +29,12 @@ export function quotationExport(data) { ...@@ -29,7 +29,12 @@ export function quotationExport(data) {
// 打印 返回权益合同PDF文件Url // 打印 返回权益合同PDF文件Url
export function contractExport(data) { export function contractExport(data) {
data.method = `dj.api.smartcarlife.vd.equity.order.print` data.method = `dj.api.smartcarlife.vd.equity.order.print`
// data.method = `${path}quotation.export` return request(data)
}
// 查询合同号列表
export function listContracts(data) {
data.method = `dj.api.smartcarlife.vd.equity.order.listContracts`
return request(data) return request(data)
} }
......
...@@ -12,7 +12,8 @@ export const TYPE_NAME = "confType" ...@@ -12,7 +12,8 @@ export const TYPE_NAME = "confType"
export const BaseData = { export const BaseData = {
channelType: "channelType", channelType: "channelType",
productType: "productType", productType: "productType",
productServiceItemList: "productServiceItemList" productServiceItemList: "productServiceItemList",
positionTypeList: "positionTypeList" // 太阳膜商品部位
} }
/** /**
...@@ -509,43 +510,43 @@ export const targetType = { ...@@ -509,43 +510,43 @@ export const targetType = {
} }
// 太阳膜部位 // 太阳膜部位
export const positionTypeList = [ // export const positionTypeList = [
{ // {
position: 1, // position: 1,
confName: "前档玻璃", // confName: "前档玻璃",
deductionStandard: 1 // deductionStandard: 1
}, // },
{ // {
position: 2, // position: 2,
confName: "侧后档玻璃", // confName: "侧后档玻璃",
deductionStandard: 2 // deductionStandard: 2
}, // },
{ // {
position: 3, // position: 3,
confName: "单帖侧窗一个", // confName: "单帖侧窗一个",
deductionStandard: 0.4 // deductionStandard: 0.4
}, // },
{ // {
position: 4, // position: 4,
confName: "单帖后档一个", // confName: "单帖后档一个",
deductionStandard: 0.8 // deductionStandard: 0.8
}, // },
{ // {
position: 5, // position: 5,
confName: "单帖小天窗", // confName: "单帖小天窗",
deductionStandard: 0.4 // deductionStandard: 0.4
}, // },
{ // {
position: 6, // position: 6,
confName: "单帖中天窗", // confName: "单帖中天窗",
deductionStandard: 0.8 // deductionStandard: 0.8
}, // },
{ // {
position: 7, // position: 7,
confName: "单帖全景天窗", // confName: "单帖全景天窗",
deductionStandard: 1 // deductionStandard: 1
} // }
] // ]
// 太阳膜适用车型 // 太阳膜适用车型
export const applicableModelTypeList = [ export const applicableModelTypeList = [
{ {
......
...@@ -353,6 +353,14 @@ export const routerName = { ...@@ -353,6 +353,14 @@ export const routerName = {
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleBatchOffShelf" handle: "handleBatchOffShelf"
},
{
authId: "9030909",
parentId: "90309",
label: "批量复制",
category: "Button",
type: "primary",
handle: "handleBatchCopy"
} }
], ],
component: _import("goods/grounding/index") component: _import("goods/grounding/index")
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* @Last Modified time: 2020-11-15 10:22:06 * @Last Modified time: 2020-11-15 10:22:06
*/ */
import { getChannelType, getProductType } from "@/api/sys.base" import { getChannelType, getProductType, getPositionList } from "@/api/sys.base"
// import { // import {
// BaseData // BaseData
// } from '@/common/constants' // } from '@/common/constants'
...@@ -19,7 +19,9 @@ export default { ...@@ -19,7 +19,9 @@ export default {
// 渠道类型 // 渠道类型
channelType: [], channelType: [],
// 产品分类 // 产品分类
productType: [] productType: [],
// 太阳膜类商品部位
positionTypeList: []
}, },
actions: { actions: {
/** /**
...@@ -29,10 +31,15 @@ export default { ...@@ -29,10 +31,15 @@ export default {
*/ */
init({ state, dispatch, commit }) { init({ state, dispatch, commit }) {
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
Promise.all([getChannelType({}), getProductType({})]).then( Promise.all([getChannelType({}), getProductType({}), getPositionList({})]).then(
async ([channelType, productType]) => { async ([channelType, productType, positionTypeList]) => {
positionTypeList?.forEach(val => { // 之前前端写死的数据 数据整理 不用改动很多
val.position = val.positionValue
val.confName = val.positionName
})
state.channelType = channelType state.channelType = channelType
state.productType = productType state.productType = productType
state.positionTypeList = positionTypeList
// console.log(productType, "productType") // console.log(productType, "productType")
await dispatch("save2db", { await dispatch("save2db", {
name: "", name: "",
...@@ -49,6 +56,7 @@ export default { ...@@ -49,6 +56,7 @@ export default {
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
state.channelType = [] state.channelType = []
state.productType = [] state.productType = []
state.positionTypeList = []
await dispatch("save2db", { await dispatch("save2db", {
name: "", name: "",
value: state value: state
...@@ -101,8 +109,8 @@ export default { ...@@ -101,8 +109,8 @@ export default {
state = state =
(await dispatch("getFromdb", "base")) || (await dispatch("init")) (await dispatch("getFromdb", "base")) || (await dispatch("init"))
} }
const { channelType, productType } = state const { channelType, productType, positionTypeList } = state
resolve({ channelType, productType }) resolve({ channelType, productType, positionTypeList })
}) })
}, },
/** /**
......
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
try { try {
// debugger // debugger
console.log(state, dispatch) // console.log(state, dispatch)
// 设置数据 // 设置数据
dispatch( dispatch(
"d2admin/db/set", "d2admin/db/set",
......
...@@ -20,6 +20,12 @@ ...@@ -20,6 +20,12 @@
{{ $$(detail.subOrder,'upgradeGoodsName') }} {{ $$(detail.subOrder,'upgradeGoodsName') }}
</td> </td>
<td class="lb"> <td class="lb">
部位
</td>
<td class="lb">
{{ $$(detail.subOrder,'positionStr') }}
</td>
<td class="lb">
商品别名 商品别名
</td> </td>
<td class="lb"> <td class="lb">
...@@ -39,11 +45,11 @@ ...@@ -39,11 +45,11 @@
数量 数量
</td> </td>
<td>{{ $$(detail.subOrder,'number') }}件</td> <td>{{ $$(detail.subOrder,'number') }}件</td>
<td rowspan="2" <td rowspan="2" colspan="2"
class="lb"> class="lb">
支付金额 支付金额
</td> </td>
<td rowspan="2"> <td rowspan="2" colspan="2">
{{ detail.totalPrice ? '¥ ' + detail.totalPrice : '' }} {{ detail.totalPrice ? '¥ ' + detail.totalPrice : '' }}
</td> </td>
</tr> </tr>
...@@ -344,7 +350,7 @@ ...@@ -344,7 +350,7 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { Util, deepClone } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { shop4sDeductChargeFlagObj, partnerDeductChargeFlagObj, payType, sceneType, proportionType, targetType } from '@/common/constants' import { shop4sDeductChargeFlagObj, partnerDeductChargeFlagObj, payType, sceneType, proportionType, targetType, BaseData } from '@/common/constants'
import { mainOrderDetail, subOrderDetail } from '@api/finance' import { mainOrderDetail, subOrderDetail } from '@api/finance'
export default { export default {
name: 'FinanceDetail', name: 'FinanceDetail',
...@@ -382,21 +388,24 @@ export default { ...@@ -382,21 +388,24 @@ export default {
// shop4sDeductChargeFlagObj: shop4sDeductChargeFlagObj, // shop4sDeductChargeFlagObj: shop4sDeductChargeFlagObj,
// partnerDeductChargeFlagObj: partnerDeductChargeFlagObj, // partnerDeductChargeFlagObj: partnerDeductChargeFlagObj,
ledgerData: [], // 分账信息 ledgerData: [], // 分账信息
reconciliationData: [] // 对账信息 reconciliationData: [], // 对账信息
positionTypeList: [] // 商品部位字典
} }
}, },
mounted() { mounted() {
const row = this.$route.params.rowInfo const row = this.$route.params.rowInfo
console.log(row) this.getBaseData()
this.isSubOrder = !row.hasOwnProperty('subOrderProfitAllocations') this.isSubOrder = !row.hasOwnProperty('subOrderProfitAllocations')
this.getDetail(row) this.getDetail(row)
}, },
methods: { methods: {
...mapActions({ close: 'd2admin/page/close' }), ...mapActions({ close: 'd2admin/page/close' }),
...mapActions("d2admin/base", ["get"]),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getDetail(row) { getDetail(row) {
if (this.$route.params.from && this.$route.params.from == 'orderSupplement') { // 从待补录订单列表跳转过来 if (this.$route.params.from && this.$route.params.from == 'orderSupplement') { // 从待补录订单列表跳转过来
mainOrderDetail({ orderCode: row.inputtedOrderCode }).then(res => { mainOrderDetail({ orderCode: row.inputtedOrderCode }).then(res => {
...@@ -422,6 +431,7 @@ export default { ...@@ -422,6 +431,7 @@ export default {
if (res.goodsOrder?.payOrder?.successDate) { if (res.goodsOrder?.payOrder?.successDate) {
res.goodsOrder.payOrder.successDate = Util.dateFormate(res.goodsOrder.payOrder.successDate, 'YYYY-MM-DD HH:mm:ss') res.goodsOrder.payOrder.successDate = Util.dateFormate(res.goodsOrder.payOrder.successDate, 'YYYY-MM-DD HH:mm:ss')
} }
if (res.subOrder) res.subOrder.positionStr = this.positionTypeList?.filter(val => val.position == res.subOrder?.upgradeGoodsPosition)[0]?.confName || '-'
this.detail = res this.detail = res
const calculateds = res.expenseCategoryCalculateds const calculateds = res.expenseCategoryCalculateds
if (calculateds && calculateds.length > 0) { if (calculateds && calculateds.length > 0) {
...@@ -502,7 +512,7 @@ export default { ...@@ -502,7 +512,7 @@ export default {
background-color: #fafafa; background-color: #fafafa;
} }
&.lb { &.lb {
width: 6em; width: 6.5em;
text-align: center; text-align: center;
background-color: #fafafa; background-color: #fafafa;
} }
......
...@@ -248,6 +248,13 @@ ...@@ -248,6 +248,13 @@
<span>{{ scope.row.goodsName || '-' }}</span> <span>{{ scope.row.goodsName || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodsName"
label="部位"
align="center">
<template slot-scope="scope">
<span>{{ scope.row.positionStr || '-' }}</span>
</template>
</el-table-column>
<el-table-column prop="upgradeGoodsAlias" <el-table-column prop="upgradeGoodsAlias"
label="商品别名" label="商品别名"
align="center"> align="center">
...@@ -791,7 +798,8 @@ export default { ...@@ -791,7 +798,8 @@ export default {
shopProfitType_visible: true, // 列表字段:流量方比例 shopProfitType_visible: true, // 列表字段:流量方比例
yq_visible: true, // 列表字段:园区店 yq_visible: true, // 列表字段:园区店
/** 根据场景控制页面显示隐藏end */ /** 根据场景控制页面显示隐藏end */
sceneList: sceneList sceneList: sceneList,
positionTypeList: [] // 商品部位数据
} }
}, },
...@@ -930,6 +938,7 @@ export default { ...@@ -930,6 +938,7 @@ export default {
...mapActions("d2admin/base", ["get"]), ...mapActions("d2admin/base", ["get"]),
async getBaseData() { async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType) this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.getOptionsList() this.getOptionsList()
}, },
handleAddClose(isRefresh = false) { }, handleAddClose(isRefresh = false) { },
...@@ -1018,7 +1027,7 @@ export default { ...@@ -1018,7 +1027,7 @@ export default {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
if ( if (
this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部' this.baseData[item.optionsName]?.length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部'
) { ) {
const temp = {} const temp = {}
temp[this.showFormData[index].optionId] = '' temp[this.showFormData[index].optionId] = ''
...@@ -1078,6 +1087,7 @@ export default { ...@@ -1078,6 +1087,7 @@ export default {
item.subOrderProfitAllocations.forEach(subItem => { item.subOrderProfitAllocations.forEach(subItem => {
subItem.uniqueKey = temp++ subItem.uniqueKey = temp++
subItem = this.numAddPrefix(subItem) subItem = this.numAddPrefix(subItem)
subItem.positionStr = this.positionTypeList?.filter(val => val.position == subItem.goodsPosition)[0]?.confName || '-'
}) })
} }
item = this.numAddPrefix(item) item = this.numAddPrefix(item)
......
<template>
<d2-dialog title="批量复制"
:is-visible.sync="batchCopyVisible"
width="600px"
btn-ok-label="确定"
@confirmDialog="handleBatchCopyConfirm"
@closeDialog="handleBatchCopyClose"
class="relateStore">
<el-form label-width="120px" :rules="rules" :model="selectData" ref="batchCopyForm">
<el-form-item label="业务场景:">
<el-input style="width: 370px;" v-model="sceneList[selectedScene]" disabled></el-input>
</el-form-item>
<el-form-item label="复制门店:" prop="selectMerchantObj">
<el-select v-model="selectData.selectMerchantObj" remote reserve-keyword
placeholder="请选择复制门店" @visible-change="visibleChange" :remote-method="remoteMethod"
v-el-select-loadmore="interestsLoadmore" style="width: 370px;" value-key="merchantId" filterable>
<el-option v-for="subItem in storeData" :key="subItem.merchantId"
:label="subItem.merchantName" :value="subItem" />
</el-select>
</el-form-item>
</el-form>
<div class="tips">
说明:批量复制至新门店后,系统自动按操作商品,自动更新补充商品对应的上架门店
</div>
</d2-dialog>
</template>
<script>
import { getList, getAccountMerchantList } from '@/api/merchant'
import { sceneList } from '@/common/constants.js'
export default {
name: 'RelateStoreDialog',
data() {
return {
storeData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20,
searchMerchantName: '',
sceneList,
selectData: {},
rules: {selectMerchantObj: [{ required: true, message: '请选择复制门店', trigger: 'blur' }]}
}
},
directives: {
'el-select-loadmore': {
bind(el, binding) {
setTimeout(() => {
const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap'
)
SELECTWRAP_DOM.addEventListener('scroll', function () {
const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}, 100)
}
}
},
props: {
batchCopyVisible: {
type: Boolean,
default: false
},
selectedScene: {
type: Number
}
},
mounted() {
this.getList()
},
methods: {
getList() {
let storeApi = this.selectedScene == 2 ? getAccountMerchantList : getList // 会员权益场景 上架门店是账户中心所有门店
storeApi({
merchantName: this.searchMerchantName,
currentPage: this.currentPage,
pageSize: this.pageSize,
scene: this.selectedScene ? this.selectedScene : ''
}).then(res => {
res?.list?.forEach(val => { // 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo) val.merchantId = val.merchantNo
})
this.storeData = this.storeData.concat(res.list)
})
},
// 获取上架门店
remoteMethod(query) {
this.searchMerchantName = query
this.currentPage = 1
this.storeData = []
this.getList() // 请求接口
},
visibleChange(data) {
// 获取焦点重新渲染下拉框数据
if (data) {
if (this.searchMerchantName) {
this.searchMerchantName = ''
this.currentPage = 1
this.storeData = []
this.getList()
}
}
},
// 获取更多上架门店
interestsLoadmore() {
setTimeout(() => {
this.currentPage = this.currentPage + 1
if (this.allPages < this.currentPage) {
this.currentPage = this.allPages
return
}
this.getList()
}, 10)
},
handleBatchCopyConfirm() {
this.$refs['batchCopyForm'].validate((valid) => {
console.log(valid)
if (valid) {
this.$emit('handleBatchCopyConfirm', this.selectData?.selectMerchantObj)
}
})
},
handleBatchCopyClose() {
this.$emit('handleBatchCopyClose')
}
}
}
</script>
<style lang="scss">
.tips{
font-size: 14px;
color: #999;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -237,7 +237,7 @@ export default { ...@@ -237,7 +237,7 @@ export default {
// 1 太阳膜 2 (1.3场景商品) // 1 太阳膜 2 (1.3场景商品)
let shopType = formData?.goodsType == 1 ? '1' : formData?.sceneType == 3 ? '2' : '' let shopType = formData?.goodsType == 1 ? '1' : formData?.sceneType == 3 ? '2' : ''
let shopForm = deepClone(copyFormList[0].formBlock) let shopForm = deepClone(copyFormList[0].formBlock)
let spliceForm = shopType == '1' ? ['giftCost', 'recoveryCost', 'virtualAccountCost'] : shopType == '2' ? ['productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost'] : ['productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'upgradeSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost'] let spliceForm = shopType == '1' ? ['giftCost', 'recoveryCost', 'virtualAccountCost'] : shopType == '2' ? ['positionStr', 'productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost'] : ['positionStr', 'productTypeStr', 'warrantyTypeStr', 'baseSupplyModeStr', 'upgradeSupplyModeStr', 'giftCost', 'recoveryCost', 'virtualAccountCost']
// 未勾选基础商品类型 // 未勾选基础商品类型
if (!this.formData.productType?.includes(1)) spliceForm.push('baseSupplyModeStr') if (!this.formData.productType?.includes(1)) spliceForm.push('baseSupplyModeStr')
// 赠送成本:仅产品类型选择“基础产品”时展示 // 赠送成本:仅产品类型选择“基础产品”时展示
......
...@@ -14,8 +14,21 @@ ...@@ -14,8 +14,21 @@
<div style="padding: 20px;"> <div style="padding: 20px;">
<div v-for="(item, index) in i.formBlock" :key="index" > <div v-for="(item, index) in i.formBlock" :key="index" >
<!-- 单选 --> <!-- 单选 -->
<!-- 太阳膜类商品 上架部位 -->
<div v-if="item.type === 'radio' && formData['goodsType'] == 1 && !item.index">
<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'}">
<el-radio-group v-model="formData[item.name]">
<el-radio v-for="(subItem, subIndex) in item.radioGroupList" :key="subIndex" :label="subItem.confId">{{ subItem.confName }}</el-radio>
</el-radio-group>
</el-form-item>
</div>
<!-- 1.3场景显示升级/产品供货模式 --> <!-- 1.3场景显示升级/产品供货模式 -->
<div v-if="item.type === 'radio' && ((formData['productType'] && formData['productType'].includes(item.index)) || ((formData['goodsType'] && formData['goodsType'] != 1) && (formData['sceneType'] && formData['sceneType'] == 3)))"> <div v-if="item.type === 'radio' && item.index && ((formData['productType'] && formData['productType'].includes(item.index)) || ((formData['goodsType'] && formData['goodsType'] != 1) && (formData['sceneType'] && formData['sceneType'] == 3)))">
<el-form-item :prop="item.name" <el-form-item :prop="item.name"
:label="item.label ? item.label + ':' : ''" :label="item.label ? item.label + ':' : ''"
:id="item.name" :id="item.name"
...@@ -213,17 +226,23 @@ ...@@ -213,17 +226,23 @@
v-if="filterEmpty(formData.status) || formData.status == 3"> v-if="filterEmpty(formData.status) || formData.status == 3">
存草稿 存草稿
</el-button> </el-button>
<el-button type="primary"
v-if="addOrEdit == 'add'"
@click="handleUp(3)"
:disabled="$store.state.d2admin.loading.value">
保存并继续新增
</el-button>
<el-button class="width_100 cancel-btn" @click="handleClose"> <el-button class="width_100 cancel-btn" @click="handleClose">
取消 取消
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- store-api (1精品升级 2次新车转化 3售后众筹 查询嘀加的门店数据 getList)(0会员/权益升级 查询账户中心所有4s店 serviceGetMerchantList) --> <!-- store-api (1精品升级 2次新车转化 3售后众筹 查询嘀加的门店数据 getList)(0会员/权益升级 查询账户中心所有4s店 getAccountMerchantList) -->
<relate-store-dialog <relate-store-dialog
v-if="relateStoreVisible" v-if="relateStoreVisible"
ref="formRelateStore" ref="formRelateStore"
:relate-store-visible="relateStoreVisible" :relate-store-visible="relateStoreVisible"
:store-api="formData.sceneType ? getList : serviceGetMerchantList" :store-api="formData.sceneType ? getList : getAccountMerchantList"
:store-search-form="storeSearchForm" :store-search-form="storeSearchForm"
:store-selected="storeSelected" :store-selected="storeSelected"
:selected-scene="formData.sceneType" :selected-scene="formData.sceneType"
...@@ -248,6 +267,20 @@ ...@@ -248,6 +267,20 @@
@keydown.native="handleStoreInput" @keydown.native="handleStoreInput"
clearable /> clearable />
</el-form-item> </el-form-item>
<el-form-item label="服务对接:">
<el-input
v-model.trim="storeSearchForm.yqMerchantName"
placeholder="服务对接"
@keydown.native="handleStoreInput"
clearable />
</el-form-item>
<el-form-item label="服务对接商户号:">
<el-input
v-model.trim="storeSearchForm.yqMerchantId"
placeholder="服务对接商户号"
@keydown.native="handleStoreInput"
clearable />
</el-form-item>
<el-button type="primary" @click="handleSearchStore">搜索</el-button> <el-button type="primary" @click="handleSearchStore">搜索</el-button>
</el-form> </el-form>
</el-row> </el-row>
...@@ -266,12 +299,13 @@ import { limitPrice } from '@/common/format' ...@@ -266,12 +299,13 @@ import { limitPrice } from '@/common/format'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { uploadImg, uploadPDF } from '@/api/sys.base' import { uploadImg, uploadPDF } from '@/api/sys.base'
// import { getSceneTypeListByMerchantId } from '@api/grounding' // import { getSceneTypeListByMerchantId } from '@api/grounding'
import { positionTypeList, membraneTypeList } from '@/common/constants.js' import { membraneTypeList } from '@/common/constants.js'
import { upgradeSupplyModeList, crowdUpgradeSupplyModeList } from "../constants/data" import { upgradeSupplyModeList, crowdUpgradeSupplyModeList } from "../constants/data"
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import relateStoreDialog from "./relateStoreDialog.vue" import relateStoreDialog from "./relateStoreDialog.vue"
import relateStoreTable from './relateStoreTable.vue' import relateStoreTable from './relateStoreTable.vue'
import { getList, serviceGetMerchantList } from '@/api/merchant' import { getList, getAccountMerchantList } from '@/api/merchant'
import { BaseData } from '../../../../common/constants'
export default { export default {
name: 'groundingForm', name: 'groundingForm',
components: { components: {
...@@ -282,7 +316,7 @@ export default { ...@@ -282,7 +316,7 @@ export default {
data() { data() {
return { return {
getList, getList,
serviceGetMerchantList, getAccountMerchantList,
equitySceneType: baseConfig.equitySceneType || [], equitySceneType: baseConfig.equitySceneType || [],
membraneTypeList, membraneTypeList,
formData: {}, formData: {},
...@@ -295,6 +329,7 @@ export default { ...@@ -295,6 +329,7 @@ export default {
merchantGoodsRefList: [{ required: true, message: '请选择上架门店', trigger: 'change' }], merchantGoodsRefList: [{ required: true, message: '请选择上架门店', trigger: 'change' }],
sceneType: [{ required: true, message: '请选择业务场景', trigger: 'change' }], sceneType: [{ required: true, message: '请选择业务场景', trigger: 'change' }],
upgradeGoodsId: [{ required: true, message: '请选择上架商品', trigger: 'change' }], upgradeGoodsId: [{ required: true, message: '请选择上架商品', trigger: 'change' }],
position: [{ required: true, message: '请选择上架部位', trigger: 'change' }],
productType: [{ required: true, message: '请选择产品类型', trigger: 'change' }], productType: [{ required: true, message: '请选择产品类型', trigger: 'change' }],
baseSupplyMode: [{ required: true, message: '请选择基础产品供货模式', trigger: 'change' }], baseSupplyMode: [{ required: true, message: '请选择基础产品供货模式', trigger: 'change' }],
upgradeSupplyMode: [{ required: true, message: '请选择升级/产品供货模式', trigger: 'change' }], upgradeSupplyMode: [{ required: true, message: '请选择升级/产品供货模式', trigger: 'change' }],
...@@ -329,14 +364,17 @@ export default { ...@@ -329,14 +364,17 @@ export default {
relateStoreVisible: false, relateStoreVisible: false,
storeSearchForm: { storeSearchForm: {
merchantName: '', merchantName: '',
merchantId: '' merchantId: '',
yqMerchantName: '',
yqMerchantId: ''
}, },
selectDisabled: false, selectDisabled: false,
dialogObj: {}, dialogObj: {},
uploadFileList: [], uploadFileList: [],
imageFileArr: [], imageFileArr: [],
imgViewerVisible: false, imgViewerVisible: false,
initialIndex: 0 initialIndex: 0,
positionTypeList: []
} }
}, },
...@@ -428,6 +466,7 @@ export default { ...@@ -428,6 +466,7 @@ export default {
}, },
mounted() { mounted() {
this.getBaseData()
this.formData = deepClone(this.originData) this.formData = deepClone(this.originData)
this.copyFormList = deepClone(this.formList) this.copyFormList = deepClone(this.formList)
this.filterEditForm() this.filterEditForm()
...@@ -437,6 +476,9 @@ export default { ...@@ -437,6 +476,9 @@ export default {
...mapActions({ ...mapActions({
get: 'd2admin/base/get' get: 'd2admin/base/get'
}), }),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
handleFileChange(e, targetItem) { handleFileChange(e, targetItem) {
setTimeout(() => { setTimeout(() => {
var reader = new FileReader() var reader = new FileReader()
...@@ -545,14 +587,20 @@ export default { ...@@ -545,14 +587,20 @@ export default {
this.$set(this.formList[0], 'formBlock', newForm) this.$set(this.formList[0], 'formBlock', newForm)
this.$nextTick(() => { this.$nextTick(() => {
// 1.3场景 升级产品供货模式 // 1.3场景 升级产品供货模式
const formIndex = this.formList[0].formBlock.findIndex(subItem => subItem.name == 'upgradeSupplyMode')
if (formData.sceneType == 3) { if (formData.sceneType == 3) {
this.$set(this.formList[0].formBlock[3], 'radioGroupList', crowdUpgradeSupplyModeList) if (formIndex >= 0) this.$set(this.formList[0].formBlock[formIndex], 'radioGroupList', crowdUpgradeSupplyModeList)
} }
// 太阳膜类 升级产品供货模式(优先级高) // 太阳膜类 升级产品供货模式(优先级高)
if (shopType == 1) { if (shopType == 1) {
// 由1.3场景 切换到太阳膜 已选升级供货模式为2 的清除掉 太阳膜供货模式没有2 // 由1.3场景 切换到太阳膜 已选升级供货模式为2 的清除掉 太阳膜供货模式没有2
if (formData.upgradeSupplyMode == 2) this.formData.upgradeSupplyMode = '' if (formData.upgradeSupplyMode == 2) this.formData.upgradeSupplyMode = ''
this.$set(this.formList[0].formBlock[6], 'radioGroupList', upgradeSupplyModeList) if (formIndex > -1) this.$set(this.formList[0].formBlock[formIndex], 'radioGroupList', upgradeSupplyModeList)
// 上架部位
this.formData?.positionNamesArr?.forEach(val => {
val.confId = val.position
})
this.$set(this.formList[0].formBlock[this.formList[0].formBlock.findIndex(subItem => subItem.name == 'position')], 'radioGroupList', this.formData?.positionNamesArr || [])
} }
this.show = true this.show = true
this.$refs[this.formRef + 'd2FormRuleForm'] && this.$refs[this.formRef + 'd2FormRuleForm'].clearValidate() this.$refs[this.formRef + 'd2FormRuleForm'] && this.$refs[this.formRef + 'd2FormRuleForm'].clearValidate()
...@@ -629,13 +677,14 @@ export default { ...@@ -629,13 +677,14 @@ export default {
// 带出上架商品的附带信息 // 带出上架商品的附带信息
if (targetItem.name === 'upgradeGoodsId') { if (targetItem.name === 'upgradeGoodsId') {
let _valueObj = targetItem.optionList.filter(v => v.confId == value)[0]?.valueObj || {} let _valueObj = targetItem.optionList.filter(v => v.confId == value)[0]?.valueObj || {}
let _positionNamesArr = _valueObj?.goodsType == 1 ? deepClone(positionTypeList).filter(it => _valueObj?.position == it.position) : [] let _positionNamesArr = _valueObj?.goodsType == 1 ? deepClone(this.positionTypeList).filter(val => (_valueObj.position + '')?.includes(val.position)) : []
_formData.upgradeGoodsId = value _formData.upgradeGoodsId = value
_formData.upgradeGoodsName = _valueObj?.upgradeGoodsName _formData.upgradeGoodsName = _valueObj?.upgradeGoodsName
_formData.type = _valueObj?.type _formData.type = _valueObj?.type
_formData.upgradePrice = _valueObj?.upgradePrice _formData.upgradePrice = _valueObj?.upgradePrice
_formData.purchasePrice = _valueObj?.purchasePrice _formData.purchasePrice = _valueObj?.purchasePrice
_formData.positionNames = _positionNamesArr.length ? _positionNamesArr[0]?.confName : '' // 部位 _formData.positionNames = _positionNamesArr.length ? _positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' // 部位
_formData.positionNamesArr = _positionNamesArr
_formData.goodsName = _valueObj?.goodsName _formData.goodsName = _valueObj?.goodsName
_formData.goodsTypeName = _valueObj?.goodsTypeName _formData.goodsTypeName = _valueObj?.goodsTypeName
_formData.goodsType = _valueObj?.goodsType _formData.goodsType = _valueObj?.goodsType
...@@ -654,6 +703,13 @@ export default { ...@@ -654,6 +703,13 @@ export default {
if (targetItem.name === 'sceneType') { if (targetItem.name === 'sceneType') {
let _formData = this.formData let _formData = this.formData
if (!this.filterEmpty(this.oldSceneType)) { if (!this.filterEmpty(this.oldSceneType)) {
// 清空门店弹窗搜索条件
this.storeSearchForm = {
merchantName: '',
merchantId: '',
yqMerchantName: '',
yqMerchantId: ''
}
if (_formData.merchantGoodsRefList?.length) if (_formData.merchantGoodsRefList?.length)
this.$confirm('切换业务场景,将清空上架门店,是否继续', '提示', { this.$confirm('切换业务场景,将清空上架门店,是否继续', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
......
...@@ -29,6 +29,14 @@ ...@@ -29,6 +29,14 @@
label="门店商户号" label="门店商户号"
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column prop="yqMerchantName"
label="服务对接"
align="center">
</el-table-column>
<el-table-column prop="yqMerchantId"
label="服务对接商户号"
align="center">
</el-table-column>
</el-table> </el-table>
<el-pagination small <el-pagination small
background background
...@@ -120,18 +128,20 @@ export default { ...@@ -120,18 +128,20 @@ export default {
}) })
}, },
getSelectingList() { getSelectingList() {
let _storeSearchForm = this.storeSearchForm
if (!this.selectedScene) {
_storeSearchForm.merchantIdName = _storeSearchForm.merchantName // 账户中心所有门店接口查询条件
}
this.storeApi({ this.storeApi({
...this.storeSearchForm, ...this.storeSearchForm,
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
scene: this.selectedScene ? this.selectedScene : '' scene: this.selectedScene
}).then(res => { }).then(res => {
res?.list?.forEach(val => { // 账户中心门店返回商户号字段是merchantNo res?.list?.forEach(val => { // 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo) val.merchantId = val.merchantNo if (val.merchantNo) val.merchantId = val.merchantNo
val?.sceneList?.forEach(subVal => {
if (subVal.scene == this.selectedScene) {
val.yqMerchantId = subVal?.yqMerchant?.merchantId || '-'
val.yqMerchantName = subVal?.yqMerchant?.merchantName || '-'
}
})
}) })
this.selectingData = res.list this.selectingData = res.list
this.total = res.total this.total = res.total
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
</template> </template>
<script> <script>
import { productList, baseSupplyModeList, upgradeSupplyModeList } from "./constants/data" import { productList, baseSupplyModeList, upgradeSupplyModeList } from "./constants/data"
import { getMerchantGoodsInfo, addOrUpdateAPI, getAllGoodsList } from '@api/grounding' import { getMerchantGoodsInfo, addOrUpdateAPI, getAllGoodsList, checkGroundingLog } from '@api/grounding'
import groundingForm from "./components/groundingForm.vue" import groundingForm from "./components/groundingForm.vue"
import { positionTypeList, 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 } from '@/common/util'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
...@@ -71,6 +71,11 @@ export default { ...@@ -71,6 +71,11 @@ export default {
value: 'upgradeCommodityCode' value: 'upgradeCommodityCode'
}] }]
}, { }, {
name: 'position',
label: '上架部位',
type: 'radio',
radioGroupList: []
}, {
name: 'goodsAlias', name: 'goodsAlias',
label: '商品别名', label: '商品别名',
type: 'input', type: 'input',
...@@ -208,6 +213,7 @@ export default { ...@@ -208,6 +213,7 @@ export default {
// 获取全部上架商品 // 获取全部上架商品
this.getSelectingList() this.getSelectingList()
} else { } else {
this.addOrEdit = 'edit'
// 获取商品详情 // 获取商品详情
this.getDetailInfo(id) this.getDetailInfo(id)
} }
...@@ -297,16 +303,18 @@ export default { ...@@ -297,16 +303,18 @@ export default {
const res = new Map() const res = new Map()
return arr.filter((a) => !res.has(a.confId) && res.set(a.confId, 1)) return arr.filter((a) => !res.has(a.confId) && res.set(a.confId, 1))
}, },
getBaseData() { async getBaseData() {
this.editForm.forEach(item => { this.editForm.forEach(item => {
item.formBlock && item.formBlock.forEach(v => { item.formBlock && item.formBlock.forEach(v => {
if (v.type == 'check') { if (v.type == 'check') {
v.checkGroupList = productList // 产品类型 v.checkGroupList = productList // 产品类型
} else if (v.type == 'radio') { } else if (v.type == 'radio') {
if (v.index == '1') { if (v.index == 1) {
v.radioGroupList = baseSupplyModeList // 基础供货模式 v.radioGroupList = baseSupplyModeList // 基础供货模式
} else { } else if (v.index == 2) {
v.radioGroupList = upgradeSupplyModeList // 升级供货模式 v.radioGroupList = upgradeSupplyModeList // 升级供货模式
} else {
v.radioGroupList = []
} }
} }
if (v.name == 'sceneType') { // 业务场景 if (v.name == 'sceneType') { // 业务场景
...@@ -314,16 +322,18 @@ export default { ...@@ -314,16 +322,18 @@ export default {
} }
}) })
}) })
this.positionTypeList = await this.get(BaseData.positionTypeList)
}, },
getDetailInfo(id) { getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then(res => { getMerchantGoodsInfo({ id }).then(res => {
const productType = [] const productType = []
const positionNamesArr = res?.goodsType == 1 ? deepClone(positionTypeList).filter(val => res.upgradeGoods.position == val.position) : [] const positionNamesArr = res?.goodsInfo?.goodsType == 1 ? (deepClone(this.positionTypeList)?.filter(val => (res?.upgradeGoods.position + '').includes(val.position)) || []) : []
if (res?.upgradeProductFlag == 'Y') productType.push(2) if (res?.upgradeProductFlag == 'Y') productType.push(2)
if (res?.baseProductFlag == 'Y') productType.push(1) if (res?.baseProductFlag == 'Y') productType.push(1)
res.productType = productType // 产品类型 res.productType = productType // 产品类型
res.upgradePrice = res.upgradeGoods?.upgradePrice // 参考售价 res.upgradePrice = res.upgradeGoods?.upgradePrice // 参考售价
res.positionNames = positionNamesArr.length ? positionNamesArr[0]?.confName : '' // 部位 res.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' // 部位
res.positionNamesArr = positionNamesArr
res.purchasePrice = res.upgradeGoods?.purchasePrice // 采购价价 res.purchasePrice = res.upgradeGoods?.purchasePrice // 采购价价
res.upgradeCommodityCode = res?.upgradeCommodityCode // 商品ID res.upgradeCommodityCode = res?.upgradeCommodityCode // 商品ID
res.warrantyPeriod = res?.upgradeGoods?.warrantyPeriod // 质保年限 res.warrantyPeriod = res?.upgradeGoods?.warrantyPeriod // 质保年限
...@@ -358,7 +368,7 @@ export default { ...@@ -358,7 +368,7 @@ export default {
const { num } = data const { num } = data
this.confirm(num, data) this.confirm(num, data)
}, },
confirm(num, data) { confirm(num, data, existCheck = true) {
// 1保存并上架 2存草稿 // 1保存并上架 2存草稿
const formObj = {} const formObj = {}
this.editForm.forEach(val => { this.editForm.forEach(val => {
...@@ -390,31 +400,79 @@ export default { ...@@ -390,31 +400,79 @@ export default {
// 整理上传凭证数据 // 整理上传凭证数据
delete formObj?.productType delete formObj?.productType
const params = { const params = {
saveDraft: num !== 1, saveDraft: num === 2, // 是否存草稿
id: data.id, id: data.id,
...formObj, ...formObj,
merchantGoodsRefList: arr, merchantGoodsRefList: arr,
voucherList: fileArr voucherList: fileArr,
existCheck
}
if (data?.goodsType == 1 && data?.sceneType != 1) return this.$message.error('太阳膜类商品仅支持上架至精品升级场景')
this.editData = data
let checkParams = {
id: data.id || '',
upgradeGoodsId: formObj.upgradeGoodsId,
position: formObj.position || '',
sceneType: formObj.sceneType,
merchantIdList: arr?.map(val => {return val.merchantId})
} }
if (num == 1 && !baseConfig.supplierCode.includes(data.supplierCode)) { // 第三方商品无需走审核流程不用提示 if ((num == 1 || num == 3) && !baseConfig.supplierCode.includes(data.supplierCode)) { // 第三方商品无需走审核流程不用提示
this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', { this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
addOrUpdateAPI(this.dealObjectValue(params)).then(res => { // 校验上架记录中是否已存在
this.notice.okTips() this.checkEvent(checkParams, params, num)
this.handleClose(true)
})
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
} else { } else {
addOrUpdateAPI(this.dealObjectValue(params)).then(res => { // 校验上架记录中是否已存在
this.notice.okTips() this.checkEvent(checkParams, params, num)
this.handleClose(true) }
}) },
checkEvent(checkParams, params, num) {
checkGroundingLog(this.dealObjectValue(checkParams)).then(res => {
if (res >= 1) {
this.$confirm('当前商品在对应门店已存在上架记录,是否确定保存?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
this.confirmEvent(params, num)
})
} else {
this.confirmEvent(params, num)
}
})
},
confirmEvent(params, num) {
let obj = { // 商品信息
position: '',
goodsAlias: '',
warrantyType: '',
productType: [],
baseSupplyMode: '',
upgradeSupplyMode: '',
sellPrice: '',
minSellPrice: '',
upgradeProductCost: '',
giftCost: '',
recoveryCost: '',
virtualAccountCost: ''
} }
addOrUpdateAPI(this.dealObjectValue(params)).then(res => {
this.notice.okTips()
if (num == 3) {
// 保留 上架商品和上架门店上架凭证数据
this.editData = {
...this.editData,
...obj
}
} else { // 保存后跳转列表页
this.handleClose(true)
}
})
}, },
dealObjectValue(obj) { dealObjectValue(obj) {
var param = {} var param = {}
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<script> <script>
import { getMerchantGoodsInfo, batchReviewAPI } from '@api/grounding' import { getMerchantGoodsInfo, batchReviewAPI } from '@api/grounding'
import detail from './components/detail.vue' import detail from './components/detail.vue'
import { sceneList, positionTypeList } from '@/common/constants.js' import { sceneList, BaseData } from '@/common/constants.js'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { deepClone, Util } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { productList, baseSupplyModeList, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from './constants/data' import { productList, baseSupplyModeList, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from './constants/data'
...@@ -72,6 +72,9 @@ export default { ...@@ -72,6 +72,9 @@ export default {
value: 'upgradeCommodityCode' value: 'upgradeCommodityCode'
}] }]
}, { }, {
name: 'positionStr',
label: '上架部位'
}, {
name: 'goodsAlias', name: 'goodsAlias',
label: '商品别名' label: '商品别名'
}, { }, {
...@@ -144,6 +147,7 @@ export default { ...@@ -144,6 +147,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.getBaseData()
// 获取商品详情 // 获取商品详情
const id = this.$route.params.id const id = this.$route.params.id
this.detailId = id this.detailId = id
...@@ -155,6 +159,9 @@ export default { ...@@ -155,6 +159,9 @@ export default {
get: 'd2admin/base/get', get: 'd2admin/base/get',
close: 'd2admin/page/close' close: 'd2admin/page/close'
}), }),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getDetailInfo(id) { getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then(res => { getMerchantGoodsInfo({ id }).then(res => {
const productType = [] const productType = []
...@@ -162,7 +169,7 @@ export default { ...@@ -162,7 +169,7 @@ export default {
if (res?.baseProductFlag == 'Y') productType.push(1) if (res?.baseProductFlag == 'Y') productType.push(1)
const productTypeTextArr = [] const productTypeTextArr = []
// 太阳膜回显 部位 // 太阳膜回显 部位
const positionNamesArr = res?.goodsType == 1 ? deepClone(positionTypeList).filter(val => res.upgradeGoods.position == val.position) : [] const positionNamesArr = res?.goodsInfo?.goodsType == 1 ? (deepClone(this.positionTypeList)?.filter(val => (res?.upgradeGoods.position + '').includes(val.position)) || []) : []
// 产品类型 // 产品类型
productList.forEach(v => { productList.forEach(v => {
if (productType.includes(v.confId)) productTypeTextArr.push(v.confName) if (productType.includes(v.confId)) productTypeTextArr.push(v.confName)
...@@ -184,7 +191,7 @@ export default { ...@@ -184,7 +191,7 @@ export default {
res.sceneName = sceneList[res.sceneType] || '-' res.sceneName = sceneList[res.sceneType] || '-'
res.upgradePrice = res.upgradeGoods?.upgradePrice res.upgradePrice = res.upgradeGoods?.upgradePrice
res.purchasePrice = res.upgradeGoods?.purchasePrice res.purchasePrice = res.upgradeGoods?.purchasePrice
res.positionNames = positionNamesArr.length ? positionNamesArr[0]?.confName : '' res.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' // 部位
res.productType = productType res.productType = productType
res.serviceItemNames = res.upgradeGoods?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',') res.serviceItemNames = res.upgradeGoods?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',')
res.warrantyPeriod = res.upgradeGoods?.warrantyPeriod res.warrantyPeriod = res.upgradeGoods?.warrantyPeriod
...@@ -193,6 +200,7 @@ export default { ...@@ -193,6 +200,7 @@ export default {
res.thirdPartyCode = res?.upgradeGoods?.thirdPartyCode || '' res.thirdPartyCode = res?.upgradeGoods?.thirdPartyCode || ''
res.entityCardFlag = res?.upgradeGoods?.entityCardFlag res.entityCardFlag = res?.upgradeGoods?.entityCardFlag
res.voucherList = res?.voucherList || [] res.voucherList = res?.voucherList || []
res.positionStr = deepClone(this.positionTypeList)?.filter(val => res?.position == val.position)[0]?.confName || ''
this.editData = res || {} this.editData = res || {}
this.$nextTick(() => { this.$nextTick(() => {
this.show = true this.show = true
......
...@@ -38,6 +38,10 @@ ...@@ -38,6 +38,10 @@
<span style="{display: inline-block};margin-left: 10px"> <span style="{display: inline-block};margin-left: 10px">
<auth-button category="Button" :show-btn-ids="['9030908']" /> <auth-button category="Button" :show-btn-ids="['9030908']" />
</span> </span>
<!-- 批量复制 -->
<span style="{display: inline-block};margin-left: 10px">
<auth-button category="Button" :show-btn-ids="['9030909']" />
</span>
<!-- 导出 --> <!-- 导出 -->
<span style="{display: inline-block};margin-left: 10px"> <span style="{display: inline-block};margin-left: 10px">
<auth-button category="Button" :show-btn-ids="['9030902']" /> <auth-button category="Button" :show-btn-ids="['9030902']" />
...@@ -120,19 +124,29 @@ ...@@ -120,19 +124,29 @@
</div> </div>
</d2-table> </d2-table>
</div> </div>
<batch-copy-dialog
v-if="batchCopyVisible"
ref="formBatchCopy"
:batch-copy-visible="batchCopyVisible"
:selected-scene="batchCopySelectScene"
@handleBatchCopyConfirm="handleBatchCopyConfirm"
@handleBatchCopyClose="handleBatchCopyClose">
</batch-copy-dialog>
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { getProductTypeBySceneId, getList } from '@api/product' import { getProductTypeBySceneId, getList } from '@api/product'
import { getGroundingManageList, updateGoodsStatus, batchReviewAPI, delGroundingById, batchUpdateStatus } from '@api/grounding' import { getGroundingManageList, updateGoodsStatus, batchReviewAPI, delGroundingById, batchUpdateStatus, batchUpdateBatchCopy } from '@api/grounding'
import { deepClone, Util } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { sceneCodeList, sceneList } from '@/common/constants.js' import { sceneCodeList, sceneList, BaseData } from '@/common/constants.js'
import { getParkStore } from '@api/editCustomer' import { getParkStore } from '@api/editCustomer'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { baseSupplyModeList, upgradeSupplyModeList } from './constants/data' import { baseSupplyModeList, upgradeSupplyModeList } from './constants/data'
import { getShopMerchantList } from '@api/deviceManage' import { getShopMerchantList } from '@api/deviceManage'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import batchCopyDialog from './components/batchCopyDialog.vue'
export default { export default {
components: { batchCopyDialog },
name: 'groundingIndex', name: 'groundingIndex',
data() { data() {
return { return {
...@@ -335,6 +349,14 @@ export default { ...@@ -335,6 +349,14 @@ export default {
prop: 'goodsTypeName', prop: 'goodsTypeName',
width: 140 width: 140
}, { }, {
label: '上架部位',
parentProp: 'goodsInfo',
prop: 'position',
width: 140,
formatter: (cellValue) => {
return deepClone(this.positionTypeList)?.filter(val => cellValue?.position == val.position)[0]?.confName || '-'
}
}, {
label: '商品别名', label: '商品别名',
prop: 'goodsAlias', prop: 'goodsAlias',
formatter: (cellValue) => { formatter: (cellValue) => {
...@@ -444,10 +466,14 @@ export default { ...@@ -444,10 +466,14 @@ export default {
confValue: '已下架' confValue: '已下架'
}] }]
}, },
selfBuildGoodsType: baseConfig.selfBuildGoodsType || '' selfBuildGoodsType: baseConfig.selfBuildGoodsType || '',
batchCopySelectScene: '', // 批量复制选中的场景值
batchCopyVisible: false,
batchCopySelectData: [] // 批量辅助选中的上架数据
} }
}, },
mounted() { mounted() {
this.getBaseData()
var allOpt = { confId: '', confValue: '全部' } var allOpt = { confId: '', confValue: '全部' }
this.baseData.statusList.unshift(allOpt) this.baseData.statusList.unshift(allOpt)
this.baseData.sceneCodeList = deepClone(sceneCodeList) this.baseData.sceneCodeList = deepClone(sceneCodeList)
...@@ -488,6 +514,9 @@ export default { ...@@ -488,6 +514,9 @@ export default {
close: 'd2admin/page/close' close: 'd2admin/page/close'
}), }),
...mapActions('d2admin/user', ['actionSetDownloadList']), ...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getOptionsList() { getOptionsList() {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
...@@ -687,6 +716,39 @@ export default { ...@@ -687,6 +716,39 @@ export default {
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
},
// 批量复制
handleBatchCopy() {
let selectedData = []
if (this.$refs.groundingIndexTable.mutiSelectArr.groundingIndex) {
selectedData = this.$refs.groundingIndexTable.mutiSelectArr.groundingIndex
}
let sceneType = selectedData.map(v => { return v.sceneType }) || []
if (!selectedData.length) return this.$message.warning('请选择上架记录')
if (Array.from(new Set(sceneType))?.length > 1) {
return this.$message.warning('请选择同一业务场景的上架记录')
}
this.batchCopySelectData = selectedData || []
this.batchCopySelectScene = Array.from(new Set(sceneType))[0]
this.batchCopyVisible = true
},
// 批量复制弹窗确定
handleBatchCopyConfirm(data) {
let params = {
ids: this.batchCopySelectData.map(v => { return v.id }) || [], // 商品id
sceneType: this.batchCopySelectScene, // 业务场景
merchantId: data?.merchantId,
merchantName: data?.merchantName
}
batchUpdateBatchCopy(params).then(() => {
this.notice.okTips()
this.$refs.groundingIndexTable.refreshTable()
this.batchCopyVisible = false
})
},
// 批量复制弹窗取消
handleBatchCopyClose() {
this.batchCopyVisible = false
} }
} }
} }
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<script> <script>
import { getGoodsInfoById } from '@/api/commodity' import { getGoodsInfoById } from '@/api/commodity'
import { membraneTypeList, positionTypeList } from '@/common/constants' import { membraneTypeList } from '@/common/constants'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
export default { export default {
...@@ -119,6 +119,10 @@ export default { ...@@ -119,6 +119,10 @@ export default {
commodityInfoId: { commodityInfoId: {
type: [String, Number], type: [String, Number],
default: () => { } default: () => { }
},
positionTypeList: {
type: Array,
default: () => { }
} }
}, },
...@@ -141,8 +145,8 @@ export default { ...@@ -141,8 +145,8 @@ export default {
getInfo(id) { getInfo(id) {
getGoodsInfoById({ id: id }).then(res => { getGoodsInfoById({ id: id }).then(res => {
res?.upgradeGoodsList?.forEach(item => { res?.upgradeGoodsList?.forEach(item => {
let positionNamesArr = item?.goodsInfo?.goodsType == 1 ? deepClone(positionTypeList).filter(val => item.position == val.position) : [] let positionNamesArr = item?.goodsInfo?.goodsType == 1 ? deepClone(this.positionTypeList).filter(val => item.position.includes(val.position)) : []
item.positionNames = positionNamesArr.length ? positionNamesArr[0]?.confName : '' item.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : ''
item.serviceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',') item.serviceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',')
}) })
this.commodityInfo = res this.commodityInfo = res
......
...@@ -211,7 +211,10 @@ ...@@ -211,7 +211,10 @@
<td v-if="goodsInfoData.goodsType == 1"> <td v-if="goodsInfoData.goodsType == 1">
<el-select placeholder="部位" <el-select placeholder="部位"
size="small" size="small"
multiple
collapse-tags
:class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }" :class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }"
style="width: 180px;"
v-model="subItem.position" v-model="subItem.position"
@change="changePosition($event, subIndex)"> @change="changePosition($event, subIndex)">
<el-option v-for="childItem in productPositionTypeList" <el-option v-for="childItem in productPositionTypeList"
...@@ -465,7 +468,7 @@ ...@@ -465,7 +468,7 @@
import { limitPrice } from '@/common/format' import { limitPrice } from '@/common/format'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { mapGetters, mapMutations } from 'vuex' import { mapGetters, mapMutations } from 'vuex'
import { positionTypeList, membraneTypeList } from '@/common/constants' import { membraneTypeList } from '@/common/constants'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import serviceItemsDialog from "./serviceItemsDialog.vue" import serviceItemsDialog from "./serviceItemsDialog.vue"
import { getProductServiceItems } from '@api/productManage' import { getProductServiceItems } from '@api/productManage'
...@@ -532,6 +535,10 @@ export default { ...@@ -532,6 +535,10 @@ export default {
productServiceItemList: { productServiceItemList: {
type: Array, type: Array,
default: () => [] default: () => []
},
positionTypeList: {
type: Array,
default: () => []
} }
}, },
mounted() { mounted() {
...@@ -577,7 +584,7 @@ export default { ...@@ -577,7 +584,7 @@ export default {
}, },
'goodsInfoData.goodsPositionList': { 'goodsInfoData.goodsPositionList': {
handler(newValue) { handler(newValue) {
this.productPositionTypeList = positionTypeList.filter(v => newValue?.indexOf(v.position) > -1) this.productPositionTypeList = this.positionTypeList.filter(v => newValue?.indexOf(v.position) > -1)
}, },
deep: true deep: true
}, },
...@@ -826,7 +833,7 @@ export default { ...@@ -826,7 +833,7 @@ export default {
if (i == 0) { if (i == 0) {
this.goodsInfoData.goodsSpecificationList.push({ this.goodsInfoData.goodsSpecificationList.push({
id: '', id: '',
position: '', position: [],
purchasePrice: '', purchasePrice: '',
specificationData: '', specificationData: '',
specsValueList: [this.goodsInfoData.specificationDetailList[i]?.specificationValueList[j]?.specificationValue], specsValueList: [this.goodsInfoData.specificationDetailList[i]?.specificationValueList[j]?.specificationValue],
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
@change="selectAddAttr($event, item)" @change="selectAddAttr($event, item)"
:style="{'width': item.width || formItemWidth}" :style="{'width': item.width || formItemWidth}"
filterable> filterable>
<el-option label="全选" value="全选" @click.native='selectAll($event, item)' v-if="item.optionList.length"></el-option> <el-option label="全选" value="全选" @click.native='selectAll($event, item)' v-if="$$(item.optionList, 'length')"></el-option>
<el-option v-for="subItem in item.optionList" <el-option v-for="subItem in item.optionList"
:key="subItem[item.optionId]" :key="subItem[item.optionId]"
:label="subItem[item.optionLabel]" :label="subItem[item.optionLabel]"
...@@ -440,10 +440,9 @@ ...@@ -440,10 +440,9 @@
<script> <script>
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { uploadImg, uploadVideo } from '@/api/sys.base' import { uploadImg, uploadVideo } from '@/api/sys.base'
import { positionTypeList, applicableModelTypeList } from '@/common/constants'
import { limitPrice } from '@/common/format' import { limitPrice } from '@/common/format'
const SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}-info` const SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}-info`
import { membraneTypeList, BaseData } from '@/common/constants.js' import { membraneTypeList, applicableModelTypeList, BaseData } from '@/common/constants.js'
import { mapActions, mapMutations } from 'vuex' import { mapActions, mapMutations } from 'vuex'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
export default { export default {
...@@ -451,6 +450,7 @@ export default { ...@@ -451,6 +450,7 @@ export default {
data() { data() {
return { return {
equitySceneType: baseConfig.equitySceneType || [], equitySceneType: baseConfig.equitySceneType || [],
solarFilmArr: baseConfig.solarFilmArr || [1, 111, 112],
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
lookImgVisible: false, lookImgVisible: false,
formData: {}, formData: {},
...@@ -463,12 +463,39 @@ export default { ...@@ -463,12 +463,39 @@ export default {
url: '', url: '',
uploadType: '' uploadType: ''
}, },
rules: {
goodsName: [{ required: true, message: '请输入产品名称', trigger: 'change' }, {
validator: (rule, value, cb) => {
if (value && !value.includes('太阳膜') && this.solarFilmArr?.includes(this.formData?.goodsType)) {
return cb(new Error('产品名称必须包含“太阳膜”字样才可将产品挂在太阳膜类目下'))
} else {
cb()
}
},
trigger: 'blur'
}],
goodsType: [{ required: true, message: '请选择类目', trigger: 'change' }],
supplierCode: [{ required: true, message: '请选择供应方', trigger: 'change'}],
sapCode: [{
validator: (rule, value, cb) => {
if (value && (!/^[0-9A-Za-z]+$/.test(value))) {
return cb(new Error('只能输入数字或字母'))
} else {
cb()
}
},
trigger: 'change'
}],
thumbUrl: [{ required: true, message: '请选择缩略图', trigger: 'blur' }],
positionIds: [{ required: true, message: '请选择部位', trigger: 'change' }],
convertedValue: [{ required: true, message: '请输入比例换算', trigger: 'change'}]
},
copyMembranesFormBlock: [ copyMembranesFormBlock: [
{ {
name: 'positionIds', name: 'positionIds',
label: '部位', label: '部位',
type: 'multiple-select', type: 'multiple-select',
optionList: deepClone(positionTypeList), optionList: [],
optionId: 'position', optionId: 'position',
optionLabel: 'confName', optionLabel: 'confName',
width: '432px' width: '432px'
...@@ -522,10 +549,6 @@ export default { ...@@ -522,10 +549,6 @@ export default {
type: String, type: String,
default: '100%' default: '100%'
}, },
rules: {
type: Object,
default: () => { }
},
formRef: { formRef: {
type: String, type: String,
default: '' default: ''
...@@ -560,8 +583,9 @@ export default { ...@@ -560,8 +583,9 @@ export default {
deep: true deep: true
}, },
'formData.positionIds': { 'formData.positionIds': {
handler(newVal) { async handler(newVal) {
let arr = deepClone(positionTypeList).filter(val => newVal.indexOf(val.position) > -1) let copyPositionTypeList = await this.get(BaseData.positionTypeList)
let arr = deepClone(copyPositionTypeList)?.filter(val => newVal.indexOf(val.position) > -1)
this.formData.goodsPositionList?.forEach(val => { this.formData.goodsPositionList?.forEach(val => {
arr.forEach(item => { arr.forEach(item => {
if (val.position === item.position) { if (val.position === item.position) {
...@@ -575,19 +599,21 @@ export default { ...@@ -575,19 +599,21 @@ export default {
} }
}, },
mounted() { async mounted() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.formData = deepClone(this.originData) this.formData = deepClone(this.originData)
this.formData.merchantId = this.userInfo.detail.merchantId this.formData.merchantId = this.userInfo.detail.merchantId
this.$nextTick(() => { this.$nextTick(() => {
this.$refs[this.formRef + 'd2FormRuleForm'].clearValidate() this.$refs[this.formRef + 'd2FormRuleForm'].clearValidate()
}) })
let copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock) let copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock)
// 太阳膜类 部位下拉框数据
copyMembranesFormBlock[copyMembranesFormBlock.findIndex(val => val.name == 'positionIds')].optionList = this.positionTypeList
if (this.formData.goodsType == 1) { if (this.formData.goodsType == 1) {
this.membranesFormBlock = copyMembranesFormBlock this.membranesFormBlock = copyMembranesFormBlock
} else if (this.formData.goodsType == 12 || this.formData.goodsType == 14 || this.formData.goodsType == 4 || this.formData.goodsType == 6) { } else if (this.formData.goodsType == 12 || this.formData.goodsType == 14 || this.formData.goodsType == 4 || this.formData.goodsType == 6) {
this.membranesFormBlock = [copyMembranesFormBlock[1]] this.membranesFormBlock = [copyMembranesFormBlock[1]]
} }
// this.getProductServiceItemList()
}, },
methods: { methods: {
...@@ -595,9 +621,6 @@ export default { ...@@ -595,9 +621,6 @@ export default {
get: 'd2admin/base/get' get: 'd2admin/base/get'
}), }),
...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']), ...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
// async getProductServiceItemList() {
// this.productServiceItemList = await this.get(BaseData.productServiceItemList)
// },
selectBlur() { selectBlur() {
this.editOptionIndex = -1 this.editOptionIndex = -1
this.showOptionInput = false this.showOptionInput = false
...@@ -687,6 +710,8 @@ export default { ...@@ -687,6 +710,8 @@ export default {
var tempVal = targetItem.optionList.find(item => item.categoryType === value) var tempVal = targetItem.optionList.find(item => item.categoryType === value)
this.formData.goodsTypeName = tempVal.categoryName this.formData.goodsTypeName = tempVal.categoryName
let copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock) let copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock)
// 太阳膜类 部位下拉框数据
copyMembranesFormBlock[copyMembranesFormBlock.findIndex(val => val.name == 'positionIds')].optionList = this.positionTypeList
this.formData.convertedValue = 30 this.formData.convertedValue = 30
this.membranesFormBlock = [] this.membranesFormBlock = []
if (this.formData.goodsType == 1) { if (this.formData.goodsType == 1) {
...@@ -701,8 +726,8 @@ export default { ...@@ -701,8 +726,8 @@ export default {
selectAll(value, targetItem) { selectAll(value, targetItem) {
let _formData = this.formData let _formData = this.formData
if (targetItem.name == 'positionIds') { if (targetItem.name == 'positionIds') {
if (_formData.positionIds.length < (deepClone(positionTypeList).length + 1)) { if (_formData.positionIds.length < (deepClone(this.positionTypeList).length + 1)) {
_formData.positionIds = deepClone(positionTypeList).map(item=>{ _formData.positionIds = deepClone(this.positionTypeList).map(item=>{
return item.position return item.position
}) })
} else { } else {
...@@ -822,6 +847,9 @@ export default { ...@@ -822,6 +847,9 @@ export default {
this.$emit('handleAddConfirm', this.formData) this.$emit('handleAddConfirm', this.formData)
} else { } else {
var needRuleList = Object.keys(options) var needRuleList = Object.keys(options)
if (this.formData?.goodsName && !this.formData?.goodsName?.includes('太阳膜') && this.solarFilmArr?.includes(this.formData?.goodsType)) { // 太阳膜类目 产品名称关键字与类目不匹配
this.$message.error('产品名称必须包含“太阳膜”字样才可将产品挂在太阳膜类目下')
}
this.jumpScroll(needRuleList[0]) this.jumpScroll(needRuleList[0])
return true return true
} }
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<span>序号</span> <span>序号</span>
</td> </td>
<td> <td>
<span class="color-red">*</span>
<span>商品</span> <span>商品</span>
</td> </td>
<td> <td>
...@@ -114,7 +115,10 @@ ...@@ -114,7 +115,10 @@
<td v-if="goodsInfoData.goodsType == 1"> <td v-if="goodsInfoData.goodsType == 1">
<el-select placeholder="部位" <el-select placeholder="部位"
size="small" size="small"
multiple
collapse-tags
:class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }" :class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }"
style="width: 180px;"
v-model="subItem.position" v-model="subItem.position"
@change="changePosition($event, subIndex)"> @change="changePosition($event, subIndex)">
<el-option v-for="childItem in productPositionTypeList" <el-option v-for="childItem in productPositionTypeList"
...@@ -318,7 +322,7 @@ ...@@ -318,7 +322,7 @@
<script> <script>
import { limitPrice } from '@/common/format' import { limitPrice } from '@/common/format'
import { mapGetters, mapMutations } from 'vuex' import { mapGetters, mapMutations } from 'vuex'
import { positionTypeList, membraneTypeList } from '@/common/constants' import { membraneTypeList } from '@/common/constants'
import { deepClone } from "@/common/util" import { deepClone } from "@/common/util"
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import serviceItemsDialog from "./serviceItemsDialog.vue" import serviceItemsDialog from "./serviceItemsDialog.vue"
...@@ -355,6 +359,10 @@ export default { ...@@ -355,6 +359,10 @@ export default {
productServiceItemList: { productServiceItemList: {
type: Array, type: Array,
default: () => [] default: () => []
},
positionTypeList: {
type: Array,
default: () => []
} }
}, },
watch: { watch: {
...@@ -372,7 +380,7 @@ export default { ...@@ -372,7 +380,7 @@ export default {
}, },
'goodsInfoData.goodsPositionList': { 'goodsInfoData.goodsPositionList': {
handler(newValue) { handler(newValue) {
this.productPositionTypeList = positionTypeList.filter(v => newValue?.indexOf(v.position) > -1) this.productPositionTypeList = this.positionTypeList.filter(v => newValue?.indexOf(v.position) > -1)
}, },
deep: true deep: true
}, },
...@@ -492,7 +500,7 @@ export default { ...@@ -492,7 +500,7 @@ export default {
} }
this.goodsInfoData.goodsSpecificationSingleList.push({ this.goodsInfoData.goodsSpecificationSingleList.push({
id: '', id: '',
position: '', position: [],
purchasePrice: '', purchasePrice: '',
specificationData: '', specificationData: '',
specsValueList: [], specsValueList: [],
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<div class="title">产品系列-SPU</div> <div class="title">产品系列-SPU</div>
<productForm v-if="show" <productForm v-if="show"
ref="d2GoodsProductForm" ref="d2GoodsProductForm"
:rules="rules"
:add-or-edit="addOrEdit" :add-or-edit="addOrEdit"
form-name="product" form-name="product"
:origin-data="editData" :origin-data="editData"
...@@ -27,24 +26,6 @@ export default { ...@@ -27,24 +26,6 @@ export default {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
show: false, show: false,
rules: {
goodsName: [{ required: true, message: '请输入产品名称', trigger: 'change' }],
goodsType: [{ required: true, message: '请选择类目', trigger: 'change' }],
supplierCode: [{ required: true, message: '请选择供应方', trigger: 'change'}],
sapCode: [{
validator: (rule, value, cb) => {
if (value && (!/^[0-9A-Za-z]+$/.test(value))) {
return cb(new Error('只能输入数字或字母'))
} else {
cb()
}
},
trigger: 'change'
}],
thumbUrl: [{ required: true, message: '请选择缩略图', trigger: 'blur' }],
positionIds: [{ required: true, message: '请选择部位', trigger: 'change' }],
convertedValue: [{ required: true, message: '请输入比例换算', trigger: 'change'}]
},
editData: { editData: {
goodsName: '', goodsName: '',
goodsType: '', goodsType: '',
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
</div> </div>
</div> </div>
<div class="speci-box" id="specificationDetailList"> <div class="speci-box" id="specificationDetailList">
<singleSpecificationForm ref="singleSpecificationFormRef" v-show="goodsInfoData.specificationType == '1'" :productServiceItemList="productServiceItemList"></singleSpecificationForm> <singleSpecificationForm ref="singleSpecificationFormRef" v-show="goodsInfoData.specificationType == '1'" :productServiceItemList="productServiceItemList" :positionTypeList="positionTypeList"></singleSpecificationForm>
<multipleSpecificationForm ref="multipleSpecificationFormRef" v-show="goodsInfoData.specificationType == '2'" :productServiceItemList="productServiceItemList"></multipleSpecificationForm> <multipleSpecificationForm ref="multipleSpecificationFormRef" v-show="goodsInfoData.specificationType == '2'" :productServiceItemList="productServiceItemList" :positionTypeList="positionTypeList"></multipleSpecificationForm>
</div> </div>
</div> </div>
</div> </div>
...@@ -45,7 +45,8 @@ export default { ...@@ -45,7 +45,8 @@ export default {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
productPositionTypeList: [], productPositionTypeList: [],
productServiceItemList: [] productServiceItemList: [],
positionTypeList: []
} }
}, },
computed: { computed: {
...@@ -56,14 +57,15 @@ export default { ...@@ -56,14 +57,15 @@ export default {
// 多规格 // 多规格
this.goodsInfoData.specificationType = '2' this.goodsInfoData.specificationType = '2'
} }
this.getProductServiceItemList() this.getBaseData()
}, },
methods: { methods: {
...mapActions({ ...mapActions({
get: 'd2admin/base/get' get: 'd2admin/base/get'
}), }),
async getProductServiceItemList() { async getBaseData() {
this.productServiceItemList = await this.get(BaseData.productServiceItemList) this.productServiceItemList = await this.get(BaseData.productServiceItemList)
this.positionTypeList = await this.get(BaseData.positionTypeList)
}, },
...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']), ...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
// 新增规格 // 新增规格
......
...@@ -58,7 +58,8 @@ ...@@ -58,7 +58,8 @@
<drawer-detail v-if="drawerDetailVisible" <drawer-detail v-if="drawerDetailVisible"
:drawer-detail-visible="drawerDetailVisible" :drawer-detail-visible="drawerDetailVisible"
:commodity-info-id="commodityDetailInfoId" :commodity-info-id="commodityDetailInfoId"
@handleDrawerClose="handleDrawerClose" /> @handleDrawerClose="handleDrawerClose"
:positionTypeList="positionTypeList"/>
</d2-container> </d2-container>
</template> </template>
...@@ -70,6 +71,7 @@ import { mapActions, mapState } from 'vuex' ...@@ -70,6 +71,7 @@ import { mapActions, mapState } from 'vuex'
import { baseGoodsDelete } from '@api/commodity' import { baseGoodsDelete } from '@api/commodity'
import drawerDetail from './components/drawerDetail.vue' import drawerDetail from './components/drawerDetail.vue'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import { BaseData } from '@/common/constants'
export default { export default {
name: 'Commodity', name: 'Commodity',
data() { data() {
...@@ -219,7 +221,8 @@ export default { ...@@ -219,7 +221,8 @@ export default {
confValue: '草稿' confValue: '草稿'
}] }]
}, },
selfBuildGoodsType: baseConfig.selfBuildGoodsType || '' // 服务商自建类目值 selfBuildGoodsType: baseConfig.selfBuildGoodsType || '', // 服务商自建类目值
positionTypeList: []
} }
}, },
...@@ -250,6 +253,7 @@ export default { ...@@ -250,6 +253,7 @@ export default {
}), }),
...mapActions('d2admin/user', ['actionSetDownloadList']), ...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() { async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.baseData.productTypeList.unshift({ this.baseData.productTypeList.unshift({
categoryType: '', categoryType: '',
categoryName: '全部' categoryName: '全部'
......
...@@ -30,9 +30,8 @@ import { deepClone } from '@/common/util' ...@@ -30,9 +30,8 @@ import { deepClone } from '@/common/util'
import { mapActions, mapGetters, mapMutations } from 'vuex' import { mapActions, mapGetters, mapMutations } from 'vuex'
import sourceMaterial from './components/sourceMaterial.vue' import sourceMaterial from './components/sourceMaterial.vue'
import specifications from './components/specifications.vue' import specifications from './components/specifications.vue'
import { positionTypeList, applicableModelTypeList } from '@/common/constants'
import { addProductManage, UpdateProductManage } from '@api/productManage' import { addProductManage, UpdateProductManage } from '@api/productManage'
import { BaseData, membraneTypeList } from '@/common/constants.js' import { BaseData, membraneTypeList, applicableModelTypeList } from '@/common/constants.js'
import { getGoodsInfoById } from '@api/commodity' import { getGoodsInfoById } from '@api/commodity'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
export default { export default {
...@@ -82,12 +81,14 @@ export default { ...@@ -82,12 +81,14 @@ export default {
editGoodsData: false, editGoodsData: false,
productFormData: { productFormData: {
carTypeList: [1, 2, 3, 4] carTypeList: [1, 2, 3, 4]
} },
positionTypeList: []
} }
}, },
created() { created() {
this.addOrEdit = this.$route.params.addOrEdit this.addOrEdit = this.$route.params.addOrEdit
this.getBaseData()
}, },
mounted() { mounted() {
this.show = false this.show = false
...@@ -110,6 +111,9 @@ export default { ...@@ -110,6 +111,9 @@ export default {
}), }),
...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']), ...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
...mapActions({ close: 'd2admin/page/close' }), ...mapActions({ close: 'd2admin/page/close' }),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getGoodsInfo(id) { getGoodsInfo(id) {
getGoodsInfoById({ id: id }).then(res => { getGoodsInfoById({ id: id }).then(res => {
let specificationDetailList = [] let specificationDetailList = []
...@@ -118,9 +122,10 @@ export default { ...@@ -118,9 +122,10 @@ export default {
val?.upgradeGoodsServiceItemsList?.forEach(v => { val?.upgradeGoodsServiceItemsList?.forEach(v => {
v.uniqueValue = `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` v.uniqueValue = `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}`
}) })
console.log(val)
return { return {
id: val.id, id: val.id,
position: val.position, position: val.position ? (val.position + '')?.split(',')?.map(Number) : [],
purchasePrice: val.purchasePrice, purchasePrice: val.purchasePrice,
specificationData: val.specificationData, specificationData: val.specificationData,
specsValueList: val.specificationData?.split(';~;'), specsValueList: val.specificationData?.split(';~;'),
...@@ -160,7 +165,7 @@ export default { ...@@ -160,7 +165,7 @@ export default {
goodsPositionList: selectedPositions, goodsPositionList: selectedPositions,
goodsName: res.goodsInfo.goodsName, goodsName: res.goodsInfo.goodsName,
applicableModelNames: res.goodsInfo?.goodsType == 1 ? deepClone(applicableModelTypeList).filter(val => res.goodsInfo?.carTypeList?.indexOf(val.confId) > -1).map(item => item.confName).join('/') : '', applicableModelNames: res.goodsInfo?.goodsType == 1 ? deepClone(applicableModelTypeList).filter(val => res.goodsInfo?.carTypeList?.indexOf(val.confId) > -1).map(item => item.confName).join('/') : '',
positionNames: res.goodsInfo?.goodsType == 1 ? deepClone(positionTypeList).filter(val => selectedPositions.indexOf(val.position) > -1).map(item => item.confName).join('/') : '', positionNames: res.goodsInfo?.goodsType == 1 ? deepClone(this.positionTypeList).filter(val => selectedPositions.indexOf(val.position) > -1).map(item => item.confName).join('/') : '',
supplierCode: res.goodsInfo.supplierCode supplierCode: res.goodsInfo.supplierCode
} }
this.productFormData = deepClone(res.goodsInfo) || {} this.productFormData = deepClone(res.goodsInfo) || {}
...@@ -233,7 +238,7 @@ export default { ...@@ -233,7 +238,7 @@ export default {
specsValueList: [item.specificationData], specsValueList: [item.specificationData],
upgradePrice: item.upgradePrice, upgradePrice: item.upgradePrice,
warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : '', // 质保年限 仅膜类 warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : '', // 质保年限 仅膜类
position: productFormData?.goodsType === 1 ? item.position : '', // 部位 仅太阳膜 position: productFormData?.goodsType === 1 ? item.position?.join(',') : [], // 部位 仅太阳膜
type: item.type, type: item.type,
thirdPartyCode: item.thirdPartyCode, thirdPartyCode: item.thirdPartyCode,
purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : '', // 采购价 仅上架至采购商城 purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : '', // 采购价 仅上架至采购商城
...@@ -286,7 +291,7 @@ export default { ...@@ -286,7 +291,7 @@ export default {
specificationData: specificationData, specificationData: specificationData,
upgradePrice: item.upgradePrice, upgradePrice: item.upgradePrice,
warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : '', // 质保年限 仅膜类 warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : '', // 质保年限 仅膜类
position: productFormData?.goodsType === 1 ? item.position : '', // 部位 仅太阳膜 position: productFormData?.goodsType === 1 ? item.position?.join(',') : [], // 部位 仅太阳膜
type: item.type, type: item.type,
thirdPartyCode: item.thirdPartyCode, thirdPartyCode: item.thirdPartyCode,
purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : '', // 采购价 仅上架至采购商城 purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : '', // 采购价 仅上架至采购商城
...@@ -305,7 +310,7 @@ export default { ...@@ -305,7 +310,7 @@ export default {
delete productFormData.goodsPositionList delete productFormData.goodsPositionList
} }
var params = { var params = {
goodsInfo: this.dealObjectValue(productFormData), goodsInfo: this.dealObjectValue(deepClone(productFormData)),
upgradeGoods: { upgradeGoods: {
id: data.id || '', id: data.id || '',
baseGoodsName: data.specificationType == 1 ? '' : data.baseGoodsName, baseGoodsName: data.specificationType == 1 ? '' : data.baseGoodsName,
...@@ -315,13 +320,16 @@ export default { ...@@ -315,13 +320,16 @@ export default {
}, },
saveDraft: flag !== 1 // flag 1提交 2存草稿 saveDraft: flag !== 1 // flag 1提交 2存草稿
} }
console.log(params)
if (params?.upgradeGoods?.goodsSpecificationList?.length > 75) { if (params?.upgradeGoods?.goodsSpecificationList?.length > 75) {
return this.$message({ return this.$message({
type: 'warning', type: 'warning',
message: '商品数量过多,无法操作,请确认后重新保存' message: '商品数量过多,无法操作,请确认后重新保存'
}) })
} }
// 添加详情描述 未填写文字或上传图片 删除请求参数字段
params?.goodsInfo?.goodsDescList.forEach((subVal, subIdx) => {
if (!subVal?.content) delete params.goodsInfo.goodsDescList[subIdx]
})
let requestEvent = this.addOrEdit == 'add' ? addProductManage : UpdateProductManage let requestEvent = this.addOrEdit == 'add' ? addProductManage : UpdateProductManage
requestEvent(params).then(res => { requestEvent(params).then(res => {
this.notice.okTips() this.notice.okTips()
...@@ -332,9 +340,9 @@ export default { ...@@ -332,9 +340,9 @@ export default {
var param = {} var param = {}
if (obj === null || obj === undefined || obj === "") return param if (obj === null || obj === undefined || obj === "") return param
for (var key in obj) { for (var key in obj) {
if (obj[key] !== null && obj[key] !== undefined && obj[key] !== "") { if (obj[key] !== null && obj[key] !== undefined && obj[key] !== "") {
param[key] = obj[key]; param[key] = obj[key];
} }
} }
return param return param
}, },
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<el-table-column type="index" label="序号" :index="(index) => index + (page.pageNum - 1) * page.pageSize + 1" <el-table-column type="index" label="序号" :index="(index) => index + (page.pageNum - 1) * page.pageSize + 1"
align="center" /> align="center" />
<el-table-column label="订单编号" align="center" width="150" prop="orderCode" /> <el-table-column label="订单编号" align="center" width="150" prop="orderCode" />
<el-table-column label="交易参考号" align="center" width="150" prop="tradeNo" />
<el-table-column label="订单时间" align="center" width="160" prop="orderTimeStr" /> <el-table-column label="订单时间" align="center" width="160" prop="orderTimeStr" />
<el-table-column label="支付时间" align="center" width="160" prop="paySuccessDate" /> <el-table-column label="支付时间" align="center" width="160" prop="paySuccessDate" />
...@@ -164,10 +165,8 @@ ...@@ -164,10 +165,8 @@
分账记录 分账记录
</el-button> </el-button>
<!-- 取消分账 分帐中状态 --> <!-- 取消分账 分帐中状态 -->
<el-button type="text" <el-button type="text" size="small" v-if="scope.row.profitAllocationStatus == 5"
size="small" @click="cancelRule(scope.row)">
v-if="scope.row.profitAllocationStatus == 5"
@click="cancelRule(scope.row)">
取消分账 取消分账
</el-button> </el-button>
</template> </template>
...@@ -235,7 +234,7 @@ import { getParkStore } from "@api/editCustomer" ...@@ -235,7 +234,7 @@ import { getParkStore } from "@api/editCustomer"
import chooseRuleDialog from './chooseRuleDialog' import chooseRuleDialog from './chooseRuleDialog'
import ruleInfoDialog from './ruleInfoDialog' import ruleInfoDialog from './ruleInfoDialog'
export default { export default {
name: "Order", name: "CarDamage",
components: { components: {
chooseRuleDialog, chooseRuleDialog,
ruleInfoDialog ruleInfoDialog
...@@ -258,7 +257,7 @@ export default { ...@@ -258,7 +257,7 @@ export default {
// 1: "待升级", // 1: "待升级",
// 2: "战败", // 2: "战败",
3: "待支付", 3: "待支付",
4: "已支付", 4: "已支付"
// // 5: '已退款', // // 5: '已退款',
// 6: "已评价", // 6: "已评价",
// 9: "已撤销", // 9: "已撤销",
...@@ -428,6 +427,13 @@ export default { ...@@ -428,6 +427,13 @@ export default {
optionLabel: 'confLabel', optionLabel: 'confLabel',
optionsName: 'profitAllocationStatusList' optionsName: 'profitAllocationStatusList'
}, },
{
label: "交易参考号",
name: "tradeNo",
type: "input",
isClear: true,
keyFn: this.keyDowmGetList
}
], ],
searchForm: { searchForm: {
sceneType: 0, sceneType: 0,
...@@ -460,7 +466,7 @@ export default { ...@@ -460,7 +466,7 @@ export default {
{ {
confId: 4, confId: 4,
confLabel: "已支付" confLabel: "已支付"
}, }
// { // {
// confId: 6, // confId: 6,
// confLabel: "已评价" // confLabel: "已评价"
...@@ -540,7 +546,7 @@ export default { ...@@ -540,7 +546,7 @@ export default {
confId: '5', confId: '5',
confLabel: '分账中' confLabel: '分账中'
} }
], ]
}, },
tableData: [], tableData: [],
total: 0, total: 0,
...@@ -750,7 +756,7 @@ export default { ...@@ -750,7 +756,7 @@ export default {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === "select") { if (item.type === "select") {
if ( if (
this.baseData[item.optionsName].length && this.baseData[item.optionsName]?.length &&
this.baseData[item.optionsName][0][ this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel this.showFormData[index].optionLabel
] !== "全部" ] !== "全部"
...@@ -915,11 +921,11 @@ export default { ...@@ -915,11 +921,11 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
cancelDivideAccountsAPI({orderCode: row.orderCode}).then(res => { cancelDivideAccountsAPI({ orderCode: row.orderCode }).then(res => {
this.notice.okTips() this.notice.okTips()
this.handleSearch() this.handleSearch()
}) })
}).catch(() => {}) }).catch(() => { })
}, },
ruleInfoDialogClose(flag) { ruleInfoDialogClose(flag) {
......
...@@ -127,9 +127,31 @@ ...@@ -127,9 +127,31 @@
退款 退款
</el-button> </el-button>
</span> </span>
<span v-if="scope.scope.ledgerStatus == '2'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="chooseRule(scope.scope)">
发起分账
</el-button>
</span>
<span v-if="scope.scope.ledgerStatus == '3'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="ruleHistory(scope.scope)">
分账记录
</el-button>
</span>
<!-- 取消分账 分账中状态 -->
<span v-if="scope.scope.ledgerStatus == '4'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="cancelRule(scope.scope)">
取消分账
</el-button>
</span>
</div> </div>
</d2-table> </d2-table>
</div> </div>
<!-- 选择分账规则 -->
<choose-rule-dialog :rule-visible="ruleVisible" :record-info="recordInfo" v-if="ruleVisible"
@dialogClose="ruleDialogClose" />
<!-- 分账记录 -->
<rule-info-dialog :rule-info-visible="ruleInfoVisible" :record-info="recordInfo" v-if="ruleInfoVisible"
@dialogClose="ruleInfoDialogClose" />
</d2-container> </d2-container>
</div> </div>
</template> </template>
...@@ -143,8 +165,12 @@ import { ...@@ -143,8 +165,12 @@ import {
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from "@/common/util"
import orderManage from "@api/orderManage" import orderManage from "@api/orderManage"
import { batchUpdateToNotInput, batchUpdateConfirmInput, markAsRefunded, cancelDivideAccountsAPI, verification, refund } from '@api/order' import { batchUpdateToNotInput, batchUpdateConfirmInput, markAsRefunded, cancelDivideAccountsAPI, verification, refund } from '@api/order'
import chooseRuleDialog from './chooseRuleDialog'
import ruleInfoDialog from './ruleInfoDialog'
export default { export default {
components: { components: {
chooseRuleDialog,
ruleInfoDialog
}, },
data() { data() {
return { return {
...@@ -255,7 +281,11 @@ export default { ...@@ -255,7 +281,11 @@ export default {
{ confId: "3", confName: "已分账" }, { confId: "3", confName: "已分账" },
{ confId: "4", confName: "分账中" } { confId: "4", confName: "分账中" }
] ]
} },
ruleVisible: false,
recordInfo: null,
ruleInfoVisible: false
} }
}, },
name: "ConfigUpgradation", name: "ConfigUpgradation",
...@@ -761,6 +791,51 @@ export default { ...@@ -761,6 +791,51 @@ export default {
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
},
// 选择对账规则
chooseRule(row) {
this.recordInfo = deepClone(row)
this.recordInfo.paySuccessDate = this.recordInfo.payDate
? Util.dateFormate(this.recordInfo.payDate, "YYYY-MM-DD HH:mm:ss")
: ""
this.recordInfo.totalPrice = this.recordInfo.payprice ? this.recordInfo.payprice / 100 : '0.00'
this.recordInfo.sceneType = 2 // 因为账户中心场景定义与蔡远明这边不一样,因此固定传2不能从列表拿,列表对应的场景映射值不统一
console.log(this.recordInfo)
this.ruleVisible = true
},
ruleDialogClose(flag) {
this.ruleVisible = !this.ruleVisible
if (flag) {
this.handleSearch()
}
},
// 分账记录
ruleHistory(row) {
this.recordInfo = row
this.ruleInfoVisible = true
},
// 取消分账
cancelRule(row) {
this.$confirm('取消分帐后,订单按线下对账方式计算分润,收款金额统一分账至嘀加智慧云,请谨慎操作。是否确定取消?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
cancelDivideAccountsAPI({ orderCode: row.orderCode }).then(res => {
this.notice.okTips()
this.handleSearch()
})
}).catch(() => { })
},
ruleInfoDialogClose(flag) {
this.ruleInfoVisible = !this.ruleInfoVisible
if (flag) {
this.handleSearch()
}
} }
} }
} }
......
...@@ -2,28 +2,28 @@ ...@@ -2,28 +2,28 @@
<template> <template>
<d2-container> <d2-container>
<div class="order-detail"> <div class="order-detail">
<div class="edit-box"> <div class="edit-box">
<div class="container m-b-20"> <div class="container m-b-20">
<p class="edit-title">订单信息</p> <p class="edit-title">订单信息</p>
<el-form label-width="100px" <el-form label-width="100px"
:inline="true"> :inline="true">
<el-row v-for="(item, index) in detailFormDataRow" <el-row v-for="(item, index) in detailFormDataRow"
:key="index"> :key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList" <el-form-item v-for="(subItem, subIndex) in item.rowList"
:key="subIndex" :key="subIndex"
:label="subItem.label" :label="subItem.label"
class="row-item"> class="row-item">
<div class="" <div class="" v-if="subItem.isImage">
v-if="subItem.isImage"> <div v-if="$$(detailForm[subItem.name], 'length')">
<img v-if="detailForm[subItem.name]" <img v-for="(subVal, subKey) in detailForm[subItem.name]" :key="subKey" class="order-img"
class="order-img" :src="subVal"
:src="detailForm[subItem.name]" @click="handleEnlargeImg(subVal)">
@click="handleEnlargeImg(detailForm[subItem.name])">
<span v-else>-</span>
</div> </div>
<span v-else <span v-else>-</span>
class="detail-txt ellipsis-1" </div>
:title="detailForm[subItem.name]">{{ <!-- 交易流水号换行显示 -->
<span v-else class="detail-txt ellipsis-1" :class="subItem.name == 'transactionReferenceId' ? 'show-text' : ''"
:title="detailForm[subItem.name]">{{
detailForm[subItem.name] detailForm[subItem.name]
? detailForm[subItem.name] + (subItem.suffix || "") ? detailForm[subItem.name] + (subItem.suffix || "")
: "-" : "-"
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
<el-dialog :visible="imgVisible" <el-dialog :visible="imgVisible"
:before-close="handleEnlargeImg"> :before-close="handleEnlargeImg">
<img width="100%" <img width="100%"
:src="detailForm.payVoucher" :src="previewImgUrl"
alt="图片"> alt="图片">
</el-dialog> </el-dialog>
</d2-container> </d2-container>
...@@ -196,7 +196,8 @@ export default { ...@@ -196,7 +196,8 @@ export default {
] ]
}, },
hideStatus: false, hideStatus: false,
imgVisible: false // 收款凭证图片弹窗 imgVisible: false, // 收款凭证图片弹窗
previewImgUrl: ''
} }
}, },
...@@ -215,7 +216,7 @@ export default { ...@@ -215,7 +216,7 @@ export default {
}, },
{ {
label: "商户订单号", label: "商户订单号",
name: "outTradeNo" name: "transactionReferenceId"
}, },
{ {
label: "订单时间", label: "订单时间",
...@@ -296,7 +297,7 @@ export default { ...@@ -296,7 +297,7 @@ export default {
}, },
{ {
label: '收款凭证', label: '收款凭证',
name: 'payVoucher', name: 'payVoucherList', // 后端返回对应字段是payVoucher用','隔开
isImage: true isImage: true
} }
] ]
...@@ -326,6 +327,7 @@ export default { ...@@ -326,6 +327,7 @@ export default {
orderManage orderManage
.getOrderDetailApi({ orderCode: this.routeInfo.orderCode }) .getOrderDetailApi({ orderCode: this.routeInfo.orderCode })
.then((res) => { .then((res) => {
res.payVoucherList = res?.payVoucher?.split(',') || []
this.detailForm = res this.detailForm = res
this.orderRefund = res.orderRefund || null this.orderRefund = res.orderRefund || null
this.detailForm.createdDateStr = Util.dateFormate( this.detailForm.createdDateStr = Util.dateFormate(
...@@ -419,8 +421,9 @@ export default { ...@@ -419,8 +421,9 @@ export default {
this.formToRow("detailFormData") this.formToRow("detailFormData")
}) })
}, },
handleEnlargeImg() { handleEnlargeImg(url) {
this.imgVisible = !this.imgVisible this.imgVisible = !this.imgVisible
this.previewImgUrl = url
}, },
handleCancel() { handleCancel() {
this.$router.push({ this.$router.push({
...@@ -477,6 +480,7 @@ export default { ...@@ -477,6 +480,7 @@ export default {
.order-detail .row-item .order-img { .order-detail .row-item .order-img {
width: 80px; width: 80px;
height: 80px; height: 80px;
margin-right: 8px;
cursor: pointer; cursor: pointer;
} }
.detail-txt { .detail-txt {
...@@ -487,6 +491,10 @@ export default { ...@@ -487,6 +491,10 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.order-detail .row-item .show-text{
word-wrap: break-word;
white-space: normal;
}
.order-detail .show-table > tbody > tr > td { .order-detail .show-table > tbody > tr > td {
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
......
...@@ -98,6 +98,13 @@ ...@@ -98,6 +98,13 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="部位" align="center" width="150" prop="subOrderList">
<template slot-scope="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p>{{ item.positionStr }}</p>
</span>
</template>
</el-table-column>
<el-table-column label="商品别名" align="center" width="150" prop="subOrderList"> <el-table-column label="商品别名" align="center" width="150" prop="subOrderList">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index"> <span v-for="(item, index) in scope.row.subOrderList" :key="index">
...@@ -522,7 +529,8 @@ export default { ...@@ -522,7 +529,8 @@ export default {
subShopMerchanShowHide: true, subShopMerchanShowHide: true,
ruleVisible: false, ruleVisible: false,
recordInfo: null, recordInfo: null,
ruleInfoVisible: false ruleInfoVisible: false,
positionTypeList: []
} }
}, },
computed: { computed: {
...@@ -601,6 +609,7 @@ export default { ...@@ -601,6 +609,7 @@ export default {
...mapMutations('d2admin/user', ['setUpdateRefesh']), ...mapMutations('d2admin/user', ['setUpdateRefesh']),
...mapActions("d2admin/base", ["get"]), ...mapActions("d2admin/base", ["get"]),
async getBaseData() { async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.baseData.channelTypeList = await this.get(BaseData.channelType) this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.getOptionsList() this.getOptionsList()
}, },
...@@ -715,7 +724,7 @@ export default { ...@@ -715,7 +724,7 @@ export default {
getOptionsList() { getOptionsList() {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') { if (this.baseData[item.optionsName]?.length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {} const temp = {}
temp[this.showFormData[index].optionId] = '' temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部' temp[this.showFormData[index].optionLabel] = '全部'
...@@ -753,6 +762,9 @@ export default { ...@@ -753,6 +762,9 @@ export default {
getList(params).then(res => { getList(params).then(res => {
this.tableData = res.list.map((item) => { this.tableData = res.list.map((item) => {
item.paySuccessDate = item.paySuccessDate ? Util.dateFormate(item.paySuccessDate, 'YYYY-MM-DD HH:mm:ss') : '' item.paySuccessDate = item.paySuccessDate ? Util.dateFormate(item.paySuccessDate, 'YYYY-MM-DD HH:mm:ss') : ''
item.subOrderList?.forEach(val => {
val.positionStr = this.positionTypeList?.filter(subItem => val?.upgradeGoodsPosition == subItem.position)[0]?.confName || '-'
})
return item return item
}) })
this.page.pageNum = res.pageNum this.page.pageNum = res.pageNum
......
<!-- 审核 -->
<template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible" class="accountDailog" @handleClick="handleAddConfirm">
<div class="reject-dialog">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="150px" default-width="350px" :form-ref="editChildRef" :form-obj="infoForm" :form-data="editFormData" :form-rules="formRules"></glsx-combi-form>
<span :style="{'margin-left': '150px'}"></span>
</div>
</baseDialog>
</template>
<script>
import { operatorreviewOperatorAudit, businessreviewBusinessAudit } from '@/api/purchaseShopping.js'
import { getShippingEntityInfoAll } from "@api/serviceManage"
import { deepClone } from '@/common/util'
export default {
name: 'CheckDialog',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
txtObj: {
procurementReview: '说明:订单审核后会自动流转至商务进行复审',
procurementBusiness: '说明:订单审核后会自动流转至供应商进行确认并发货'
},
infoForm: {
sendOutMerchantId: ''
},
dialogConfig: {
title: '审核',
width: '750px'
},
editChildRef: 'editChildRef',
formRules: {
sendOutMerchantId: [{ required: true, message: '请选择发货主体', trigger: 'change' }]
},
editFormData: [{
label: '发货主体',
name: 'sendOutMerchantId',
isHide: true,
type: 'select',
optionList: [],
optionId: 'shippingEntityId',
optionLabel: 'shippingEntity',
optionsName: 'shippingEntityList'
}, {
label: '备注',
name: 'remark',
type: 'input',
maxlength: '20'
}],
baseData: {
shippingEntityList: []
}
}
},
props: {
fromPage: {
type: String,
default: 'procurementReview'
},
checkVisible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: {}
}
},
computed: {
visible: {
get() {
return this.checkVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'checkVisible' })
}
}
},
mounted() {
this.showOrHideAttr('editFormData', '发货主体', this.fromPage == 'procurementBusiness')
if (this.fromPage != 'procurementBusiness') {
// 获取发货主体数据
getShippingEntityInfoAll({}).then(res => {
this.baseData.shippingEntityList = res || []
this.getOptionsList('editFormData', false)
})
}
},
methods: {
showOrHideAttr(formName, label, isHide) {
const idx = this[formName].findIndex(item => item.label == label)
this[formName][idx].isHide = isHide
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
handleAddConfirm() {
// return
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
// console.log(valid)
// return
var infoForm = deepClone(this.infoForm)
var params = {}
params.sendOutMerchantId = infoForm.sendOutMerchantId
params.remark = infoForm.remark
params.orderCode = this.paramsObj.orderCode
const _api = this.fromPage == 'procurementBusiness' ? businessreviewBusinessAudit : operatorreviewOperatorAudit
_api(params).then(res => {
this.notice.okTips('操作成功')
this.visible = true
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.reject-dialog {
margin: 65px 0;
.reject-input {
::v-deep .el-textarea__inner {
height: 70px;
}
}
.el-textarea .el-input__count {
right: 90px;
bottom: -10px;
font-size: 12px;
color: #999999;
}
.tips {
color: #999999;
}
}
</style>
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
rejectCause: '' rejectCause: ''
}, },
dialogConfig: { dialogConfig: {
title: '驳回提示', title: '驳回',
width: '750px' width: '750px'
}, },
formRules: { formRules: {
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
return this.rejectVisible return this.rejectVisible
}, },
set(newVal) { set(newVal) {
this.$emit('dialogClose', newVal) this.$emit('dialogClose', { flag: newVal, attrName: 'rejectVisible'})
// this.$emit('update:visible', newVal) // this.$emit('update:visible', newVal)
} }
} }
......
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
<orderDeatilDialog :visible.sync="detailVisible" <orderDeatilDialog :visible.sync="detailVisible"
v-if="detailVisible" v-if="detailVisible"
:params-obj="paramsObj"></orderDeatilDialog> :params-obj="paramsObj"></orderDeatilDialog>
<CheckDialog :check-visible="checkVisible"
v-if="checkVisible"
:params-obj="paramsObj"
fromPage="procurementBusiness"
@dialogClose="dialogClose">
</CheckDialog>
<rejectDialog :reject-visible="rejectVisible" <rejectDialog :reject-visible="rejectVisible"
v-if="rejectVisible" v-if="rejectVisible"
:params-obj="paramsObj" :params-obj="paramsObj"
...@@ -65,11 +71,13 @@ import { mapActions, mapState } from 'vuex' ...@@ -65,11 +71,13 @@ import { mapActions, mapState } from 'vuex'
import { getPurchaseOrderList, getMerchantList, purchaseOrderCancelOrCheck, businessreviewPage, businessreviewBusinessAudit } from '@/api/purchaseShopping.js' import { getPurchaseOrderList, getMerchantList, purchaseOrderCancelOrCheck, businessreviewPage, businessreviewBusinessAudit } from '@/api/purchaseShopping.js'
import orderDeatilDialog from './components/orderDetailDialog' import orderDeatilDialog from './components/orderDetailDialog'
import rejectDialog from './components/rejectDialog' import rejectDialog from './components/rejectDialog'
import CheckDialog from './components/CheckDialog'
export default { export default {
name: 'PurchaseOrder', name: 'PurchaseOrder',
components: { components: {
orderDeatilDialog, orderDeatilDialog,
rejectDialog rejectDialog,
CheckDialog
}, },
data() { data() {
return { return {
...@@ -236,6 +244,7 @@ export default { ...@@ -236,6 +244,7 @@ export default {
detailVisible: false, detailVisible: false,
// 驳回 // 驳回
rejectVisible: false, rejectVisible: false,
checkVisible: false,
// 基本数据 // 基本数据
baseData: { baseData: {
business_statusOptions: [], business_statusOptions: [],
...@@ -352,21 +361,8 @@ export default { ...@@ -352,21 +361,8 @@ export default {
}, },
// 审核 // 审核
handleCheck(row) { handleCheck(row) {
this.$confirm(`订单审核后会自动流转至供应商进行确认并发货。是否确定审核?`, '提示', { this.checkVisible = !this.checkVisible
confirmButtonText: '确定', this.paramsObj = row
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
// purchaseOrderCancelOrCheck({
businessreviewBusinessAudit({
orderCode: row.orderCode,
operateType: 1
}).then(() => {
this.notice.okTips()
this.$refs.purchasementReviewTable.refreshTable()
}).catch(() => { })
})
}, },
// 查看详情 // 查看详情
handleDetail(row) { handleDetail(row) {
...@@ -385,9 +381,9 @@ export default { ...@@ -385,9 +381,9 @@ export default {
} }
this.rejectVisible = true this.rejectVisible = true
}, },
dialogClose(flag) { dialogClose(obj) {
this.rejectVisible = !this.rejectVisible this[obj.attrName] = !this[obj.attrName]
if (flag) { if (obj.flag) {
this.$refs.purchasementReviewTable.refreshTable() this.$refs.purchasementReviewTable.refreshTable()
} }
} }
......
...@@ -278,18 +278,21 @@ export default { ...@@ -278,18 +278,21 @@ export default {
7: 'redSpot' 7: 'redSpot'
}[cellValue.status] }[cellValue.status]
} }
},
{
label: '审核人',
prop: 'reviewedBy',
formatter: (cellValue) => {
return cellValue.auditDetail.reviewedBy || '--'
}
},
{
label: '审核时间',
prop: 'reviewedDate',
formatter: (cellValue) => {
return cellValue.auditDetail.reviewedDate ? Util.dateFormate(cellValue.auditDetail.reviewedDate, 'YYYY-MM-DD HH:mm:ss') : '--'
}
} }
// {
// label: '审核人',
// prop: 'updatedBy'
// },
// {
// label: '审核时间',
// prop: 'updatedDate',
// formatter: (cellValue) => {
// return cellValue.updatedDate ? Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss') : '--'
// }
// }
] ]
}, },
// 查看门店 // 查看门店
...@@ -383,6 +386,7 @@ export default { ...@@ -383,6 +386,7 @@ export default {
handleExport() { handleExport() {
this.filterSearchTime() this.filterSearchTime()
var params = this.tableSearchForm var params = this.tableSearchForm
delete params.placeOrderTimeStr
// 处理查询条件时间 // 处理查询条件时间
for (const key in params) { for (const key in params) {
if (key == 'orderTimeStr') { if (key == 'orderTimeStr') {
...@@ -392,7 +396,8 @@ export default { ...@@ -392,7 +396,8 @@ export default {
delete params[key] delete params[key]
} }
} }
params.method = 'dj.api.smarcarlife.purchaseOrder.export.async' // params.method = 'dj.api.smarcarlife.purchaseOrder.export.async'
params.method = 'dj.api.smarcarlife.purchaseOrder.shipment.export.async'
params.sortType = 3 params.sortType = 3
const list = [ const list = [
...this.dowloadList, ...this.dowloadList,
......
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
</el-form> </el-form>
</div> </div>
</div> </div>
<div class="rulesCon" v-else> <!-- <div class="rulesCon" v-else>
<el-tabs v-model="nonFusionActiveName"> <el-tabs v-model="nonFusionActiveName">
<el-tab-pane label="计算规则" name="first"></el-tab-pane> <el-tab-pane label="计算规则" name="first"></el-tab-pane>
</el-tabs> </el-tabs>
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
</div> </div>
</el-form> </el-form>
<el-button v-show="!isEdit" class="addBtn" @click="addFormItem" type="primary">新增价格区间</el-button> <el-button v-show="!isEdit" class="addBtn" @click="addFormItem" type="primary">新增价格区间</el-button>
</div> </div> -->
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -407,15 +407,15 @@ export default { ...@@ -407,15 +407,15 @@ export default {
resolve(params) resolve(params)
}) })
} else { } else {
this.$refs.formRef.validate((valid) => { // this.$refs.formRef.validate((valid) => {
if (valid) { // if (valid) {
const form = deepClone(this.form) const form = deepClone(this.form)
const storeForm = deepClone(this.storeForm) const storeForm = deepClone(this.storeForm)
delete storeForm.quotationGoodsInfo delete storeForm.quotationGoodsInfo
resolve({ ...storeForm, vdRuleIntervalList: form.vdRuleIntervalList } resolve({ ...storeForm, vdRuleIntervalList: form.vdRuleIntervalList }
) )
} // }
}) // })
} }
}) })
// }) // })
...@@ -452,20 +452,20 @@ export default { ...@@ -452,20 +452,20 @@ export default {
console.log(res) console.log(res)
if (res) { if (res) {
this.storeForm = Object.assign(this.storeForm, res, { mode: res.mode != null ? res.mode : 0 }) this.storeForm = Object.assign(this.storeForm, res, { mode: res.mode != null ? res.mode : 0 })
if (this.storeForm.mode == 1) { // if (this.storeForm.mode == 1) {
this.form.vdRuleIntervalList = res.vdRuleIntervalList.map((item) => { // this.form.vdRuleIntervalList = res.vdRuleIntervalList.map((item) => {
const { id, ruleId, reorder, low, high, recommendation, minimum } = item // const { id, ruleId, reorder, low, high, recommendation, minimum } = item
return { // return {
id, // id,
ruleId, // ruleId,
reorder, // reorder,
low, // low,
high, // high,
recommendation, // recommendation,
minimum // minimum
} // }
}) // })
} // }
this.distributionList = [] this.distributionList = []
distributionTemp.forEach((item) => { distributionTemp.forEach((item) => {
......
...@@ -106,15 +106,15 @@ ...@@ -106,15 +106,15 @@
<el-form class="edit-sub-block" :inline="true"> <el-form class="edit-sub-block" :inline="true">
<el-form-item label="商品:" class="goods"> <el-form-item label="商品:" class="goods">
<img v-if="$$(detail.quotationGoodsInfo, 'titlePictureUrl')" class="order-img" <img v-if="$$(detail.quotationGoodsInfo, 'titlePictureUrl')" class="order-img"
:src="$$(detail.quotationGoodsInfo, 'titlePictureUrl')" @click="handleEnlargeImg"> :src="$$(detail.quotationGoodsInfo, 'titlePictureUrl')" @click="handleEnlargeImg" />
{{ $$(detail.quotationGoodsInfo, 'goodsName') }} {{ $$(detail, 'goodsName') }}
</el-form-item> </el-form-item>
<el-form-item label="增值权益价格/元:"> <el-form-item label="增值权益价格/元:">
{{ detail.quotedPriceUpdate / 100 }} {{ detail.quotedPriceUpdate / 100 }}
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<p style="text-align:left; padding-left: 30px; margin: 0 0 16px 0;"> <p style="text-align:left; padding-left: 30px; margin: 20px 0 16px 0;">
<el-button type="primary" @click="handleClose"> <el-button type="primary" @click="handleClose">
返回 返回
</el-button> </el-button>
...@@ -226,7 +226,7 @@ export default { ...@@ -226,7 +226,7 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.order-detail { .order-detail {
.d2-container-content { .d2-container-content {
margin-top: 0 !important; margin-top: 0 !important;
...@@ -259,9 +259,12 @@ export default { ...@@ -259,9 +259,12 @@ export default {
} }
.goods { .goods {
height: 100px; // height: 100px;
// display: flex; ::v-deep .el-form-item__content {
max-width: 240px;
word-break: break-all
}
} }
.order-img { .order-img {
......
...@@ -34,6 +34,14 @@ ...@@ -34,6 +34,14 @@
</d2-table> </d2-table>
</div> </div>
</d2-container> </d2-container>
<baseDialog :is-show.sync="previewVisible" :dialog-config="dialogConfig.config" :config="dialogConfig.setting">
<div class="previewItem" v-for="(item, index) in previewList" :key="index">
<span v-if="!item.goodName">合同{{ index + 1 }}</span>
<span class="goodName one-line-ellipsis" v-else>合同名称: {{ item.goodName }}</span>
<i class="el-icon-download downloadIcon" @click="exportFile({ contractNo: item.contractNo })"></i>
</div>
</baseDialog>
<!-- 查看 --> <!-- 查看 -->
<!-- <stock-month-dialog <!-- <stock-month-dialog
:stock-month-visible="stockMonthVisible" :stock-month-visible="stockMonthVisible"
...@@ -46,7 +54,7 @@ ...@@ -46,7 +54,7 @@
<script> <script>
import { mapActions, mapState } from "vuex" import { mapActions, mapState } from "vuex"
import { getList, quotationPrint, quotationExport, contractExport } from "@api/vehicleDamage" import { getList, quotationPrint, quotationExport, contractExport, listContracts } from "@api/vehicleDamage"
export default { export default {
name: "StockList", name: "StockList",
data() { data() {
...@@ -194,7 +202,20 @@ export default { ...@@ -194,7 +202,20 @@ export default {
{ severName: "已完成", severType: 5 } { severName: "已完成", severType: 5 }
] ]
}, },
previewVisible: false,
// 驳回
dialogConfig: {
setting: {
showClose: true,
isShowFooter: false
// appendToBody: true,
},
config: {
title: '打印合同',
width: '480px'
}
},
previewList: [],
stockMonthVisible: false, stockMonthVisible: false,
recordInfo: null recordInfo: null
} }
...@@ -240,9 +261,21 @@ export default { ...@@ -240,9 +261,21 @@ export default {
}) })
}, },
// 打印权益合同 // 打印权益合同
handlePrintContract(row) { async handlePrintContract(row) {
// 获取权益合同PDF const res = await listContracts({ orderId: row.orderId })
contractExport({ orderId: row.orderId }).then((res) => { console.log(res, 'res')
if (res.length == 1) {
// 获取权益合同PDF 用订单号
// this.exportFile({ orderId: row.orderId })
this.exportFile({ contractNo: res[0].contractNo })
} else {
this.previewVisible = true
this.previewList = res
}
},
exportFile(params) {
contractExport(params).then((res) => {
window.open(res) window.open(res)
}) })
}, },
...@@ -356,4 +389,26 @@ export default { ...@@ -356,4 +389,26 @@ export default {
margin-right: 5px; margin-right: 5px;
} }
} }
.previewItem {
text-align: center;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #1D1D1D;
}
.goodName {
max-width: 70%;
width: auto;
}
.previewItem+.previewItem {
margin-top: 30px;
}
.downloadIcon {
margin-left: 10px;
color: #185EFE;
}
</style> </style>
...@@ -9146,7 +9146,7 @@ safe-regex@^1.1.0: ...@@ -9146,7 +9146,7 @@ safe-regex@^1.1.0:
resolved "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" resolved "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
sass-loader@^7.1.0: sass-loader@^7.3.1:
version "7.3.1" version "7.3.1"
resolved "https://registry.npmmirror.com/sass-loader/-/sass-loader-7.3.1.tgz#a5bf68a04bcea1c13ff842d747150f7ab7d0d23f" resolved "https://registry.npmmirror.com/sass-loader/-/sass-loader-7.3.1.tgz#a5bf68a04bcea1c13ff842d747150f7ab7d0d23f"
integrity sha512-tuU7+zm0pTCynKYHpdqaPpe+MMTQ76I9TPZ7i4/5dZsigE350shQWe5EZNl5dBidM49TPET75tNqRbcsUZWeNA== integrity sha512-tuU7+zm0pTCynKYHpdqaPpe+MMTQ76I9TPZ7i4/5dZsigE350shQWe5EZNl5dBidM49TPET75tNqRbcsUZWeNA==
...@@ -9157,10 +9157,10 @@ sass-loader@^7.1.0: ...@@ -9157,10 +9157,10 @@ sass-loader@^7.1.0:
pify "^4.0.1" pify "^4.0.1"
semver "^6.3.0" semver "^6.3.0"
sass@^1.18.0: sass@^1.62.0:
version "1.59.2" version "1.64.1"
resolved "https://registry.npmmirror.com/sass/-/sass-1.59.2.tgz#537f6d11614d4f20f97696f23ad358ee398b1937" resolved "https://registry.npmmirror.com/sass/-/sass-1.64.1.tgz#6a46f6d68e0fa5ad90aa59ce025673ddaa8441cf"
integrity sha512-jJyO6SmbzkJexF8MUorHx5tAilcgabioYxT/BHbY4+OvoqmbHxsYlrjZ8Adhqcgl6Zqwie0TgMXLCAmPFxXOuw== integrity sha512-16rRACSOFEE8VN7SCgBu1MpYCyN7urj9At898tyzdXFhC+a+yOX5dXwAR7L8/IdPJ1NB8OYoXmD55DM30B2kEQ==
dependencies: dependencies:
chokidar ">=3.0.0 <4.0.0" chokidar ">=3.0.0 <4.0.0"
immutable "^4.0.0" immutable "^4.0.0"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!