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) {
export function batchUpdateStatus(data) {
data.method = `${path}merchantGoodsInfo.updateBatchOffShelf`
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
......@@ -315,3 +315,9 @@ export function insertOrUpdateDiversionMerchantRef(data) {
data.method = `${path2}diversionMerchant.insertOrUpdateDiversionMerchantRef`
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) {
data.method = `${path}smartcarlife.common.uploadPdf`
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
......@@ -29,7 +29,12 @@ export function quotationExport(data) {
// 打印 返回权益合同PDF文件Url
export function contractExport(data) {
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)
}
......
......@@ -12,7 +12,8 @@ export const TYPE_NAME = "confType"
export const BaseData = {
channelType: "channelType",
productType: "productType",
productServiceItemList: "productServiceItemList"
productServiceItemList: "productServiceItemList",
positionTypeList: "positionTypeList" // 太阳膜商品部位
}
/**
......@@ -509,43 +510,43 @@ export const targetType = {
}
// 太阳膜部位
export const positionTypeList = [
{
position: 1,
confName: "前档玻璃",
deductionStandard: 1
},
{
position: 2,
confName: "侧后档玻璃",
deductionStandard: 2
},
{
position: 3,
confName: "单帖侧窗一个",
deductionStandard: 0.4
},
{
position: 4,
confName: "单帖后档一个",
deductionStandard: 0.8
},
{
position: 5,
confName: "单帖小天窗",
deductionStandard: 0.4
},
{
position: 6,
confName: "单帖中天窗",
deductionStandard: 0.8
},
{
position: 7,
confName: "单帖全景天窗",
deductionStandard: 1
}
]
// export const positionTypeList = [
// {
// position: 1,
// confName: "前档玻璃",
// deductionStandard: 1
// },
// {
// position: 2,
// confName: "侧后档玻璃",
// deductionStandard: 2
// },
// {
// position: 3,
// confName: "单帖侧窗一个",
// deductionStandard: 0.4
// },
// {
// position: 4,
// confName: "单帖后档一个",
// deductionStandard: 0.8
// },
// {
// position: 5,
// confName: "单帖小天窗",
// deductionStandard: 0.4
// },
// {
// position: 6,
// confName: "单帖中天窗",
// deductionStandard: 0.8
// },
// {
// position: 7,
// confName: "单帖全景天窗",
// deductionStandard: 1
// }
// ]
// 太阳膜适用车型
export const applicableModelTypeList = [
{
......
......@@ -353,6 +353,14 @@ export const routerName = {
category: "Button",
type: "primary",
handle: "handleBatchOffShelf"
},
{
authId: "9030909",
parentId: "90309",
label: "批量复制",
category: "Button",
type: "primary",
handle: "handleBatchCopy"
}
],
component: _import("goods/grounding/index")
......
......@@ -5,7 +5,7 @@
* @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 {
// BaseData
// } from '@/common/constants'
......@@ -19,7 +19,9 @@ export default {
// 渠道类型
channelType: [],
// 产品分类
productType: []
productType: [],
// 太阳膜类商品部位
positionTypeList: []
},
actions: {
/**
......@@ -29,10 +31,15 @@ export default {
*/
init({ state, dispatch, commit }) {
return new Promise(async (resolve) => {
Promise.all([getChannelType({}), getProductType({})]).then(
async ([channelType, productType]) => {
Promise.all([getChannelType({}), getProductType({}), getPositionList({})]).then(
async ([channelType, productType, positionTypeList]) => {
positionTypeList?.forEach(val => { // 之前前端写死的数据 数据整理 不用改动很多
val.position = val.positionValue
val.confName = val.positionName
})
state.channelType = channelType
state.productType = productType
state.positionTypeList = positionTypeList
// console.log(productType, "productType")
await dispatch("save2db", {
name: "",
......@@ -49,6 +56,7 @@ export default {
return new Promise(async (resolve) => {
state.channelType = []
state.productType = []
state.positionTypeList = []
await dispatch("save2db", {
name: "",
value: state
......@@ -101,8 +109,8 @@ export default {
state =
(await dispatch("getFromdb", "base")) || (await dispatch("init"))
}
const { channelType, productType } = state
resolve({ channelType, productType })
const { channelType, productType, positionTypeList } = state
resolve({ channelType, productType, positionTypeList })
})
},
/**
......
......@@ -136,7 +136,7 @@ export default {
return new Promise(async (resolve) => {
try {
// debugger
console.log(state, dispatch)
// console.log(state, dispatch)
// 设置数据
dispatch(
"d2admin/db/set",
......
......@@ -20,6 +20,12 @@
{{ $$(detail.subOrder,'upgradeGoodsName') }}
</td>
<td class="lb">
部位
</td>
<td class="lb">
{{ $$(detail.subOrder,'positionStr') }}
</td>
<td class="lb">
商品别名
</td>
<td class="lb">
......@@ -39,11 +45,11 @@
数量
</td>
<td>{{ $$(detail.subOrder,'number') }}件</td>
<td rowspan="2"
<td rowspan="2" colspan="2"
class="lb">
支付金额
</td>
<td rowspan="2">
<td rowspan="2" colspan="2">
{{ detail.totalPrice ? '¥ ' + detail.totalPrice : '' }}
</td>
</tr>
......@@ -344,7 +350,7 @@
<script>
import { mapActions } from 'vuex'
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'
export default {
name: 'FinanceDetail',
......@@ -382,21 +388,24 @@ export default {
// shop4sDeductChargeFlagObj: shop4sDeductChargeFlagObj,
// partnerDeductChargeFlagObj: partnerDeductChargeFlagObj,
ledgerData: [], // 分账信息
reconciliationData: [] // 对账信息
reconciliationData: [], // 对账信息
positionTypeList: [] // 商品部位字典
}
},
mounted() {
const row = this.$route.params.rowInfo
console.log(row)
this.getBaseData()
this.isSubOrder = !row.hasOwnProperty('subOrderProfitAllocations')
this.getDetail(row)
},
methods: {
...mapActions({ close: 'd2admin/page/close' }),
...mapActions("d2admin/base", ["get"]),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getDetail(row) {
if (this.$route.params.from && this.$route.params.from == 'orderSupplement') { // 从待补录订单列表跳转过来
mainOrderDetail({ orderCode: row.inputtedOrderCode }).then(res => {
......@@ -422,6 +431,7 @@ export default {
if (res.goodsOrder?.payOrder?.successDate) {
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
const calculateds = res.expenseCategoryCalculateds
if (calculateds && calculateds.length > 0) {
......@@ -502,7 +512,7 @@ export default {
background-color: #fafafa;
}
&.lb {
width: 6em;
width: 6.5em;
text-align: center;
background-color: #fafafa;
}
......
......@@ -248,6 +248,13 @@
<span>{{ scope.row.goodsName || '-' }}</span>
</template>
</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"
label="商品别名"
align="center">
......@@ -791,7 +798,8 @@ export default {
shopProfitType_visible: true, // 列表字段:流量方比例
yq_visible: true, // 列表字段:园区店
/** 根据场景控制页面显示隐藏end */
sceneList: sceneList
sceneList: sceneList,
positionTypeList: [] // 商品部位数据
}
},
......@@ -930,6 +938,7 @@ export default {
...mapActions("d2admin/base", ["get"]),
async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.getOptionsList()
},
handleAddClose(isRefresh = false) { },
......@@ -1018,7 +1027,7 @@ export default {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
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 = {}
temp[this.showFormData[index].optionId] = ''
......@@ -1078,6 +1087,7 @@ export default {
item.subOrderProfitAllocations.forEach(subItem => {
subItem.uniqueKey = temp++
subItem = this.numAddPrefix(subItem)
subItem.positionStr = this.positionTypeList?.filter(val => val.position == subItem.goodsPosition)[0]?.confName || '-'
})
}
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
......@@ -237,7 +237,7 @@ export default {
// 1 太阳膜 2 (1.3场景商品)
let shopType = formData?.goodsType == 1 ? '1' : formData?.sceneType == 3 ? '2' : ''
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')
// 赠送成本:仅产品类型选择“基础产品”时展示
......
......@@ -14,8 +14,21 @@
<div style="padding: 20px;">
<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场景显示升级/产品供货模式 -->
<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"
:label="item.label ? item.label + ':' : ''"
:id="item.name"
......@@ -213,17 +226,23 @@
v-if="filterEmpty(formData.status) || formData.status == 3">
存草稿
</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>
</el-form-item>
</el-form>
<!-- store-api (1精品升级 2次新车转化 3售后众筹 查询嘀加的门店数据 getList)(0会员/权益升级 查询账户中心所有4s店 serviceGetMerchantList) -->
<!-- store-api (1精品升级 2次新车转化 3售后众筹 查询嘀加的门店数据 getList)(0会员/权益升级 查询账户中心所有4s店 getAccountMerchantList) -->
<relate-store-dialog
v-if="relateStoreVisible"
ref="formRelateStore"
:relate-store-visible="relateStoreVisible"
:store-api="formData.sceneType ? getList : serviceGetMerchantList"
:store-api="formData.sceneType ? getList : getAccountMerchantList"
:store-search-form="storeSearchForm"
:store-selected="storeSelected"
:selected-scene="formData.sceneType"
......@@ -248,6 +267,20 @@
@keydown.native="handleStoreInput"
clearable />
</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-form>
</el-row>
......@@ -266,12 +299,13 @@ import { limitPrice } from '@/common/format'
import { mapActions } from 'vuex'
import { uploadImg, uploadPDF } from '@/api/sys.base'
// 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 { baseConfig } from "@/main"
import relateStoreDialog from "./relateStoreDialog.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 {
name: 'groundingForm',
components: {
......@@ -282,7 +316,7 @@ export default {
data() {
return {
getList,
serviceGetMerchantList,
getAccountMerchantList,
equitySceneType: baseConfig.equitySceneType || [],
membraneTypeList,
formData: {},
......@@ -295,6 +329,7 @@ export default {
merchantGoodsRefList: [{ required: true, message: '请选择上架门店', trigger: 'change' }],
sceneType: [{ required: true, message: '请选择业务场景', trigger: 'change' }],
upgradeGoodsId: [{ required: true, message: '请选择上架商品', trigger: 'change' }],
position: [{ required: true, message: '请选择上架部位', trigger: 'change' }],
productType: [{ required: true, message: '请选择产品类型', trigger: 'change' }],
baseSupplyMode: [{ required: true, message: '请选择基础产品供货模式', trigger: 'change' }],
upgradeSupplyMode: [{ required: true, message: '请选择升级/产品供货模式', trigger: 'change' }],
......@@ -329,14 +364,17 @@ export default {
relateStoreVisible: false,
storeSearchForm: {
merchantName: '',
merchantId: ''
merchantId: '',
yqMerchantName: '',
yqMerchantId: ''
},
selectDisabled: false,
dialogObj: {},
uploadFileList: [],
imageFileArr: [],
imgViewerVisible: false,
initialIndex: 0
initialIndex: 0,
positionTypeList: []
}
},
......@@ -428,6 +466,7 @@ export default {
},
mounted() {
this.getBaseData()
this.formData = deepClone(this.originData)
this.copyFormList = deepClone(this.formList)
this.filterEditForm()
......@@ -437,6 +476,9 @@ export default {
...mapActions({
get: 'd2admin/base/get'
}),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
handleFileChange(e, targetItem) {
setTimeout(() => {
var reader = new FileReader()
......@@ -545,14 +587,20 @@ export default {
this.$set(this.formList[0], 'formBlock', newForm)
this.$nextTick(() => {
// 1.3场景 升级产品供货模式
const formIndex = this.formList[0].formBlock.findIndex(subItem => subItem.name == 'upgradeSupplyMode')
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) {
// 由1.3场景 切换到太阳膜 已选升级供货模式为2 的清除掉 太阳膜供货模式没有2
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.$refs[this.formRef + 'd2FormRuleForm'] && this.$refs[this.formRef + 'd2FormRuleForm'].clearValidate()
......@@ -629,13 +677,14 @@ export default {
// 带出上架商品的附带信息
if (targetItem.name === 'upgradeGoodsId') {
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.upgradeGoodsName = _valueObj?.upgradeGoodsName
_formData.type = _valueObj?.type
_formData.upgradePrice = _valueObj?.upgradePrice
_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.goodsTypeName = _valueObj?.goodsTypeName
_formData.goodsType = _valueObj?.goodsType
......@@ -654,6 +703,13 @@ export default {
if (targetItem.name === 'sceneType') {
let _formData = this.formData
if (!this.filterEmpty(this.oldSceneType)) {
// 清空门店弹窗搜索条件
this.storeSearchForm = {
merchantName: '',
merchantId: '',
yqMerchantName: '',
yqMerchantId: ''
}
if (_formData.merchantGoodsRefList?.length)
this.$confirm('切换业务场景,将清空上架门店,是否继续', '提示', {
confirmButtonText: '确定',
......
......@@ -29,6 +29,14 @@
label="门店商户号"
align="center">
</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-pagination small
background
......@@ -120,18 +128,20 @@ export default {
})
},
getSelectingList() {
let _storeSearchForm = this.storeSearchForm
if (!this.selectedScene) {
_storeSearchForm.merchantIdName = _storeSearchForm.merchantName // 账户中心所有门店接口查询条件
}
this.storeApi({
...this.storeSearchForm,
currentPage: this.currentPage,
pageSize: this.pageSize,
scene: this.selectedScene ? this.selectedScene : ''
scene: this.selectedScene
}).then(res => {
res?.list?.forEach(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.total = res.total
......
......@@ -11,9 +11,9 @@
</template>
<script>
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 { positionTypeList, sceneCodeList } from '@/common/constants.js'
import { BaseData, sceneCodeList } from '@/common/constants.js'
import { mapActions } from 'vuex'
import { deepClone } from '@/common/util'
import { baseConfig } from '@/main'
......@@ -71,6 +71,11 @@ export default {
value: 'upgradeCommodityCode'
}]
}, {
name: 'position',
label: '上架部位',
type: 'radio',
radioGroupList: []
}, {
name: 'goodsAlias',
label: '商品别名',
type: 'input',
......@@ -208,6 +213,7 @@ export default {
// 获取全部上架商品
this.getSelectingList()
} else {
this.addOrEdit = 'edit'
// 获取商品详情
this.getDetailInfo(id)
}
......@@ -297,16 +303,18 @@ export default {
const res = new Map()
return arr.filter((a) => !res.has(a.confId) && res.set(a.confId, 1))
},
getBaseData() {
async getBaseData() {
this.editForm.forEach(item => {
item.formBlock && item.formBlock.forEach(v => {
if (v.type == 'check') {
v.checkGroupList = productList // 产品类型
} else if (v.type == 'radio') {
if (v.index == '1') {
if (v.index == 1) {
v.radioGroupList = baseSupplyModeList // 基础供货模式
} else {
} else if (v.index == 2) {
v.radioGroupList = upgradeSupplyModeList // 升级供货模式
} else {
v.radioGroupList = []
}
}
if (v.name == 'sceneType') { // 业务场景
......@@ -314,16 +322,18 @@ export default {
}
})
})
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then(res => {
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?.baseProductFlag == 'Y') productType.push(1)
res.productType = productType // 产品类型
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.upgradeCommodityCode = res?.upgradeCommodityCode // 商品ID
res.warrantyPeriod = res?.upgradeGoods?.warrantyPeriod // 质保年限
......@@ -358,7 +368,7 @@ export default {
const { num } = data
this.confirm(num, data)
},
confirm(num, data) {
confirm(num, data, existCheck = true) {
// 1保存并上架 2存草稿
const formObj = {}
this.editForm.forEach(val => {
......@@ -390,31 +400,79 @@ export default {
// 整理上传凭证数据
delete formObj?.productType
const params = {
saveDraft: num !== 1,
saveDraft: num === 2, // 是否存草稿
id: data.id,
...formObj,
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>是否确定保存?', '提示', {
confirmButtonText: '确定',
dangerouslyUseHTMLString: true,
type: 'warning'
}).then(() => {
addOrUpdateAPI(this.dealObjectValue(params)).then(res => {
this.notice.okTips()
this.handleClose(true)
})
// 校验上架记录中是否已存在
this.checkEvent(checkParams, params, num)
}).catch(err => {
console.log(err)
})
} else {
addOrUpdateAPI(this.dealObjectValue(params)).then(res => {
this.notice.okTips()
this.handleClose(true)
})
// 校验上架记录中是否已存在
this.checkEvent(checkParams, params, num)
}
},
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) {
var param = {}
......
......@@ -11,7 +11,7 @@
<script>
import { getMerchantGoodsInfo, batchReviewAPI } from '@api/grounding'
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 { deepClone, Util } from '@/common/util'
import { productList, baseSupplyModeList, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from './constants/data'
......@@ -72,6 +72,9 @@ export default {
value: 'upgradeCommodityCode'
}]
}, {
name: 'positionStr',
label: '上架部位'
}, {
name: 'goodsAlias',
label: '商品别名'
}, {
......@@ -144,6 +147,7 @@ export default {
}
},
mounted() {
this.getBaseData()
// 获取商品详情
const id = this.$route.params.id
this.detailId = id
......@@ -155,6 +159,9 @@ export default {
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then(res => {
const productType = []
......@@ -162,7 +169,7 @@ export default {
if (res?.baseProductFlag == 'Y') productType.push(1)
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 => {
if (productType.includes(v.confId)) productTypeTextArr.push(v.confName)
......@@ -184,7 +191,7 @@ export default {
res.sceneName = sceneList[res.sceneType] || '-'
res.upgradePrice = res.upgradeGoods?.upgradePrice
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.serviceItemNames = res.upgradeGoods?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',')
res.warrantyPeriod = res.upgradeGoods?.warrantyPeriod
......@@ -193,6 +200,7 @@ export default {
res.thirdPartyCode = res?.upgradeGoods?.thirdPartyCode || ''
res.entityCardFlag = res?.upgradeGoods?.entityCardFlag
res.voucherList = res?.voucherList || []
res.positionStr = deepClone(this.positionTypeList)?.filter(val => res?.position == val.position)[0]?.confName || ''
this.editData = res || {}
this.$nextTick(() => {
this.show = true
......
......@@ -38,6 +38,10 @@
<span style="{display: inline-block};margin-left: 10px">
<auth-button category="Button" :show-btn-ids="['9030908']" />
</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">
<auth-button category="Button" :show-btn-ids="['9030902']" />
......@@ -120,19 +124,29 @@
</div>
</d2-table>
</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>
</template>
<script>
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 { sceneCodeList, sceneList } from '@/common/constants.js'
import { sceneCodeList, sceneList, BaseData } from '@/common/constants.js'
import { getParkStore } from '@api/editCustomer'
import { mapActions, mapState } from 'vuex'
import { baseSupplyModeList, upgradeSupplyModeList } from './constants/data'
import { getShopMerchantList } from '@api/deviceManage'
import { baseConfig } from '@/main'
import batchCopyDialog from './components/batchCopyDialog.vue'
export default {
components: { batchCopyDialog },
name: 'groundingIndex',
data() {
return {
......@@ -335,6 +349,14 @@ export default {
prop: 'goodsTypeName',
width: 140
}, {
label: '上架部位',
parentProp: 'goodsInfo',
prop: 'position',
width: 140,
formatter: (cellValue) => {
return deepClone(this.positionTypeList)?.filter(val => cellValue?.position == val.position)[0]?.confName || '-'
}
}, {
label: '商品别名',
prop: 'goodsAlias',
formatter: (cellValue) => {
......@@ -444,10 +466,14 @@ export default {
confValue: '已下架'
}]
},
selfBuildGoodsType: baseConfig.selfBuildGoodsType || ''
selfBuildGoodsType: baseConfig.selfBuildGoodsType || '',
batchCopySelectScene: '', // 批量复制选中的场景值
batchCopyVisible: false,
batchCopySelectData: [] // 批量辅助选中的上架数据
}
},
mounted() {
this.getBaseData()
var allOpt = { confId: '', confValue: '全部' }
this.baseData.statusList.unshift(allOpt)
this.baseData.sceneCodeList = deepClone(sceneCodeList)
......@@ -488,6 +514,9 @@ export default {
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
......@@ -687,6 +716,39 @@ export default {
}).catch(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 @@
<script>
import { getGoodsInfoById } from '@/api/commodity'
import { membraneTypeList, positionTypeList } from '@/common/constants'
import { membraneTypeList } from '@/common/constants'
import { deepClone } from '@/common/util'
import { baseConfig } from '@/main'
export default {
......@@ -119,6 +119,10 @@ export default {
commodityInfoId: {
type: [String, Number],
default: () => { }
},
positionTypeList: {
type: Array,
default: () => { }
}
},
......@@ -141,8 +145,8 @@ export default {
getInfo(id) {
getGoodsInfoById({ id: id }).then(res => {
res?.upgradeGoodsList?.forEach(item => {
let positionNamesArr = item?.goodsInfo?.goodsType == 1 ? deepClone(positionTypeList).filter(val => item.position == val.position) : []
item.positionNames = positionNamesArr.length ? positionNamesArr[0]?.confName : ''
let positionNamesArr = item?.goodsInfo?.goodsType == 1 ? deepClone(this.positionTypeList).filter(val => item.position.includes(val.position)) : []
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(',')
})
this.commodityInfo = res
......
......@@ -211,7 +211,10 @@
<td v-if="goodsInfoData.goodsType == 1">
<el-select placeholder="部位"
size="small"
multiple
collapse-tags
:class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }"
style="width: 180px;"
v-model="subItem.position"
@change="changePosition($event, subIndex)">
<el-option v-for="childItem in productPositionTypeList"
......@@ -465,7 +468,7 @@
import { limitPrice } from '@/common/format'
import { deepClone } from '@/common/util'
import { mapGetters, mapMutations } from 'vuex'
import { positionTypeList, membraneTypeList } from '@/common/constants'
import { membraneTypeList } from '@/common/constants'
import { baseConfig } from '@/main'
import serviceItemsDialog from "./serviceItemsDialog.vue"
import { getProductServiceItems } from '@api/productManage'
......@@ -532,6 +535,10 @@ export default {
productServiceItemList: {
type: Array,
default: () => []
},
positionTypeList: {
type: Array,
default: () => []
}
},
mounted() {
......@@ -577,7 +584,7 @@ export default {
},
'goodsInfoData.goodsPositionList': {
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
},
......@@ -826,7 +833,7 @@ export default {
if (i == 0) {
this.goodsInfoData.goodsSpecificationList.push({
id: '',
position: '',
position: [],
purchasePrice: '',
specificationData: '',
specsValueList: [this.goodsInfoData.specificationDetailList[i]?.specificationValueList[j]?.specificationValue],
......
......@@ -148,7 +148,7 @@
@change="selectAddAttr($event, item)"
:style="{'width': item.width || formItemWidth}"
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"
:key="subItem[item.optionId]"
:label="subItem[item.optionLabel]"
......@@ -440,10 +440,9 @@
<script>
import { deepClone } from '@/common/util'
import { uploadImg, uploadVideo } from '@/api/sys.base'
import { positionTypeList, applicableModelTypeList } from '@/common/constants'
import { limitPrice } from '@/common/format'
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 { baseConfig } from '@/main'
export default {
......@@ -451,6 +450,7 @@ export default {
data() {
return {
equitySceneType: baseConfig.equitySceneType || [],
solarFilmArr: baseConfig.solarFilmArr || [1, 111, 112],
userInfo: this.$store.state.d2admin.user.info,
lookImgVisible: false,
formData: {},
......@@ -463,12 +463,39 @@ export default {
url: '',
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: [
{
name: 'positionIds',
label: '部位',
type: 'multiple-select',
optionList: deepClone(positionTypeList),
optionList: [],
optionId: 'position',
optionLabel: 'confName',
width: '432px'
......@@ -522,10 +549,6 @@ export default {
type: String,
default: '100%'
},
rules: {
type: Object,
default: () => { }
},
formRef: {
type: String,
default: ''
......@@ -560,8 +583,9 @@ export default {
deep: true
},
'formData.positionIds': {
handler(newVal) {
let arr = deepClone(positionTypeList).filter(val => newVal.indexOf(val.position) > -1)
async handler(newVal) {
let copyPositionTypeList = await this.get(BaseData.positionTypeList)
let arr = deepClone(copyPositionTypeList)?.filter(val => newVal.indexOf(val.position) > -1)
this.formData.goodsPositionList?.forEach(val => {
arr.forEach(item => {
if (val.position === item.position) {
......@@ -575,19 +599,21 @@ export default {
}
},
mounted() {
async mounted() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.formData = deepClone(this.originData)
this.formData.merchantId = this.userInfo.detail.merchantId
this.$nextTick(() => {
this.$refs[this.formRef + 'd2FormRuleForm'].clearValidate()
})
let copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock)
// 太阳膜类 部位下拉框数据
copyMembranesFormBlock[copyMembranesFormBlock.findIndex(val => val.name == 'positionIds')].optionList = this.positionTypeList
if (this.formData.goodsType == 1) {
this.membranesFormBlock = copyMembranesFormBlock
} else if (this.formData.goodsType == 12 || this.formData.goodsType == 14 || this.formData.goodsType == 4 || this.formData.goodsType == 6) {
this.membranesFormBlock = [copyMembranesFormBlock[1]]
}
// this.getProductServiceItemList()
},
methods: {
......@@ -595,9 +621,6 @@ export default {
get: 'd2admin/base/get'
}),
...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
// async getProductServiceItemList() {
// this.productServiceItemList = await this.get(BaseData.productServiceItemList)
// },
selectBlur() {
this.editOptionIndex = -1
this.showOptionInput = false
......@@ -687,6 +710,8 @@ export default {
var tempVal = targetItem.optionList.find(item => item.categoryType === value)
this.formData.goodsTypeName = tempVal.categoryName
let copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock)
// 太阳膜类 部位下拉框数据
copyMembranesFormBlock[copyMembranesFormBlock.findIndex(val => val.name == 'positionIds')].optionList = this.positionTypeList
this.formData.convertedValue = 30
this.membranesFormBlock = []
if (this.formData.goodsType == 1) {
......@@ -701,8 +726,8 @@ export default {
selectAll(value, targetItem) {
let _formData = this.formData
if (targetItem.name == 'positionIds') {
if (_formData.positionIds.length < (deepClone(positionTypeList).length + 1)) {
_formData.positionIds = deepClone(positionTypeList).map(item=>{
if (_formData.positionIds.length < (deepClone(this.positionTypeList).length + 1)) {
_formData.positionIds = deepClone(this.positionTypeList).map(item=>{
return item.position
})
} else {
......@@ -822,6 +847,9 @@ export default {
this.$emit('handleAddConfirm', this.formData)
} else {
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])
return true
}
......
......@@ -10,6 +10,7 @@
<span>序号</span>
</td>
<td>
<span class="color-red">*</span>
<span>商品</span>
</td>
<td>
......@@ -114,7 +115,10 @@
<td v-if="goodsInfoData.goodsType == 1">
<el-select placeholder="部位"
size="small"
multiple
collapse-tags
:class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }"
style="width: 180px;"
v-model="subItem.position"
@change="changePosition($event, subIndex)">
<el-option v-for="childItem in productPositionTypeList"
......@@ -318,7 +322,7 @@
<script>
import { limitPrice } from '@/common/format'
import { mapGetters, mapMutations } from 'vuex'
import { positionTypeList, membraneTypeList } from '@/common/constants'
import { membraneTypeList } from '@/common/constants'
import { deepClone } from "@/common/util"
import { baseConfig } from '@/main'
import serviceItemsDialog from "./serviceItemsDialog.vue"
......@@ -355,6 +359,10 @@ export default {
productServiceItemList: {
type: Array,
default: () => []
},
positionTypeList: {
type: Array,
default: () => []
}
},
watch: {
......@@ -372,7 +380,7 @@ export default {
},
'goodsInfoData.goodsPositionList': {
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
},
......@@ -492,7 +500,7 @@ export default {
}
this.goodsInfoData.goodsSpecificationSingleList.push({
id: '',
position: '',
position: [],
purchasePrice: '',
specificationData: '',
specsValueList: [],
......
......@@ -3,7 +3,6 @@
<div class="title">产品系列-SPU</div>
<productForm v-if="show"
ref="d2GoodsProductForm"
:rules="rules"
:add-or-edit="addOrEdit"
form-name="product"
:origin-data="editData"
......@@ -27,24 +26,6 @@ export default {
return {
userInfo: this.$store.state.d2admin.user.info,
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: {
goodsName: '',
goodsType: '',
......
......@@ -22,8 +22,8 @@
</div>
</div>
<div class="speci-box" id="specificationDetailList">
<singleSpecificationForm ref="singleSpecificationFormRef" v-show="goodsInfoData.specificationType == '1'" :productServiceItemList="productServiceItemList"></singleSpecificationForm>
<multipleSpecificationForm ref="multipleSpecificationFormRef" v-show="goodsInfoData.specificationType == '2'" :productServiceItemList="productServiceItemList"></multipleSpecificationForm>
<singleSpecificationForm ref="singleSpecificationFormRef" v-show="goodsInfoData.specificationType == '1'" :productServiceItemList="productServiceItemList" :positionTypeList="positionTypeList"></singleSpecificationForm>
<multipleSpecificationForm ref="multipleSpecificationFormRef" v-show="goodsInfoData.specificationType == '2'" :productServiceItemList="productServiceItemList" :positionTypeList="positionTypeList"></multipleSpecificationForm>
</div>
</div>
</div>
......@@ -45,7 +45,8 @@ export default {
return {
userInfo: this.$store.state.d2admin.user.info,
productPositionTypeList: [],
productServiceItemList: []
productServiceItemList: [],
positionTypeList: []
}
},
computed: {
......@@ -56,14 +57,15 @@ export default {
// 多规格
this.goodsInfoData.specificationType = '2'
}
this.getProductServiceItemList()
this.getBaseData()
},
methods: {
...mapActions({
get: 'd2admin/base/get'
}),
async getProductServiceItemList() {
async getBaseData() {
this.productServiceItemList = await this.get(BaseData.productServiceItemList)
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
// 新增规格
......
......@@ -58,7 +58,8 @@
<drawer-detail v-if="drawerDetailVisible"
:drawer-detail-visible="drawerDetailVisible"
:commodity-info-id="commodityDetailInfoId"
@handleDrawerClose="handleDrawerClose" />
@handleDrawerClose="handleDrawerClose"
:positionTypeList="positionTypeList"/>
</d2-container>
</template>
......@@ -70,6 +71,7 @@ import { mapActions, mapState } from 'vuex'
import { baseGoodsDelete } from '@api/commodity'
import drawerDetail from './components/drawerDetail.vue'
import { baseConfig } from '@/main'
import { BaseData } from '@/common/constants'
export default {
name: 'Commodity',
data() {
......@@ -219,7 +221,8 @@ export default {
confValue: '草稿'
}]
},
selfBuildGoodsType: baseConfig.selfBuildGoodsType || '' // 服务商自建类目值
selfBuildGoodsType: baseConfig.selfBuildGoodsType || '', // 服务商自建类目值
positionTypeList: []
}
},
......@@ -250,6 +253,7 @@ export default {
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.baseData.productTypeList.unshift({
categoryType: '',
categoryName: '全部'
......
......@@ -30,9 +30,8 @@ import { deepClone } from '@/common/util'
import { mapActions, mapGetters, mapMutations } from 'vuex'
import sourceMaterial from './components/sourceMaterial.vue'
import specifications from './components/specifications.vue'
import { positionTypeList, applicableModelTypeList } from '@/common/constants'
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 { baseConfig } from '@/main'
export default {
......@@ -82,12 +81,14 @@ export default {
editGoodsData: false,
productFormData: {
carTypeList: [1, 2, 3, 4]
}
},
positionTypeList: []
}
},
created() {
this.addOrEdit = this.$route.params.addOrEdit
this.getBaseData()
},
mounted() {
this.show = false
......@@ -110,6 +111,9 @@ export default {
}),
...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
...mapActions({ close: 'd2admin/page/close' }),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getGoodsInfo(id) {
getGoodsInfoById({ id: id }).then(res => {
let specificationDetailList = []
......@@ -118,9 +122,10 @@ export default {
val?.upgradeGoodsServiceItemsList?.forEach(v => {
v.uniqueValue = `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}`
})
console.log(val)
return {
id: val.id,
position: val.position,
position: val.position ? (val.position + '')?.split(',')?.map(Number) : [],
purchasePrice: val.purchasePrice,
specificationData: val.specificationData,
specsValueList: val.specificationData?.split(';~;'),
......@@ -160,7 +165,7 @@ export default {
goodsPositionList: selectedPositions,
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('/') : '',
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
}
this.productFormData = deepClone(res.goodsInfo) || {}
......@@ -233,7 +238,7 @@ export default {
specsValueList: [item.specificationData],
upgradePrice: item.upgradePrice,
warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : '', // 质保年限 仅膜类
position: productFormData?.goodsType === 1 ? item.position : '', // 部位 仅太阳膜
position: productFormData?.goodsType === 1 ? item.position?.join(',') : [], // 部位 仅太阳膜
type: item.type,
thirdPartyCode: item.thirdPartyCode,
purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : '', // 采购价 仅上架至采购商城
......@@ -286,7 +291,7 @@ export default {
specificationData: specificationData,
upgradePrice: item.upgradePrice,
warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : '', // 质保年限 仅膜类
position: productFormData?.goodsType === 1 ? item.position : '', // 部位 仅太阳膜
position: productFormData?.goodsType === 1 ? item.position?.join(',') : [], // 部位 仅太阳膜
type: item.type,
thirdPartyCode: item.thirdPartyCode,
purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : '', // 采购价 仅上架至采购商城
......@@ -305,7 +310,7 @@ export default {
delete productFormData.goodsPositionList
}
var params = {
goodsInfo: this.dealObjectValue(productFormData),
goodsInfo: this.dealObjectValue(deepClone(productFormData)),
upgradeGoods: {
id: data.id || '',
baseGoodsName: data.specificationType == 1 ? '' : data.baseGoodsName,
......@@ -315,13 +320,16 @@ export default {
},
saveDraft: flag !== 1 // flag 1提交 2存草稿
}
console.log(params)
if (params?.upgradeGoods?.goodsSpecificationList?.length > 75) {
return this.$message({
type: 'warning',
message: '商品数量过多,无法操作,请确认后重新保存'
})
}
// 添加详情描述 未填写文字或上传图片 删除请求参数字段
params?.goodsInfo?.goodsDescList.forEach((subVal, subIdx) => {
if (!subVal?.content) delete params.goodsInfo.goodsDescList[subIdx]
})
let requestEvent = this.addOrEdit == 'add' ? addProductManage : UpdateProductManage
requestEvent(params).then(res => {
this.notice.okTips()
......@@ -332,9 +340,9 @@ export default {
var param = {}
if (obj === null || obj === undefined || obj === "") return param
for (var key in obj) {
if (obj[key] !== null && obj[key] !== undefined && obj[key] !== "") {
param[key] = obj[key];
}
if (obj[key] !== null && obj[key] !== undefined && obj[key] !== "") {
param[key] = obj[key];
}
}
return param
},
......
......@@ -49,6 +49,7 @@
<el-table-column type="index" label="序号" :index="(index) => index + (page.pageNum - 1) * page.pageSize + 1"
align="center" />
<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="paySuccessDate" />
......@@ -164,10 +165,8 @@
分账记录
</el-button>
<!-- 取消分账 分帐中状态 -->
<el-button type="text"
size="small"
v-if="scope.row.profitAllocationStatus == 5"
@click="cancelRule(scope.row)">
<el-button type="text" size="small" v-if="scope.row.profitAllocationStatus == 5"
@click="cancelRule(scope.row)">
取消分账
</el-button>
</template>
......@@ -235,7 +234,7 @@ import { getParkStore } from "@api/editCustomer"
import chooseRuleDialog from './chooseRuleDialog'
import ruleInfoDialog from './ruleInfoDialog'
export default {
name: "Order",
name: "CarDamage",
components: {
chooseRuleDialog,
ruleInfoDialog
......@@ -258,7 +257,7 @@ export default {
// 1: "待升级",
// 2: "战败",
3: "待支付",
4: "已支付",
4: "已支付"
// // 5: '已退款',
// 6: "已评价",
// 9: "已撤销",
......@@ -428,6 +427,13 @@ export default {
optionLabel: 'confLabel',
optionsName: 'profitAllocationStatusList'
},
{
label: "交易参考号",
name: "tradeNo",
type: "input",
isClear: true,
keyFn: this.keyDowmGetList
}
],
searchForm: {
sceneType: 0,
......@@ -460,7 +466,7 @@ export default {
{
confId: 4,
confLabel: "已支付"
},
}
// {
// confId: 6,
// confLabel: "已评价"
......@@ -540,7 +546,7 @@ export default {
confId: '5',
confLabel: '分账中'
}
],
]
},
tableData: [],
total: 0,
......@@ -750,7 +756,7 @@ export default {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName]?.length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
......@@ -915,11 +921,11 @@ export default {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
cancelDivideAccountsAPI({orderCode: row.orderCode}).then(res => {
cancelDivideAccountsAPI({ orderCode: row.orderCode }).then(res => {
this.notice.okTips()
this.handleSearch()
})
}).catch(() => {})
}).catch(() => { })
},
ruleInfoDialogClose(flag) {
......
......@@ -127,9 +127,31 @@
退款
</el-button>
</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>
</d2-table>
</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>
</div>
</template>
......@@ -143,8 +165,12 @@ import {
import { Util, deepClone } from "@/common/util"
import orderManage from "@api/orderManage"
import { batchUpdateToNotInput, batchUpdateConfirmInput, markAsRefunded, cancelDivideAccountsAPI, verification, refund } from '@api/order'
import chooseRuleDialog from './chooseRuleDialog'
import ruleInfoDialog from './ruleInfoDialog'
export default {
components: {
chooseRuleDialog,
ruleInfoDialog
},
data() {
return {
......@@ -255,7 +281,11 @@ export default {
{ confId: "3", confName: "已分账" },
{ confId: "4", confName: "分账中" }
]
}
},
ruleVisible: false,
recordInfo: null,
ruleInfoVisible: false
}
},
name: "ConfigUpgradation",
......@@ -761,6 +791,51 @@ export default {
}).catch(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 @@
<template>
<d2-container>
<div class="order-detail">
<div class="edit-box">
<div class="container m-b-20">
<p class="edit-title">订单信息</p>
<el-form label-width="100px"
:inline="true">
<el-row v-for="(item, index) in detailFormDataRow"
:key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList"
:key="subIndex"
:label="subItem.label"
class="row-item">
<div class=""
v-if="subItem.isImage">
<img v-if="detailForm[subItem.name]"
class="order-img"
:src="detailForm[subItem.name]"
@click="handleEnlargeImg(detailForm[subItem.name])">
<span v-else>-</span>
<div class="edit-box">
<div class="container m-b-20">
<p class="edit-title">订单信息</p>
<el-form label-width="100px"
:inline="true">
<el-row v-for="(item, index) in detailFormDataRow"
:key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList"
:key="subIndex"
:label="subItem.label"
class="row-item">
<div class="" v-if="subItem.isImage">
<div v-if="$$(detailForm[subItem.name], 'length')">
<img v-for="(subVal, subKey) in detailForm[subItem.name]" :key="subKey" class="order-img"
:src="subVal"
@click="handleEnlargeImg(subVal)">
</div>
<span v-else
class="detail-txt ellipsis-1"
:title="detailForm[subItem.name]">{{
<span v-else>-</span>
</div>
<!-- 交易流水号换行显示 -->
<span v-else class="detail-txt ellipsis-1" :class="subItem.name == 'transactionReferenceId' ? 'show-text' : ''"
:title="detailForm[subItem.name]">{{
detailForm[subItem.name]
? detailForm[subItem.name] + (subItem.suffix || "")
: "-"
......@@ -117,7 +117,7 @@
<el-dialog :visible="imgVisible"
:before-close="handleEnlargeImg">
<img width="100%"
:src="detailForm.payVoucher"
:src="previewImgUrl"
alt="图片">
</el-dialog>
</d2-container>
......@@ -196,7 +196,8 @@ export default {
]
},
hideStatus: false,
imgVisible: false // 收款凭证图片弹窗
imgVisible: false, // 收款凭证图片弹窗
previewImgUrl: ''
}
},
......@@ -215,7 +216,7 @@ export default {
},
{
label: "商户订单号",
name: "outTradeNo"
name: "transactionReferenceId"
},
{
label: "订单时间",
......@@ -296,7 +297,7 @@ export default {
},
{
label: '收款凭证',
name: 'payVoucher',
name: 'payVoucherList', // 后端返回对应字段是payVoucher用','隔开
isImage: true
}
]
......@@ -326,6 +327,7 @@ export default {
orderManage
.getOrderDetailApi({ orderCode: this.routeInfo.orderCode })
.then((res) => {
res.payVoucherList = res?.payVoucher?.split(',') || []
this.detailForm = res
this.orderRefund = res.orderRefund || null
this.detailForm.createdDateStr = Util.dateFormate(
......@@ -419,8 +421,9 @@ export default {
this.formToRow("detailFormData")
})
},
handleEnlargeImg() {
handleEnlargeImg(url) {
this.imgVisible = !this.imgVisible
this.previewImgUrl = url
},
handleCancel() {
this.$router.push({
......@@ -477,6 +480,7 @@ export default {
.order-detail .row-item .order-img {
width: 80px;
height: 80px;
margin-right: 8px;
cursor: pointer;
}
.detail-txt {
......@@ -487,6 +491,10 @@ export default {
text-overflow: ellipsis;
white-space: nowrap;
}
.order-detail .row-item .show-text{
word-wrap: break-word;
white-space: normal;
}
.order-detail .show-table > tbody > tr > td {
text-align: center;
vertical-align: middle;
......
......@@ -98,6 +98,13 @@
</span>
</template>
</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">
<template slot-scope="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
......@@ -522,7 +529,8 @@ export default {
subShopMerchanShowHide: true,
ruleVisible: false,
recordInfo: null,
ruleInfoVisible: false
ruleInfoVisible: false,
positionTypeList: []
}
},
computed: {
......@@ -601,6 +609,7 @@ export default {
...mapMutations('d2admin/user', ['setUpdateRefesh']),
...mapActions("d2admin/base", ["get"]),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.getOptionsList()
},
......@@ -715,7 +724,7 @@ export default {
getOptionsList() {
this.showFormData.forEach((item, index) => {
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 = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
......@@ -753,6 +762,9 @@ export default {
getList(params).then(res => {
this.tableData = res.list.map((item) => {
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
})
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 {
rejectCause: ''
},
dialogConfig: {
title: '驳回提示',
title: '驳回',
width: '750px'
},
formRules: {
......@@ -65,7 +65,7 @@ export default {
return this.rejectVisible
},
set(newVal) {
this.$emit('dialogClose', newVal)
this.$emit('dialogClose', { flag: newVal, attrName: 'rejectVisible'})
// this.$emit('update:visible', newVal)
}
}
......
......@@ -50,6 +50,12 @@
<orderDeatilDialog :visible.sync="detailVisible"
v-if="detailVisible"
:params-obj="paramsObj"></orderDeatilDialog>
<CheckDialog :check-visible="checkVisible"
v-if="checkVisible"
:params-obj="paramsObj"
fromPage="procurementBusiness"
@dialogClose="dialogClose">
</CheckDialog>
<rejectDialog :reject-visible="rejectVisible"
v-if="rejectVisible"
:params-obj="paramsObj"
......@@ -65,11 +71,13 @@ import { mapActions, mapState } from 'vuex'
import { getPurchaseOrderList, getMerchantList, purchaseOrderCancelOrCheck, businessreviewPage, businessreviewBusinessAudit } from '@/api/purchaseShopping.js'
import orderDeatilDialog from './components/orderDetailDialog'
import rejectDialog from './components/rejectDialog'
import CheckDialog from './components/CheckDialog'
export default {
name: 'PurchaseOrder',
components: {
orderDeatilDialog,
rejectDialog
rejectDialog,
CheckDialog
},
data() {
return {
......@@ -236,6 +244,7 @@ export default {
detailVisible: false,
// 驳回
rejectVisible: false,
checkVisible: false,
// 基本数据
baseData: {
business_statusOptions: [],
......@@ -352,21 +361,8 @@ export default {
},
// 审核
handleCheck(row) {
this.$confirm(`订单审核后会自动流转至供应商进行确认并发货。是否确定审核?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
// purchaseOrderCancelOrCheck({
businessreviewBusinessAudit({
orderCode: row.orderCode,
operateType: 1
}).then(() => {
this.notice.okTips()
this.$refs.purchasementReviewTable.refreshTable()
}).catch(() => { })
})
this.checkVisible = !this.checkVisible
this.paramsObj = row
},
// 查看详情
handleDetail(row) {
......@@ -385,9 +381,9 @@ export default {
}
this.rejectVisible = true
},
dialogClose(flag) {
this.rejectVisible = !this.rejectVisible
if (flag) {
dialogClose(obj) {
this[obj.attrName] = !this[obj.attrName]
if (obj.flag) {
this.$refs.purchasementReviewTable.refreshTable()
}
}
......
......@@ -278,18 +278,21 @@ export default {
7: 'redSpot'
}[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 {
handleExport() {
this.filterSearchTime()
var params = this.tableSearchForm
delete params.placeOrderTimeStr
// 处理查询条件时间
for (const key in params) {
if (key == 'orderTimeStr') {
......@@ -392,7 +396,8 @@ export default {
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
const list = [
...this.dowloadList,
......
......@@ -110,7 +110,7 @@
</el-form>
</div>
</div>
<div class="rulesCon" v-else>
<!-- <div class="rulesCon" v-else>
<el-tabs v-model="nonFusionActiveName">
<el-tab-pane label="计算规则" name="first"></el-tab-pane>
</el-tabs>
......@@ -157,7 +157,7 @@
</div>
</el-form>
<el-button v-show="!isEdit" class="addBtn" @click="addFormItem" type="primary">新增价格区间</el-button>
</div>
</div> -->
</div>
</el-form-item>
</el-form>
......@@ -407,15 +407,15 @@ export default {
resolve(params)
})
} else {
this.$refs.formRef.validate((valid) => {
if (valid) {
const form = deepClone(this.form)
const storeForm = deepClone(this.storeForm)
delete storeForm.quotationGoodsInfo
resolve({ ...storeForm, vdRuleIntervalList: form.vdRuleIntervalList }
)
}
})
// this.$refs.formRef.validate((valid) => {
// if (valid) {
const form = deepClone(this.form)
const storeForm = deepClone(this.storeForm)
delete storeForm.quotationGoodsInfo
resolve({ ...storeForm, vdRuleIntervalList: form.vdRuleIntervalList }
)
// }
// })
}
})
// })
......@@ -452,20 +452,20 @@ export default {
console.log(res)
if (res) {
this.storeForm = Object.assign(this.storeForm, res, { mode: res.mode != null ? res.mode : 0 })
if (this.storeForm.mode == 1) {
this.form.vdRuleIntervalList = res.vdRuleIntervalList.map((item) => {
const { id, ruleId, reorder, low, high, recommendation, minimum } = item
return {
id,
ruleId,
reorder,
low,
high,
recommendation,
minimum
}
})
}
// if (this.storeForm.mode == 1) {
// this.form.vdRuleIntervalList = res.vdRuleIntervalList.map((item) => {
// const { id, ruleId, reorder, low, high, recommendation, minimum } = item
// return {
// id,
// ruleId,
// reorder,
// low,
// high,
// recommendation,
// minimum
// }
// })
// }
this.distributionList = []
distributionTemp.forEach((item) => {
......
......@@ -106,15 +106,15 @@
<el-form class="edit-sub-block" :inline="true">
<el-form-item label="商品:" class="goods">
<img v-if="$$(detail.quotationGoodsInfo, 'titlePictureUrl')" class="order-img"
:src="$$(detail.quotationGoodsInfo, 'titlePictureUrl')" @click="handleEnlargeImg">
{{ $$(detail.quotationGoodsInfo, 'goodsName') }}
:src="$$(detail.quotationGoodsInfo, 'titlePictureUrl')" @click="handleEnlargeImg" />
{{ $$(detail, 'goodsName') }}
</el-form-item>
<el-form-item label="增值权益价格/元:">
{{ detail.quotedPriceUpdate / 100 }}
</el-form-item>
</el-form>
</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>
......@@ -226,7 +226,7 @@ export default {
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.order-detail {
.d2-container-content {
margin-top: 0 !important;
......@@ -259,9 +259,12 @@ export default {
}
.goods {
height: 100px;
// height: 100px;
// display: flex;
::v-deep .el-form-item__content {
max-width: 240px;
word-break: break-all
}
}
.order-img {
......
......@@ -34,6 +34,14 @@
</d2-table>
</div>
</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-visible="stockMonthVisible"
......@@ -46,7 +54,7 @@
<script>
import { mapActions, mapState } from "vuex"
import { getList, quotationPrint, quotationExport, contractExport } from "@api/vehicleDamage"
import { getList, quotationPrint, quotationExport, contractExport, listContracts } from "@api/vehicleDamage"
export default {
name: "StockList",
data() {
......@@ -194,7 +202,20 @@ export default {
{ severName: "已完成", severType: 5 }
]
},
previewVisible: false,
// 驳回
dialogConfig: {
setting: {
showClose: true,
isShowFooter: false
// appendToBody: true,
},
config: {
title: '打印合同',
width: '480px'
}
},
previewList: [],
stockMonthVisible: false,
recordInfo: null
}
......@@ -240,9 +261,21 @@ export default {
})
},
// 打印权益合同
handlePrintContract(row) {
// 获取权益合同PDF
contractExport({ orderId: row.orderId }).then((res) => {
async handlePrintContract(row) {
const res = await listContracts({ orderId: row.orderId })
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)
})
},
......@@ -356,4 +389,26 @@ export default {
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>
......@@ -9146,7 +9146,7 @@ safe-regex@^1.1.0:
resolved "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
sass-loader@^7.1.0:
sass-loader@^7.3.1:
version "7.3.1"
resolved "https://registry.npmmirror.com/sass-loader/-/sass-loader-7.3.1.tgz#a5bf68a04bcea1c13ff842d747150f7ab7d0d23f"
integrity sha512-tuU7+zm0pTCynKYHpdqaPpe+MMTQ76I9TPZ7i4/5dZsigE350shQWe5EZNl5dBidM49TPET75tNqRbcsUZWeNA==
......@@ -9157,10 +9157,10 @@ sass-loader@^7.1.0:
pify "^4.0.1"
semver "^6.3.0"
sass@^1.18.0:
version "1.59.2"
resolved "https://registry.npmmirror.com/sass/-/sass-1.59.2.tgz#537f6d11614d4f20f97696f23ad358ee398b1937"
integrity sha512-jJyO6SmbzkJexF8MUorHx5tAilcgabioYxT/BHbY4+OvoqmbHxsYlrjZ8Adhqcgl6Zqwie0TgMXLCAmPFxXOuw==
sass@^1.62.0:
version "1.64.1"
resolved "https://registry.npmmirror.com/sass/-/sass-1.64.1.tgz#6a46f6d68e0fa5ad90aa59ce025673ddaa8441cf"
integrity sha512-16rRACSOFEE8VN7SCgBu1MpYCyN7urj9At898tyzdXFhC+a+yOX5dXwAR7L8/IdPJ1NB8OYoXmD55DM30B2kEQ==
dependencies:
chokidar ">=3.0.0 <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!