Commit 6b0b2b3c by 张立顺

4.16版本功能开发

1 parent 3f4dc7fa
import request from "./request"
const path = "dj.api.smartcarlife."
const path2 = "dj.api.goodsInfo."
// 按商品类目分组获取购物车列表
export function listGroupByGoodsType(data) {
data.method = `${path}purchaseShoppingCar.listGroupByGoodsType`
return request(data)
}
// 添加到购物车
export function shoppingCarAdd(data) {
data.method = `${path}purchaseShoppingCar.add`
return request(data)
}
// 移除购物车商品
export function shoppingCarRemove(data) {
data.method = `${path}purchaseShoppingCar.remove`
return request(data)
}
// 修改购物车商品数量
export function shoppingCarUpdateNumber(data) {
data.method = `${path}purchaseShoppingCar.updateNumber`
return request(data)
}
// 更新购物车商品选中标识
export function updateSelectedFlag(data) {
data.method = `${path}purchaseShoppingCar.updateSelectedFlag`
return request(data)
}
// 获取当前登录园区店商户收货地址
export function addressGet(data) {
data.method = `${path}yqMerchantDeliveryAddress.get`
return request(data)
}
// 保存园区店商户收货地址
export function addressSave(data) {
data.method = `${path}yqMerchantDeliveryAddress.save`
return request(data)
}
// 分页查询采购商城素材信息
export function listWithPagePurchaseInfo(data) {
data.method = `${path2}listWithPage.purchaseInfo`
return request(data)
}
// element 样式补丁 // element 样式补丁
.el-card { .el-card {
&.is-always-shadow { &.is-always-shadow {
box-shadow: 0 0 8px 0 rgba(232,237,250,.6), 0 2px 4px 0 rgba(232,237,250,.5); box-shadow: 0 0 8px 0 rgba(232, 237, 250, .6), 0 2px 4px 0 rgba(232, 237, 250, .5);
} }
&.is-hover-shadow { &.is-hover-shadow {
&:hover { &:hover {
box-shadow: 0 0 8px 0 rgba(232,237,250,.6), 0 2px 4px 0 rgba(232,237,250,.5); box-shadow: 0 0 8px 0 rgba(232, 237, 250, .6), 0 2px 4px 0 rgba(232, 237, 250, .5);
} }
} }
} }
...@@ -17,43 +18,57 @@ ...@@ -17,43 +18,57 @@
.el-tabs__item:focus.is-active.is-focus:not(:active) { .el-tabs__item:focus.is-active.is-focus:not(:active) {
box-shadow: none !important; box-shadow: none !important;
} }
.el-color-picker__trigger{
border-color:rgba(255,255,255,.1) .el-color-picker__trigger {
border-color: rgba(255, 255, 255, .1)
} }
.el-table{
&--medium td{ .el-table {
&--medium td {
padding: 10px 0 !important; padding: 10px 0 !important;
.el-button--text{
.el-button--text {
padding: 0px 0px; padding: 0px 0px;
} }
.cell{
.el-tag{ .cell {
.el-tag {
width: 80px; width: 80px;
font-size: 13px; font-size: 13px;
} }
} }
} }
margin:4px 0 !important; margin:4px 0 !important;
} }
.el-dialog{
margin-top: 6vh !important; .el-dialog {
&__body{ // margin-top: 6vh !important;
padding:20px; margin-top: 6vh;
.el-form-item{
&__body {
padding: 20px;
.el-form-item {
margin-bottom: 16px; margin-bottom: 16px;
} }
} }
&__footer { &__footer {
.el-button { .el-button {
width: 150px; width: 150px;
} }
} }
} }
.table-header{
.table-header {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
color: #909399; color: #909399;
.el-col:nth-child(2){
position: relative; display: flex; justify-content: flex-end; .el-col:nth-child(2) {
position: relative;
display: flex;
justify-content: flex-end;
} }
} }
\ No newline at end of file \ No newline at end of file
<template> <template>
<el-dialog <el-dialog id="baseDialog"
id="baseDialog" top="15vh"
top="30vh"
:close-on-click-modal="true" :close-on-click-modal="true"
:close-on-press-escape="true" :close-on-press-escape="true"
:title="dialogConfig.title" :title="dialogConfig.title"
...@@ -11,11 +10,9 @@ ...@@ -11,11 +10,9 @@
class="noborder" class="noborder"
:append-to-body="config.appendToBody"> :append-to-body="config.appendToBody">
<slot /> <slot />
<div <div slot="footer"
slot="footer"
v-if="config.isShowFooter"> v-if="config.isShowFooter">
<el-button <el-button type="primary"
type="primary"
@click="confirmBtn"> @click="confirmBtn">
{{ config.confirm_name }} {{ config.confirm_name }}
</el-button> </el-button>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
:disabled="item.isDisabled" :disabled="item.isDisabled"
:clearable="item.isClear || false" :clearable="item.isClear || false"
:type="item.inputType || 'text'" :type="item.inputType || 'text'"
:maxlength="item.maxlength||''" :maxlength="item.maxlength||30"
@input="e => maxLengthInput(e, item)" @input="e => maxLengthInput(e, item)"
@keydown.native="e => handleInputDown(e, item)" /> @keydown.native="e => handleInputDown(e, item)" />
......
...@@ -54,30 +54,7 @@ if (!isProd) { ...@@ -54,30 +54,7 @@ if (!isProd) {
Vue.config.devtools = true Vue.config.devtools = true
} }
// console.log(test) Vue.prototype.$EventBus = new Vue()
// Vue.use(D2Crud)
// 动态导入vuex 模块
// Vue.use(function () {
// Vue.mixin({
// beforeCreate: function () {
// // $options是组件选项,包含组件.vue文件的 `export default` 的属性
// // 为了拿到在组件定义的是否按需加载的属性值 `isNeedVuex`
// // console.log(this.$options.isNeedVuex)
// if (this.$options.isNeedVuex) {
// // 需要设置.vue文件的name属性,跟单文件组件名字命名一样
// const name = this.$options.name
// // console.log(name)
// import(`./store/modules/${name}/index`).then((res) => {
// // console.log("res", res)
// // res.default就是代表我们在store/modules文件夹下对应文件的export default对象
// // registerModule是vuex自带的方法,请自行搜索
// // 第一个参数是动态注入的模块名,第二个参数是模块导出对象
// this.$store.registerModule(name, res.default)
// })
// }
// }
// })
// })
var baseConfig = { var baseConfig = {
axios: { axios: {
......
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
export const routerName = {
909: {
path: "/purchaseManage",
name: "purchaseManage",
meta: {
title: "采购管理",
authId: "909",
parentId: "1",
cache: false
}
},
90901: {
path: "/purchaseOrder",
name: "purchaseOrder",
meta: {
title: "采购订单",
authId: "90901",
parentId: "909",
cache: false
},
auth: [
{
authId: "9090101",
parentId: "90901",
label: "创建采购",
category: "Button",
type: "primary",
handle: "handleCreatePurchase"
// addRoutePath: [
// {
// authId: "90902",
// name: "采购商城",
// parentId: "909"
// }
// ]
},
{
authId: "9090102",
parentId: "90901",
label: "查看详情",
// category: "Button",
// type: "primary",
handle: "handleDetail"
},
{
authId: "9090103",
parentId: "90901",
label: "取消",
// category: "Button",
// type: "primary",
handle: "handleCancel",
ruleObj: {
attr: "status",
rule: {
1: "取消"
}
},
color: "red"
},
{
authId: "9090104",
parentId: "90901",
label: "入库",
// category: "Button",
// type: "primary",
ruleObj: {
attr: "status",
rule: {
// 1: "申请虚拟对公账户",
2: "入库"
// 3: "账户详情",
// 4: "申请虚拟对公账户"
}
},
handle: "handleWarehousing"
}
],
component: _import("purchase/purchaseOrder")
},
90902: {
path: "/purchasingMall",
name: "purchasingMall",
meta: {
title: "采购商城",
authId: "90902",
parentId: "909",
cache: false
},
auth: [
{
authId: "9090201",
parentId: "90902",
label: "关联导流方",
category: "Button",
type: "primary",
handle: "handleRelate"
}
],
component: _import("purchase/purchasingMall")
},
90903: {
path: "/procurementReview",
name: "procurementReview",
meta: {
title: "采购审核",
authId: "90903",
parentId: "909",
cache: false
},
auth: [
{
authId: "9090303",
parentId: "90903",
label: "审核",
handle: "handleViewDetail"
}
],
component: _import("purchase/procurementReview")
},
90904: {
path: "/purchaseAndDelivery",
name: "purchaseAndDelivery",
meta: {
title: "采购发货",
authId: "90904",
parentId: "909",
cache: false
},
auth: [
{
authId: "9090303",
parentId: "90903",
label: "确认发货",
handle: "handleViewDetail"
}
],
component: _import("purchase/purchaseAndDelivery")
}
}
...@@ -277,7 +277,7 @@ export default { ...@@ -277,7 +277,7 @@ export default {
} }
}, },
handleAdd(form) { handleAdd(form) {
this.close({ tagName: '/editProduct' }) // this.close({ tagName: '/editProduct' })
this.$router.push({ this.$router.push({
name: 'editProduct', name: 'editProduct',
params: { params: {
......
...@@ -121,7 +121,16 @@ export default { ...@@ -121,7 +121,16 @@ export default {
prop: 'goodsName', prop: 'goodsName',
formatter: (cellValue) => { formatter: (cellValue) => {
if (cellValue.subOrderList && cellValue.subOrderList.length > 0) { if (cellValue.subOrderList && cellValue.subOrderList.length > 0) {
return cellValue.subOrderList[0].goodsName return cellValue.subOrderList.reduce((str, item, index) => {
// return item.goodsName
if (index) {
str += '/' + item.goodsName
} else {
str += item.goodsName
}
return str
}, '')
// return cellValue.subOrderList[0].goodsName
} else { } else {
return '' return ''
} }
...@@ -135,7 +144,7 @@ export default { ...@@ -135,7 +144,7 @@ export default {
prop: 'merchantName' prop: 'merchantName'
// width: '200px' // width: '200px'
}, { }, {
label: '支付总价', label: '尾款总额',
prop: 'balancePaymentPrice', prop: 'balancePaymentPrice',
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.balancePaymentPrice ? '¥' + cellValue.balancePaymentPrice : '' return cellValue.balancePaymentPrice ? '¥' + cellValue.balancePaymentPrice : ''
......
<template>
<baseDialog :is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
@closeDialog="handleDetailClose">
<div class="detail-content">
填写地址
</div>
</baseDialog>
</template>
<script>
export default {
name: 'AddressCom',
data() {
return {
dialogShow: false,
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
// width: '720px',
btnList: [
]
},
config: {
title: '查看详情',
width: '720px'
}
}
}
},
methods: {
handleDetailClose() {
}
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<!-- <div>商品详情</div> -->
<baseDialog :is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
@closeDialog="handleDetailClose">
<div class="detail-content">
商品详情
<el-button @click="updateCarShopping">更新购物车</el-button>
</div>
</baseDialog>
</template>
<script>
// import from ''
export default {
name: 'GoodsDetailCom',
props: {
visible: {
type: Boolean,
default: false
},
selectItemInfo: {
type: Object,
default: () => { }
}
},
data() {
return {
// dialogShow: false,
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
// width: '720px',
btnList: [
]
},
config: {
title: '查看详情',
width: '720px'
}
}
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
methods: {
handleDetailClose() {
},
updateCarShopping() {
// this.$emit('updateCarShopping')
this.$EventBus.$emit('updateCarShopping')
}
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<baseDialog :is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
@closeDialog="handleDetailClose">
<div class="detail-content">
弹框测试
</div>
</baseDialog>
</template>
<script>
export default {
name: 'OrderDetailDialog',
props: {
visible: {
type: Boolean,
default: false
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
data() {
return {
// dialogShow: false,
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
// width: '720px',
btnList: [
]
},
config: {
title: '查看详情',
width: '720px'
}
}
}
},
methods: {
handleDetailClose() {
this.dialogShow = false
}
}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<div class="shopCarCon">
<div class="carBtnCon"
@click="drawer = true">购物车按钮</div>
<el-drawer class="shoppingCartDrawerCon"
title="我是标题"
:visible.sync="drawer"
size="500px"
:direction="direction">
<!-- <span>我来啦!</span> -->
<input type="checkbox"
@change="handleAllCheckChange"
v-model="isAllCheck">全选</input>
<div class="goodsTypeCon"
v-for="(item, index) in goodsList"
:key="index">
<input type="checkbox"
@change="handleGoodsTypeCheckChange($event, item)"
v-model="item.goodsTypeCheckout">{{ item.goodsTypeName }}</input>
<div class="goodsCon"
v-for="(goodsItem, goodsIndex) in item.upgradeGoodsList"
:key="goodsIndex">
<input type="checkbox"
@change="handleGoodsCheckChange($event,goodsItem)"
v-model="goodsItem.selectedFlag">{{ goodsItem.upgradeGoodsName }}</input>
<div>
<el-button @click="deleteGoods(goodsItem.upgradeGoodsId)">删除</el-button>
<el-input-number v-model="goodsItem.goodsNumber"
@change="handleGoodsNumChange($event,goodsItem.upgradeGoodsId)"
:min="1"
:max="10"
label="描述文字"></el-input-number>
</div>
</div>
</div>
<div class="totalCon">总价{{ totalPrice }}</div>
</el-drawer>
</div>
</template>
<script>
import { listGroupByGoodsType, updateSelectedFlag, shoppingCarRemove, shoppingCarUpdateNumber } from '@api/purchaseShopping'
export default {
name: 'ShoppingCartCom',
data() {
return {
drawer: false,
direction: 'rtl',
isAllCheck: true,
totalPrice: 0,
goodsList: [{
goodsType: 1,
goodsTypeName: "太阳膜",
upgradeGoodsList: [{
upgradeGoodsName: "橙心橙意",
upgradeGoodsId: "M230104152815367",
selectedFlag: false,
goodsNumber: 2,
shopPrice: 200
},
{
upgradeGoodsName: "橙心橙意",
upgradeGoodsId: "M230104152815368",
selectedFlag: false,
goodsNumber: 2,
shopPrice: 200
}
]
},
{
goodsType: 1,
goodsTypeName: "太阳膜",
upgradeGoodsList: [{
upgradeGoodsName: "橙心橙意",
upgradeGoodsId: "M230104152815367",
selectedFlag: false,
goodsNumber: 2,
shopPrice: 200
},
{
upgradeGoodsName: "橙心橙意",
upgradeGoodsId: "M230104152815368",
selectedFlag: false,
goodsNumber: 2,
shopPrice: 200
}
]
},
{
goodsType: 2,
goodsTypeName: "太阳膜2",
upgradeGoodsList: [{
upgradeGoodsName: "橙心橙意",
upgradeGoodsId: "M230104152815367",
selectedFlag: false,
goodsNumber: 2,
shopPrice: 200
},
{
upgradeGoodsName: "橙心橙意",
upgradeGoodsId: "M230104152815368",
selectedFlag: false,
goodsNumber: 2,
shopPrice: 200
}
]
}]
}
},
computed: {
goodsSelectStatus() {
return this.goodsList.reduce((list, item) => {
item.upgradeGoodsList.forEach((goodsItem) => {
list.push(
{
upgradeGoodsId: goodsItem.upgradeGoodsId,
selectedFlag: goodsItem.selectedFlag ? 'Y' : 'N'
}
)
})
return list
}, [])
}
},
watch: {
// goodsList: {
// handler(val) {
// // console.log(val)
// this.restGoodsList()
// },
// deep: true
// }
},
mounted() {
this.restGoodsList()
this.$EventBus.$on('updateCarShopping', () => {
console.log('updateCarShopping')
// 需要执行的代码
})
// this.getGoodsList()
},
methods: {
deleteGoods(upgradeGoodsId) {
// console.log(upgradeGoodsId)
shoppingCarRemove({ upgradeGoodsId }).then((result) => {
this.getGoodsList()
})
},
handleAllCheckChange(value) {
const list = this.goodsSelectStatus.map((item) => {
item.selectedFlag = value ? 'Y' : 'N'
return item
})
this.updateSelectedFlag(list)
},
handleGoodsTypeCheckChange(value, typeList) {
const list = typeList.upgradeGoodsList.map((item) => {
return {
upgradeGoodsId: item.upgradeGoodsId,
selectedFlag: value ? 'Y' : 'N'
}
})
this.updateSelectedFlag(list)
},
handleGoodsCheckChange(value, goodsItem) {
// this.restGoodsList()
this.updateSelectedFlag({
upgradeGoodsId: goodsItem.upgradeGoodsId,
selectedFlag: value ? 'Y' : 'N'
})
},
updateSelectedFlag(list) {
updateSelectedFlag(list).then((result) => {
this.getGoodsList()
})
},
getGoodsList() {
listGroupByGoodsType.then((result) => {
this.goodsList = result.map((item) => {
// item.upgradeGoodsList
const upgradeGoodsList = item.list.reduce((total, cur) => {
total.push({
upgradeGoodsName: cur.upgradeGoods.upgradeGoodsName,
upgradeGoodsId: cur.upgradeGoodsId,
selectedFlag: cur.selectedFlag == 'Y',
goodsNumber: cur.goodsNumber,
shopPrice: cur.upgradeGoods.shopPrice
})
return total
}, [])
return {
goodsType: item.goodsType,
goodsTypeName: item.goodsTypeName,
upgradeGoodsList
}
})
this.restGoodsList()
}).catch((err) => {
console.log(err)
})
},
restGoodsList() {
let checkoutFlag = true
let totalPrice = 0
this.goodsList = this.goodsList.map((item) => {
item.goodsTypeCheckout = item.upgradeGoodsList.every((goodsItem) => {
if (goodsItem.selectedFlag) {
totalPrice += goodsItem.goodsNumber * goodsItem.shopPrice
}
return goodsItem.selectedFlag
})
if (!item.goodsTypeCheckout) {
checkoutFlag = false
}
return item
})
this.isAllCheck = checkoutFlag
this.totalPrice = totalPrice
},
handleGoodsNumChange(goodsNumber, upgradeGoodsId) {
console.log($event, id)
shoppingCarUpdateNumber({ upgradeGoodsId, goodsNumber }).then((result) => {
this.getGoodsList()
}).catch((err) => {
console.log(err)
})
}
}
}
</script>
<style lang="scss" scoped>
.shoppingCartDrawerCon {
box-sizing: border-box;
// position: relative;
margin-top: 20vh;
// padding-bottom: 300px;
::v-deep .el-drawer.rtl {
padding-bottom: 50px;
}
}
.totalCon {
position: absolute;
bottom: 0;
left: 0;
}
.carBtnCon {
position: absolute;
top: 10vh;
right: 0;
cursor: pointer;
}
</style>
// 订单状态
export const defaultStatusOptions = [
{
id: 1,
label: "待审核"
},
{
id: 2,
label: "已审核"
},
{
id: 3,
label: "已取消"
}
]
// 发货状态
export const defaultDeliveryStatusOptions = [
{
id: 1,
label: "未发货"
},
{
id: 2,
label: "已发货"
}
]
// 入库状态
export const defaultPutStatusOptions = [
{
id: 1,
label: "未入库"
},
{
id: 2,
label: "已入库"
}
]
// export const severSelectOptionsLabel = {
// 1: "下单时间倒序排序",
// 2: "按收入比例",
// 3: "按固定金额",
// 4: "按(产值-流量成本)比例",
// 5: "按(产值-流量成本-其他费用不包含产品成本))比例",
// 6: "按(产值-流量成本-其他费用包含产品成本)比例"
// }
<!-- 采购订单 -->
<template>
<d2-container class="container">
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
@handleChangeSelect="handleChangeSelect"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<auth-button category="Button"
style="{display: inline-block}"
:show-btn-ids="['9030101']" />
</span>
<auth-button category="Button"
style="{display: inline-block}"
:show-btn-ids="['9030103']" />
</d2-table-header>
<d2-table ref="productTable"
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
<div class="material"
slot="img"
slot-scope="scope">
<img class="pro-img"
:src="scope.scope.thumbUrl">
<span class="good_name">{{ scope.scope.goodsName }}</span>
</div>
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope" />
</d2-table>
</div>
</d2-container>
</template>
<script>
import { deepClone } from '@/common/util'
import { getList, deleteGoods, checkDeleteGoods, getProductTypeBySceneId } from '@api/product'
import { brandMerchantList, sceneCodeList } from '@/common/constants.js'
import { mapActions, mapState } from 'vuex'
export default {
name: 'PurchaseOrder',
data() {
return {
searchForm: {
goodsName: '',
goodsType: '',
sceneType: ''
},
showFormData: [
{
label: '素材名',
name: 'goodsName',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '所属场景',
name: 'sceneType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'sceneCodeList'
}, {
label: '类目名',
name: 'goodsType',
type: 'select',
optionList: [],
optionId: 'categoryType',
optionLabel: 'categoryName',
optionsName: 'productTypeList'
}
// {
// label: '素材名',
// name: 'goodsType',
// type: 'select',
// optionList: [],
// optionId: 'goodsType',
// optionLabel: 'goodsTypeName',
// optionsName: 'productTypeList'
// }, {
// label: '品牌商',
// name: 'brandMerchantCode',
// type: 'select',
// optionList: [],
// optionId: 'confId',
// optionLabel: 'confValue',
// optionsName: 'brandList'
// },
// {
// label: '状态',
// name: 'status',
// type: 'select',
// optionList: [],
// optionId: 'confId',
// optionLabel: 'confValue',
// optionsName: 'statusList'
// },
// {
// label: '创建时间',
// name: 'createTime',
// type: 'datePicker',
// isClear: true,
// pickerOptions: 'rangePickerOptions'
// }
],
getListApi: getList,
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [{
label: '素材名',
prop: 'goodsName',
addHtml: 'img'
}, {
label: '类目',
prop: 'goodsTypeName'
}, {
label: '所属场景',
prop: 'sceneName'
},
// {
// label: '素材ID',
// prop: 'id'
// }, {
// label: '分类',
// prop: 'goodsTypeName'
// }, {
// label: '品牌商',
// prop: 'brandMerchantName'
// },
{
label: '创建日期',
prop: 'createDateStr'
}
// {
// label: '状态',
// prop: 'status',
// formatter: (cellValue) => {
// return this.baseData.statusList.find(item => item.confId === cellValue.status).confValue
// }
// }
]
},
// 查看门店
detailVisible: false,
// 基本数据
baseData: {
productTypeList: [],
brandList: [],
statusList: [{
confId: 0,
confValue: '停用'
}, {
confId: 1,
confValue: '使用'
}],
sceneCodeList: []
}
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
this.baseData.brandList = deepClone(brandMerchantList)
this.baseData.sceneCodeList = deepClone(sceneCodeList)
var allOpt = { confId: '', confValue: '全部' }
this.baseData.brandList.unshift(allOpt)
this.baseData.statusList.unshift(allOpt)
this.baseData.sceneCodeList.unshift(allOpt)
// 获取全部类目
getProductTypeBySceneId({ sceneType: '' }).then(res => {
this.baseData.productTypeList = res
this.getBaseData()
})
},
methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
async getBaseData() {
this.baseData.productTypeList.unshift({
categoryType: '',
categoryName: '全部'
})
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
keyDowmGetList() {
this.$refs.productTable.refreshTable()
},
// 根据所选场景获取类目
handleChangeSelect(value) {
this.searchForm.goodsType = ''
this.baseData.productTypeList = []
getProductTypeBySceneId({ sceneType: value }).then(res => {
this.baseData.productTypeList = res
this.getBaseData()
})
},
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
handleReset() {
this.searchForm = {
goodsType: '',
// brandMerchantCode: ''
// status: ''
goodsName: '',
sceneType: ''
}
},
handleAdd(form) {
this.close({ tagName: '/editProduct' })
this.$router.push({
name: 'editProduct',
params: {
addOrEdit: 'add',
form: form
}
})
},
handleExport() {
var params = this.searchForm
params.method = 'dj.api.goodsinfo.export.async'
const list = [
...this.dowloadList,
{
name: '素材列表',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => v[j]))
},
handleEdit(row) {
this.close({ tagName: '/editProduct' })
this.$router.push({
name: 'editProduct',
params: {
addOrEdit: 'edit',
form: row
}
})
},
handleUpOrDown(row) {
checkDeleteGoods({ goodsCode: row.goodsCode }).then(res => {
if (!res) {
this.$confirm('该素材已配置为上架商品,需下架该商品后才可删除!', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'error'
}).then(() => {
}).catch(err => {
console.log(err)
})
return true
}
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '删除',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteGoods({ goodsCode: row.goodsCode }).then(res => {
this.notice.okTips()
this.$refs.productTable.refreshTable()
})
}).catch(err => {
console.log(err)
})
})
},
handleDetail(row) {
this.detailData = row
this.detailVisible = true
},
handleDetailClose() {
this.detailVisible = false
}
}
}
</script>
<style lang="scss" scoped>
</style>
<!-- 采购订单 -->
<template>
<d2-container class="container">
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
@handleChangeSelect="handleChangeSelect"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<auth-button category="Button"
style="{display: inline-block}"
:show-btn-ids="['9030101']" />
</span>
<auth-button category="Button"
style="{display: inline-block}"
:show-btn-ids="['9030103']" />
</d2-table-header>
<d2-table ref="productTable"
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
<div class="material"
slot="img"
slot-scope="scope">
<img class="pro-img"
:src="scope.scope.thumbUrl">
<span class="good_name">{{ scope.scope.goodsName }}</span>
</div>
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope" />
</d2-table>
</div>
</d2-container>
</template>
<script>
import { deepClone } from '@/common/util'
import { getList, deleteGoods, checkDeleteGoods, getProductTypeBySceneId } from '@api/product'
import { brandMerchantList, sceneCodeList } from '@/common/constants.js'
import { mapActions, mapState } from 'vuex'
export default {
name: 'PurchaseOrder',
data() {
return {
searchForm: {
goodsName: '',
goodsType: '',
sceneType: ''
},
showFormData: [
{
label: '素材名',
name: 'goodsName',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '所属场景',
name: 'sceneType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'sceneCodeList'
}, {
label: '类目名',
name: 'goodsType',
type: 'select',
optionList: [],
optionId: 'categoryType',
optionLabel: 'categoryName',
optionsName: 'productTypeList'
}
// {
// label: '素材名',
// name: 'goodsType',
// type: 'select',
// optionList: [],
// optionId: 'goodsType',
// optionLabel: 'goodsTypeName',
// optionsName: 'productTypeList'
// }, {
// label: '品牌商',
// name: 'brandMerchantCode',
// type: 'select',
// optionList: [],
// optionId: 'confId',
// optionLabel: 'confValue',
// optionsName: 'brandList'
// },
// {
// label: '状态',
// name: 'status',
// type: 'select',
// optionList: [],
// optionId: 'confId',
// optionLabel: 'confValue',
// optionsName: 'statusList'
// },
// {
// label: '创建时间',
// name: 'createTime',
// type: 'datePicker',
// isClear: true,
// pickerOptions: 'rangePickerOptions'
// }
],
getListApi: getList,
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [{
label: '素材名',
prop: 'goodsName',
addHtml: 'img'
}, {
label: '类目',
prop: 'goodsTypeName'
}, {
label: '所属场景',
prop: 'sceneName'
},
// {
// label: '素材ID',
// prop: 'id'
// }, {
// label: '分类',
// prop: 'goodsTypeName'
// }, {
// label: '品牌商',
// prop: 'brandMerchantName'
// },
{
label: '创建日期',
prop: 'createDateStr'
}
// {
// label: '状态',
// prop: 'status',
// formatter: (cellValue) => {
// return this.baseData.statusList.find(item => item.confId === cellValue.status).confValue
// }
// }
]
},
// 查看门店
detailVisible: false,
// 基本数据
baseData: {
productTypeList: [],
brandList: [],
statusList: [{
confId: 0,
confValue: '停用'
}, {
confId: 1,
confValue: '使用'
}],
sceneCodeList: []
}
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
this.baseData.brandList = deepClone(brandMerchantList)
this.baseData.sceneCodeList = deepClone(sceneCodeList)
var allOpt = { confId: '', confValue: '全部' }
this.baseData.brandList.unshift(allOpt)
this.baseData.statusList.unshift(allOpt)
this.baseData.sceneCodeList.unshift(allOpt)
// 获取全部类目
getProductTypeBySceneId({ sceneType: '' }).then(res => {
this.baseData.productTypeList = res
this.getBaseData()
})
},
methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
async getBaseData() {
this.baseData.productTypeList.unshift({
categoryType: '',
categoryName: '全部'
})
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
keyDowmGetList() {
this.$refs.productTable.refreshTable()
},
// 根据所选场景获取类目
handleChangeSelect(value) {
this.searchForm.goodsType = ''
this.baseData.productTypeList = []
getProductTypeBySceneId({ sceneType: value }).then(res => {
this.baseData.productTypeList = res
this.getBaseData()
})
},
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
handleReset() {
this.searchForm = {
goodsType: '',
// brandMerchantCode: ''
// status: ''
goodsName: '',
sceneType: ''
}
},
handleAdd(form) {
this.close({ tagName: '/editProduct' })
this.$router.push({
name: 'editProduct',
params: {
addOrEdit: 'add',
form: form
}
})
},
handleExport() {
var params = this.searchForm
params.method = 'dj.api.goodsinfo.export.async'
const list = [
...this.dowloadList,
{
name: '素材列表',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => v[j]))
},
handleEdit(row) {
this.close({ tagName: '/editProduct' })
this.$router.push({
name: 'editProduct',
params: {
addOrEdit: 'edit',
form: row
}
})
},
handleUpOrDown(row) {
checkDeleteGoods({ goodsCode: row.goodsCode }).then(res => {
if (!res) {
this.$confirm('该素材已配置为上架商品,需下架该商品后才可删除!', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'error'
}).then(() => {
}).catch(err => {
console.log(err)
})
return true
}
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '删除',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteGoods({ goodsCode: row.goodsCode }).then(res => {
this.notice.okTips()
this.$refs.productTable.refreshTable()
})
}).catch(err => {
console.log(err)
})
})
},
handleDetail(row) {
this.detailData = row
this.detailVisible = true
},
handleDetailClose() {
this.detailVisible = false
}
}
}
</script>
<style lang="scss" scoped>
</style>
<!-- 采购订单 -->
<template>
<d2-container class="container">
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
@handleChangeSelect="handleChangeSelect"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<!-- <auth-button category="Button" /> -->
<auth-button category="Button" />
</span>
<span>
<el-button type="primary"
size="mini"
@click="handleExport">
导出
</el-button>
</span>
</d2-table-header>
<!-- :get-list-api="getListApi" -->
<d2-table ref="productTable"
:search-form="searchForm"
:table-params="tableParams"
:table-data="tableData"
:before-search-fn="beforeSearchFn">
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope" />
</d2-table>
</div>
<baseDialog :is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
@closeDialog="handleDetailClose">
<div class="detail-content">
弹框测试
</div>
</baseDialog>
</d2-container>
</template>
<script>
// import { deepClone } from '@/common/util'
import { defaultStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions } from './constant'
import { mapActions, mapState } from 'vuex'
// import {} from '@/api/purchaseShopping.js'
export default {
name: 'PurchaseOrder',
data() {
return {
dialogShow: false,
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
// width: '720px',
btnList: [
]
},
config: {
title: '查看详情',
width: '720px'
}
},
searchForm: {
status: '',
deliveryStatus: '',
putStatus: ''
},
// { status: 2 }
tableData: [],
showFormData: [
{
label: '订单编号',
name: 'orderCode',
type: 'input',
isClear: true
},
{
label: '订单状态',
name: 'status',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'label',
optionsName: 'defaultStatusOptions'
},
{
label: '发货状态',
name: 'deliveryStatus',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'label',
optionsName: 'defaultDeliveryStatusOptions'
},
{
label: '入库状态',
name: 'putStatus',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'label',
optionsName: 'defaultPutStatusOptions'
},
{
label: '下单时间',
name: 'orderTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
},
{
label: '入库时间',
name: 'orderTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
},
{
label: '下单门店',
name: 'merchantId',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'label',
optionsName: 'defaultMerchantIdOptions'
},
{
label: '入库门店',
name: 'putMerchantId',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'label',
optionsName: 'defaultPutMerchantIdOptions'
}
],
// getListApi: getList,
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '订单总价',
prop: 'totalPrice',
formatter: (cellValue) => {
return "¥" + cellValue.totalPrice
}
},
{
label: '下单时间',
prop: 'putTime'
},
{
label: '下单门店',
prop: 'putMerchantName'
},
{
label: '发货状态',
prop: 'deliveryStatus',
formatter: (cellValue) => {
return defaultDeliveryStatusOptions.find(item => item.id == cellValue.deliveryStatus).label || '-'
}
},
{
label: '承运公司',
prop: 'deliveryCompany'
},
{
label: '承运单号',
prop: 'deliveryNumber'
},
{
label: '入库状态',
prop: 'putStatus',
formatter: (cellValue) => {
return defaultPutStatusOptions.find(item => item.id == cellValue.putStatus).label || '-'
}
},
{
label: '入库时间',
prop: 'putTime'
},
{
label: '入库门店',
prop: 'putMerchantName'
},
{
label: '订单状态',
prop: 'status',
formatter: (cellValue) => {
return defaultStatusOptions.find(item => item.id == cellValue.status).label || '-'
}
}
]
},
// 查看门店
detailVisible: false,
// 基本数据
baseData: {
defaultStatusOptions,
defaultDeliveryStatusOptions,
defaultPutStatusOptions
}
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
this.getBaseData()
// this.addressGet()
// this.getList()
},
methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
getBaseData() {
const allOpt = {
id: '',
label: '全部'
}
this.showFormData.forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName]) {
this.baseData[item.optionsName].unshift(allOpt)
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
// 根据所选场景获取类目
handleChangeSelect(value) {
this.searchForm.goodsType = ''
this.baseData.productTypeList = []
getProductTypeBySceneId({ sceneType: value }).then(res => {
this.baseData.productTypeList = res
this.getBaseData()
})
},
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
handleReset() {
for (const key in this.searchForm) {
this.searchForm[key] = ''
}
},
handleExport() {
var params = this.searchForm
params.method = 'dj.api.smarcarlife.purchaseOrder.export.async'
const list = [
...this.dowloadList,
{
name: '商城订单',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
handleCancel(row) {
},
handleDetail(row) {
this.detailData = row
this.detailVisible = true
},
handleDetailClose() {
this.dialogShow = false
}
}
}
</script>
<style lang="scss" scoped>
</style>
<!-- 采购商城 -->
<template>
<d2-container class="mallContainer">
<div class="d2-container-content">
<div class="addressCon">
地址
</div>
<div class="classifyContainer">
<div class="centerfrom">订阅名</div>
<div class="spanall"
ref="formList">
<span class="spanalone"
v-for="(item, i) in navList"
:key="i"
@click="getchange(item, i)"
:class="scopedSlots == i ? 'item-one' : ''">{{ item.navItem }}</span>
</div>
<div @click="showMoreSourceList"
v-show="ulheight > 34"
class="centerfrom">
<span :class="{ rolate: showli }"
class="moreFrom">{{
fromText
}}</span>
</div>
</div>
<div class="searchCon">
搜索
</div>
<div class="goodsCon">
<div class="goodsItemCon"
v-for="(item,index) in purchaseList"
:key="index">
图片{{ item.thumbUrl }}
名称{{ item.goodsName }}
成交量{{ item.purchaseOrderCount }}
<el-button type="primary"
size="mini"
@click="handleDetail(item)">
详情</el-button>
</div>
</div>
<div class="pageCon">
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.pageNum"
:page-sizes="[10,20,30,40]"
:page-size="page.pageSize"
:total="total"
layout="sizes,total,->,prev,pager,next,jumper" />
</div>
</div>
<!-- 购物车组件 -->
<shoppingCartCom />
<addressCom />
<goodsDetailCom :visible.sync="goodsDetailComVisible" />
</d2-container>
</template>
<script>
import shoppingCartCom from './components/shoppingCartCom'
import addressCom from './components/addressCom'
import goodsDetailCom from './components/goodsDetailCom'
import { addressGet, listWithPagePurchaseInfo } from '@api/purchaseShopping'
import { getGoodsCategoryConfiguration } from '@/api/sys.base.js'
export default {
name: 'PurchasingMall',
components: {
shoppingCartCom,
addressCom,
goodsDetailCom
},
data() {
return {
goodsDetailComVisible: false,
searchForm: {
type: '0'
},
total: 0,
page: {
pageNum: 1,
pageSize: 20
},
scopedSlots: 0,
ulheight: 0,
fromText: '更多',
showli: false,
navList: [
{
navItem: '所有就好尬建档赶快来好看'
}
],
purchaseList: [{
thumbUrl: "string",
goodsName: "string",
purchaseOrderCount: 0,
id: 0
}],
addressInfo: {
contactName: '',
contactPhone: '',
contactAddress: ''
},
productType: [],
productTypeId: '',
goodsName: '',
selectItem: {}
}
},
created() {
this.getGoodsCategoryConfiguration()
// this.listWithPagePurchaseInfo()
},
mounted() {
this.$nextTick(() => {
// debugger
this.ulheight = this.$refs.formList.scrollHeight
// console.log(test);
})
},
methods: {
handleDetail(item) {
this.selectItem = item
this.goodsDetailComVisible = true
},
listWithPagePurchaseInfo() {
const params = {
pageNum: this.page.pageNum,
pageSize: this.page.pageSize,
// productType: this.productType,
goodsType: this.productTypeId,
goodsName: this.goodsName
}
listWithPagePurchaseInfo(params).then((result) => {
const { list, total } = result
this.purchaseList = list
this.total = total
}).catch((err) => {
console.log(err)
})
},
// 获取类目列表
getGoodsCategoryConfiguration() {
// const { scene: 1 } = this.routerInfo
getGoodsCategoryConfiguration({ sceneType: 1 }).then((result) => {
const { list } = result
console.log(list, 'list')
if (list.length) {
this.navList = list.map(({ categoryType, categoryName }) => {
return {
goodsType: categoryType,
goodsTypeName: categoryName
}
})
console.log(this.productType)
}
})
},
// 订阅名数量过多的处理
showMoreSourceList() {
if (this.showli) {
this.$refs.formList.style.height = '34px'
this.fromText = '更多'
} else {
this.$refs.formList.style.height = this.ulheight + 'px'
this.fromText = '收起'
}
this.showli = !this.showli
},
getchange(item, i) {
this.scopedSlots = i
this.selectItem = item.navItem
if (item.navItem == '所有') {
this.totalAllList()
} else {
this.list = item.template
}
},
addressGet() {
addressGet().then((result) => {
console.log(result)
const {
contactName,
contactPhone,
contactAddress
} = result
this.addressInfo = {
contactName,
contactPhone,
contactAddress
}
}).catch((err) => {
})
},
// 每页条数
handleSizeChange(value) {
this.page.pageSize = value
this.getList()
},
// 页码
handleCurrentChange(value) {
this.page.pageNum = value
this.getList()
}
},
beforeDestroy() {
this.$EventBus.$off('updateCarShopping')
}
}
</script>
<style lang="scss" scoped>
.classifyContainer {
width: 100%;
display: flex;
// margin-bottom: 28px;
.centerfrom {
width: 45px;
height: 20px;
font-size: 14px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333333;
line-height: 20px;
margin-top: 6px;
// margin-right: 45px;
}
.spanall {
flex: 1;
display: flex;
flex-wrap: wrap;
padding-left: 42px;
height: 33px;
overflow: hidden;
// margin-left: 30px;
.spanalone {
// height: 32px;
// margin: 2px 2px;
display: inline;
padding: 6px 18px;
border: 1px solid rgba(200, 200, 200, 0);
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
cursor: pointer;
}
.item-one {
border: 1px solid #007fcd;
border-radius: 4px;
color: #007fcd;
}
}
.arrow {
display: flex;
align-items: center;
justify-content: center;
}
i {
border: solid black;
border-width: 0 1px 1px 0;
display: inline-block;
padding: 3px;
}
.up {
transform: rotate(-135deg);
-webkit-transform: rotate(-135deg);
}
.down {
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}
.moreFrom {
position: relative;
cursor: pointer;
&:after {
content: "";
position: absolute;
width: 0;
height: 0;
top: 7px;
right: -17px;
transition: all 1s;
border: 5px solid transparent;
border-top-color: #666666;
}
}
.rolate {
&::after {
top: 0px;
transform: rotate(180deg);
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-o-transform: rotate(180deg);
-ms-transform: rotate(180deg);
}
}
}
</style>
...@@ -310,8 +310,7 @@ export default { ...@@ -310,8 +310,7 @@ export default {
} }
}, },
mounted() { mounted() {
// 先默认初始化平台方和流量方 this.initFinancialObj()// 先默认初始化平台方和流量方
this.initFinancialObj()
this.getFinancialObj() this.getFinancialObj()
this.init4sServiceList() this.init4sServiceList()
this.initFeeCategoryByType() this.initFeeCategoryByType()
...@@ -325,7 +324,7 @@ export default { ...@@ -325,7 +324,7 @@ export default {
...mapActions('FinancialRules', ['reset']), ...mapActions('FinancialRules', ['reset']),
...mapMutations('FinancialRules', ['toggle', 'set4sService']), ...mapMutations('FinancialRules', ['toggle', 'set4sService']),
initFinancialObj() { initFinancialObj() { // 先取默认值
const { channelType, merchantName, merchantId } = this.routerInfo const { channelType, merchantName, merchantId } = this.routerInfo
this.financialObj = Object.assign(this.financialObj, { this.financialObj = Object.assign(this.financialObj, {
realityPlatformMerchantId: -1, // 实际分账平台方商户id(嘀加智慧云为-1) realityPlatformMerchantId: -1, // 实际分账平台方商户id(嘀加智慧云为-1)
...@@ -394,14 +393,15 @@ export default { ...@@ -394,14 +393,15 @@ export default {
}) })
}, },
getFinancialObj() { getFinancialObj() {
//
const { merchantId, scene: sceneType } = this.routerInfo const { merchantId, scene: sceneType } = this.routerInfo
merchantSettleDistributeRuleLastRule({ merchantId, sceneType, expenseCategroyRulsBuildType: 1 }).then((result) => { merchantSettleDistributeRuleLastRule({ merchantId, sceneType, expenseCategroyRulsBuildType: 1 }).then((result) => {
// console.log(result) // console.log(result)
// 判空处理 // 判空处理
// result.goodsTypeGroupRules = [...result?.goodsTypeGroupRules, ...result?.goodsTypeGroupRules, ...result?.goodsTypeGroupRules] // result.goodsTypeGroupRules = [...result?.goodsTypeGroupRules, ...result?.goodsTypeGroupRules, ...result?.goodsTypeGroupRules]
const goodsTypeGroupRules = result?.goodsTypeGroupRules const goodsTypeGroupRules = result?.goodsTypeGroupRules
result && (this.financialObj = result) // 解决老财务规则只做了一部分的问题 就不取老的了
result && result.divisionRuleId && (this.financialObj = result)
const autoFlag = result.autoFlag == 'Y'
// function compare(property) { // function compare(property) {
// return function (a, b) { // return function (a, b) {
// return a[property] - b[property] // return a[property] - b[property]
...@@ -412,7 +412,7 @@ export default { ...@@ -412,7 +412,7 @@ export default {
this.editableTabs[index] = { this.editableTabs[index] = {
title: index ? '特殊品类' + index : '全部品类', title: index ? '特殊品类' + index : '全部品类',
name: (index + 1).toString(), name: (index + 1).toString(),
testFlag: item.testFlag == 'Y' ? 'Y' : 'N', testFlag: (item.testFlag == 'Y' && autoFlag) ? 'Y' : 'N',
groupDivisionRuleId: item.testFlag == 'Y' ? '' : (item.groupDivisionRuleId || '') groupDivisionRuleId: item.testFlag == 'Y' ? '' : (item.groupDivisionRuleId || '')
} }
}) })
...@@ -453,13 +453,15 @@ export default { ...@@ -453,13 +453,15 @@ export default {
codeHandleConfirm(smsCode) { codeHandleConfirm(smsCode) {
this.submitParams.smsCode = smsCode this.submitParams.smsCode = smsCode
console.log(this.submitParams) console.log(this.submitParams)
// return
merchantSettleDistributeRule(this.submitParams).then((result) => { merchantSettleDistributeRule(this.submitParams).then((result) => {
console.log('result', result) console.log('result', result)
// 判断是否有没有进行过分账测试的账号 // 判断是否有没有进行过分账测试的账号
const { goodsTypeGroupRules } = result // autoFlag: 'N', // 自动分账标识(Y是,N否)
const { goodsTypeGroupRules, autoFlag } = result
const testFlag = goodsTypeGroupRules.some((item) => item.testFlag != 'Y') const testFlag = goodsTypeGroupRules.some((item) => item.testFlag != 'Y')
// 测试没通过的账号 // 测试没通过的账号 线下分账无需校验
if (testFlag) { if (testFlag && autoFlag != 'N') {
let frequency = 0 // 没通过的账号 let frequency = 0 // 没通过的账号
goodsTypeGroupRules.forEach((item, index) => { goodsTypeGroupRules.forEach((item, index) => {
if (item.testFlag != "Y") { if (item.testFlag != "Y") {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!