Commit 86875432 by wangql

Merge branch 'dev_v4.7.0' into dev_v4.7.1

2 parents 90189ed7 776ab4d7
......@@ -7,3 +7,4 @@
从 develop 分支号 dev_v4.4.0 本来用来开发审核以及报表功能版本, wangql_dev_v4.4.0 已开发部分对应需求,未往 dev_v4.4.0 版本合并,因此目前 dev_v4.4.0 分支无用
从 develop 拉分支号 dev_v4.5.1 用来开发转化加 V4.5.0 功能需求
从 dev_v4.5.0 拉分支号 dev_v4.5.2 用来新建菜单对应现在的虚拟对公账户功能,以前的菜单保留以防万一
从 develop 拉分支号 dev_v4.7.0 需求功能:零售商品的审核以及首页的数据报表
......@@ -250,6 +250,25 @@
"@babel/types": "^7.0.0"
}
},
"@babel/helper-skip-transparent-expression-wrappers": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz",
"integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==",
"requires": {
"@babel/types": "^7.16.0"
},
"dependencies": {
"@babel/types": {
"version": "7.18.4",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.4.tgz",
"integrity": "sha512-ThN1mBcMq5pG/Vm2IcBmPPfyPXbd8S02rS+OBIDENdufvqC7Z/jHPCv9IcP01277aKtDI8g/2XysBN4hA8niiw==",
"requires": {
"@babel/helper-validator-identifier": "^7.16.7",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/helper-split-export-declaration": {
"version": "7.4.4",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz",
......@@ -259,6 +278,11 @@
"@babel/types": "^7.4.4"
}
},
"@babel/helper-validator-identifier": {
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz",
"integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw=="
},
"@babel/helper-wrap-function": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz",
......@@ -361,6 +385,23 @@
"@babel/plugin-syntax-optional-catch-binding": "^7.2.0"
}
},
"@babel/plugin-proposal-optional-chaining": {
"version": "7.17.12",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.17.12.tgz",
"integrity": "sha512-7wigcOs/Z4YWlK7xxjkvaIw84vGhDv/P1dFGQap0nHkc8gFKY/r+hXc8Qzf5k1gY7CvGIcHqAnOagVKJJ1wVOQ==",
"requires": {
"@babel/helper-plugin-utils": "^7.17.12",
"@babel/helper-skip-transparent-expression-wrappers": "^7.16.0",
"@babel/plugin-syntax-optional-chaining": "^7.8.3"
},
"dependencies": {
"@babel/helper-plugin-utils": {
"version": "7.17.12",
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.17.12.tgz",
"integrity": "sha512-JDkf04mqtN3y4iAbO1hv9U2ARpPyPL1zqyWs/2WG1pgSq9llHFjStX5jdxb84himgJm+8Ng+x0oiWF/nw/XQKA=="
}
}
},
"@babel/plugin-proposal-unicode-property-regex": {
"version": "7.4.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz",
......@@ -435,6 +476,21 @@
"@babel/helper-plugin-utils": "^7.0.0"
}
},
"@babel/plugin-syntax-optional-chaining": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz",
"integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==",
"requires": {
"@babel/helper-plugin-utils": "^7.8.0"
},
"dependencies": {
"@babel/helper-plugin-utils": {
"version": "7.17.12",
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.17.12.tgz",
"integrity": "sha512-JDkf04mqtN3y4iAbO1hv9U2ARpPyPL1zqyWs/2WG1pgSq9llHFjStX5jdxb84himgJm+8Ng+x0oiWF/nw/XQKA=="
}
}
},
"@babel/plugin-transform-arrow-functions": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz",
......@@ -14564,8 +14620,7 @@
"to-fast-properties": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
"integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
"dev": true
"integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4="
},
"to-object-path": {
"version": "0.3.0",
......@@ -15222,9 +15277,9 @@
"integrity": "sha512-lVCEqzZyhrZ49dr6n1C4dMNH/tvKJzRwJhCi9vxWYpiosYTWM0J5m5RsJ745S88XWwgTeOynKMGbyOLG9ZP20Q=="
},
"vue-router": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.1.2.tgz",
"integrity": "sha512-WssQEHSEvIS1/CI4CO2T8LJdoK4Q9Ngox28K7FDNMTfzNTk2WS5D0dDlqYCaPG+AG4Z8wJkn1KrBc7AhspZJUQ=="
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.0.5.tgz",
"integrity": "sha512-DGU+7+eeiSq/oNZ6epA/rcNkAd0m2+uugR5i4Eh4KBvclUmorvNJ6iForYjQkgvKi9GdamybaMpl85eDgxM2eQ=="
},
"vue-style-loader": {
"version": "4.1.2",
......@@ -15252,6 +15307,11 @@
"integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
"dev": true
},
"vue2-org-tree": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/vue2-org-tree/-/vue2-org-tree-1.3.6.tgz",
"integrity": "sha512-ExkQWmHcS3s1tjPDdaruE2p4JnfwOTc4MBqqMY7rsSM9pgzD53t6hbjyNOq9csnyugzREdCnX5V/ZHQMREDYZQ=="
},
"vuex": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.1.1.tgz",
......
......@@ -62,3 +62,15 @@ export function exportBaseList(data) {
data.method = `${path}basegoods.export`
return request(data, 'post')
}
// 下架子商品
export function baseGoodsUpOrDownForChild(data) {
data.method = `${path2}upgradedGoods.shelfStatus.update`
return request(data, 'post')
}
// 提交商品审核结果
export function submitReviewResult(data) {
data.method = `${path2}upgradedGoods.submitReviewResult`
return request(data, 'post')
}
......@@ -42,6 +42,7 @@ export function getIncomeFlowList(data) {
data.method = `${path2}workbench.statistics.income.listCountByMonth`
return request(data)
}
export function getIncomeProductList(data) {
data.method = `${path2}workbench.statistics.goods.grossProfitRadio`
return request(data)
......@@ -52,3 +53,18 @@ export function getPlatformMerchantList(data) {
data.method = `${path2}serviceMerchant.platformMerchant.list`
return request(data, 'post')
}
export function getExportDailyReport(data) {
data.method = `${path2}workbench.exportDailyReport`
return request(data)
}
export function getMerchantOutputValueTarget(data) {
data.method = `${path2}workbench.listMerchantOutputValueTarget`
return request(data)
}
export function setMerchantOutputValueTarget(data) {
data.method = `${path2}workbench.inputMerchantOutputValueTarget`
return request(data)
}
......@@ -243,6 +243,23 @@ export const Util = {
return copy
}
throw new Error("Unable to clone obj! Its type isn't supported.")
},
/**
* url下载文件
*
*/
downLoadFile: function(url) {
// console.log(row)
// return
const Temp = document.createElement('a')
// Temp.href = process.env.VUE_APP_BASE_URL + '/article/export.do?articleId=' + row.id
Temp.href = url
// console.log(url)
// console.log(Temp.href)
document.body.append(Temp)
Temp.click()
document.body.removeChild(Temp)
}
}
......@@ -251,3 +268,4 @@ export const showToast = Util.Info
export const showLoading = Util.loading
export const hideLoading = Util.closeLoading
export const deepClone = Util.deepClone
export const downLoadFile = Util.downLoadFile
......@@ -54,10 +54,16 @@
v-text="tableParams[item.tagName].label[scope.row[item.prop]]"></el-tag>
</template>
<template v-else-if="item.formatter">
<span v-if="item.html"
v-html="item.formatter(scope.row)"></span>
<span v-else
v-text="item.formatter(scope.row)"></span>
<<<<<<< HEAD
<span
v-if="item.html"
v-html="item.formatter(scope.row)"></span>
<span v-else
v-text="item.formatter(scope.row)"></span>
=======
<span :class="item.className?item.className(scope.row):''"></span>
<span v-text="item.formatter(scope.row)"></span>
>>>>>>> dev_v4.7.0
</template>
<template v-else-if="getListApi">
<span v-if="item.prefix">{{item.prefix}}</span>
......@@ -81,6 +87,8 @@
<template slot-scope="scope">
<slot name="auth-button"
:scope="scope.row"></slot>
<slot name="auth-button-other"
:scope="scope.row"></slot>
</template>
</el-table-column>
</el-table>
......@@ -339,4 +347,28 @@ export default {
.d2-table .head-search {
cursor: pointer;
}
.ashSpot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #c6c8cc;
margin-right: 5px;
display: inline-block;
}
.greenSpot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #2cca74;
margin-right: 5px;
display: inline-block;
}
.yellowSpot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #fdb757;
margin-right: 5px;
display: inline-block;
}
</style>
<template>
<div class="dialog_page">
<el-dialog :title="title" :visible.sync="show" :width="width" :append-to-body="appendtobody" custom-class="glsx_dialog" :close-on-press-escape="false" :close-on-click-modal="false" @close="onCancel">
<div class="dialog_content">
<slot />
</div>
<div class="dialog_footer" v-show="hasFooter">
<slot name="footer"></slot>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'GlsxDialog',
props: {
show: {
type: Boolean,
default: false
},
title: {
type: String,
default: '提示'
},
width: {
type: String,
default: '46%'
},
cancel: {
required: false,
type: Function
},
confirm: {
required: false,
type: Function
},
usefooter: {
required: false,
type: Boolean,
default: false
},
appendtobody: {
required: false,
type: Boolean,
default: false
}
},
data() {
return {
hasFooter: false
}
},
created() {
const o = this.$slots
this.hasFooter = o.footer
},
mounted: function() {},
methods: {
/**
* 取消关闭弹框
*/
onCancel: function() {
// 兼容以前的页面
this.$emit('close')
},
/**
* 确定
*/
onConfirm: function() {}
}
}
</script>
<style lang="scss">
.glsx_dialog {
.el-dialog__header {
border-bottom: 1px solid #ddd !important;
padding-top: 10px;
font-size: 14px;
}
.el-dialog__headerbtn {
top: 10px;
right: 10px;
}
.el-dialog__body {
padding: 0;
}
.el-dialog__footer {
border-top: 1px solid #ddd;
}
}
</style>
<style lang="scss" scoped>
.dialog_content {
max-height: 600px;
overflow-y: auto;
padding: 20px;
}
.dialog_footer {
padding: 10px 15px;
border-top: 1px solid #e1e1e1;
text-align: right;
}
</style>
......@@ -37,7 +37,7 @@ util.open = function(url, target) {
* console.log(bar===foo) false
* @param {*} obj
*/
util.deepClone = (obj) => {
util.deepClone = obj => {
// Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj
// Handle Date
......@@ -47,8 +47,8 @@ util.deepClone = (obj) => {
return copy
}
// Handle Array or Object
if (obj instanceof Array | obj instanceof Object) {
const copy = (obj instanceof Array) ? [] : {}
if ((obj instanceof Array) | (obj instanceof Object)) {
const copy = obj instanceof Array ? [] : {}
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = util.deepClone(obj[attr])
......
......@@ -30,6 +30,16 @@ export const home = {
parentId: '1',
cache: false
},
auth: [
{
authId: '90701',
parentId: '907',
label: '报表模块'
// category: '',
// type: ''
// handle: 'handleExport'
}
],
component: _import('index')
}
export const sys = [
......@@ -360,18 +370,33 @@ export const resources = {
}
}
},
// {
// authId: '9030204',
// parentId: '90302',
// label: '',
// handle: 'handleDetail'
// },
{
authId: '9030206',
parentId: '90302',
label: '删除',
// judgeShow: true,
handle: 'handleDelete'
},
{
authId: '9030207',
parentId: '90302',
label: '审核',
category: 'Button',
handle: 'handleExamine'
},
{
authId: '9030208',
parentId: '90302',
label: '单独上架',
handle: 'handleUpOrDownForChild',
// judgeShow: true,
ruleObj: {
attr: 'status',
rule: {
0: '单独上架',
1: '单独下架'
}
}
}
],
component: _import('goods/commodity')
......
......@@ -15,6 +15,7 @@ export default {
meta: {},
btns: {},
btnIdAll: []
// curBtns: {}
},
getters: {
/**
......@@ -22,6 +23,7 @@ export default {
* @param {Object} state state
*/
source(state) {
console.log(state)
return state.source
},
/**
......@@ -29,6 +31,8 @@ export default {
* @param {Object} state state
*/
meta(state) {
// console.log('state.meta', state.meta)
// console.log('meta')
return state.meta
},
/**
......@@ -43,6 +47,7 @@ export default {
* @param {*} state
*/
curBtns(state) {
// console.log('state.btns', state.btns)
return state.btns[state.meta.authId]
},
/**
......@@ -57,12 +62,16 @@ export default {
save2db({ state, dispatch }) {
return new Promise(async resolve => {
// 设置数据
dispatch('d2admin/db/set', {
dbName: 'database',
path: 'source',
value: state.source,
user: true
}, { root: true })
dispatch(
'd2admin/db/set',
{
dbName: 'database',
path: 'source',
value: state.source,
user: true
},
{ root: true }
)
// end
resolve()
})
......@@ -85,9 +94,11 @@ export default {
* @description 保存当前角色权限资源
* @param {obj} source 需要保存的权限资源
*/
setCurrentPageMeta({ state }, meta) {
setCurrentPageMeta({ commit, state }, meta) {
return new Promise(async resolve => {
state.meta = meta
// commit('setMeta', meta)
// console.log(state)
// end
resolve()
})
......@@ -99,11 +110,15 @@ export default {
load({ state, dispatch }) {
return new Promise(async resolve => {
if (!state.source) {
state.source = await dispatch('d2admin/db/get', {
dbName: 'database',
path: 'source',
user: true
}, { root: true })
state.source = await dispatch(
'd2admin/db/get',
{
dbName: 'database',
path: 'source',
user: true
},
{ root: true }
)
}
// end
resolve(state.source)
......@@ -127,7 +142,10 @@ export default {
_initRoutes({ state }, source) {
return new Promise(async resolve => {
try {
const { route, btn } = util.permision.packRoutesBtns(localRoutes, source)
const { route, btn } = util.permision.packRoutesBtns(
localRoutes,
source
)
router.matcher = ResetRouter().matcher // 重置基础路由 解决切换用户 保留上一个用户路由问题
frameInRoutes[0].children = [...route, ...sys]
router.addRoutes(frameInRoutes)
......@@ -160,5 +178,12 @@ export default {
state.btnIdAll = []
await dispatch('save2db')
}
},
mutations: {
setMeta(state, meta) {
// console.log(state)
// console.log(meta)
state.meta = meta
}
}
}
<!-- 编辑商品弹窗 -->
<template>
<d2-dialog title="添加绑定升级商品"
:isVisible.sync="relateProVisible"
btnOkLabel="关联"
width="950px"
@confirmDialog="handleRelateProConfirm"
@closeDialog="handleRelateProClose"
class="relatePro">
<div class="relateProDialog flex">
<img v-show="proInfo.thumbUrl"
:src="proInfo.thumbUrl" />
<img v-show="!proInfo.thumbUrl"
src="./image/no-choice.png" />
<el-form :model="proInfo"
:rules="rules"
label-width="110px"
ref="proRuleForm1"
style="width: calc(100% - 180px);">
<div class="w-50">
<el-form-item label="选择产品"
prop="goodsCode">
<el-select style="width: 98%;"
v-model="proInfo.goodsCode"
placeholder="请选择一款作为升级商品"
value-key="goodsCode"
filterable
@change="handleChangeGood">
<el-option v-for="item in proList"
:key="item.goodsCode"
:label="item.goodsName"
:value="item.goodsCode"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</div>
<div class="w-50">
<el-form-item label="分类">
<el-input disabled
placeholder="分类"
:value="proInfo.goodsTypeName"
class="dis-in-block"></el-input>
</el-form-item>
</div>
<div class="w-50">
</div>
<div class="w-50">
<el-form-item label="编号">
<el-input disabled
placeholder="编号"
:value="proInfo.sapCode"
class="dis-in-block"></el-input>
</el-form-item>
</div>
<div class="w-50">
<el-form-item label="产品成本"
prop="shopPrice">
<el-input v-model="proInfo.shopPrice"
placeholder="请输入建议产品成本"
class="dis-in-block"
@input="handleShopPrice"
@blur="handleShopPriceBlur">
<i slot="suffix"
class="suffix">元</i>
</el-input>
</el-form-item>
</div>
<div class="w-50">
<el-form-item label="建议升级价格"
prop="upgradePrice">
<el-input v-model="proInfo.upgradePrice"
placeholder="请输入建议升级价格"
class="dis-in-block"
@input="handleUpgradePrice">
<i slot="suffix"
class="suffix">元</i>
</el-input>
</el-form-item>
</div>
<div class="w-50">
<el-form-item label="商品最低价"
prop="shopMinPrice">
<el-input v-model="proInfo.shopMinPrice"
placeholder="请输入商品最低价"
class="dis-in-block"
@input="handleShopMinPrice">
<i slot="suffix"
class="suffix">元</i>
</el-input>
</el-form-item>
</div>
<div class="w-50"
v-show="warrantyProList.includes(proInfo.goodsType)">
<el-form-item label="质保年限"
prop="warrantyPeriod">
<el-select style="width: 98%;"
:class="{ 'select-suffix': !!proInfo.warrantyPeriod }"
v-model="proInfo.warrantyPeriod">
<el-option v-for="item in warrantyPeriodList"
:key="item.confId"
:label="item.confLabel"
:value="item.confId"></el-option>
</el-select>
</el-form-item>
</div>
</el-form>
</div>
</d2-dialog>
</template>
<script>
import _ from 'lodash'
import { limitPrice } from '@/common/constants'
export default {
name: 'relateProDialog',
data() {
return {
goodVal: {},
warrantyProList: [1, 4, 6],
proInfo: {
thumbUrl: '',
goodsCode: '',
goodsName: '',
goodsType: '',
goodsTypeName: '',
type: '',
upgradePrice: '',
shopPrice: '',
incentiveType: 1,
shopMinPrice: '',
warrantyPeriod: ''
},
rules: {
goodsCode: [{ required: true, message: '请选择关联升级商品', trigger: 'change' }],
upgradePrice: [
{ required: true, message: '请输入建议升级价', trigger: 'blur' },
{
required: true,
trigger: 'blur',
validator: (rule, value, callback) => {
(+value < +this.proInfo.shopPrice) ? callback(new Error('建议升级价需要大于或等于产品成本')) : callback()
}
}],
shopPrice: [{ required: true, message: '请输入产品成本', trigger: 'blur' }],
shopMinPrice: [
{ required: true, message: '请输入商品最低价', trigger: 'blur' },
{
required: true,
trigger: 'blur',
validator: (rule, value, callback) => {
(+value < +this.proInfo.shopPrice) ? callback(new Error('商品最低价数值小于产品成本')) : callback()
}
}
]
},
oldVal: {
upgradePrice: '',
shopPrice: '',
shopMinPrice: ''
},
separateOpt: [{
confId: 1,
confLabel: '毛利'
}, {
confId: 2,
confLabel: '收入'
}],
incentiveTypeList: [{
confId: 1,
confLabel: '比例'
}, {
confId: 2,
confLabel: '金额'
}],
warrantyPeriodList: [{
confId: '',
confLabel: '无'
}]
}
},
props: {
relateProVisible: {
type: Boolean,
default: false
},
proList: {
type: Array,
default: () => []
},
originProInfo: {
type: Object,
default: () => { }
}
},
mounted() {
for (var i = 1; i <= 10; i++) {
this.warrantyPeriodList.push({
confId: i,
confLabel: i
})
}
this.proInfo = this.originProInfo ? _.cloneDeep(this.originProInfo) : _.cloneDeep(this.proInfo)
!this.proInfo.incentiveType && (this.proInfo.incentiveType = 1)
},
methods: {
handleChangeGood(value) {
var targetItem = this.proList.find(item => item.goodsCode === value)
this.proInfo.goodsName = targetItem.goodsName
this.proInfo.goodsCode = targetItem.goodsCode
this.proInfo.sapCode = targetItem.sapCode
this.proInfo.thumbUrl = targetItem.thumbUrl
this.proInfo.goodsType = targetItem.goodsType
this.proInfo.goodsTypeName = targetItem.goodsTypeName
this.proInfo.warrantyPeriod = this.warrantyProList.includes(targetItem.goodsType) ? '5' : ''
console.log(this.proInfo);
},
handleRelateProConfirm() {
this.$refs.proRuleForm1.validate(valid1 => {
if (valid1) {
this.$emit('handleRelateProConfirm', this.proInfo)
}
})
},
handleRelateProClose() {
this.$emit('handleRelateProClose')
},
handleUpgradePrice(newVal) {
this.proInfo.upgradePrice = limitPrice(newVal, this.oldVal.upgradePrice, 8, 2)
this.oldVal.upgradePrice = this.proInfo.upgradePrice
},
handleShopPrice(newVal) {
this.proInfo.shopPrice = limitPrice(newVal, this.oldVal.shopPrice, 6, 2)
this.oldVal.shopPrice = this.proInfo.shopPrice
},
handleShopMinPrice(newVal) {
this.proInfo.shopMinPrice = limitPrice(newVal, this.oldVal.shopMinPrice, 6, 2)
this.oldVal.shopMinPrice = this.proInfo.shopMinPrice
},
handleShopPriceBlur() {
if (this.proInfo.upgradePrice) {
var validateObj = (this.proInfo.shopPrice <= this.proInfo.upgradePrice) ? 'clearValidate' : 'validateField'
this.$refs.proRuleForm1[validateObj]('upgradePrice')
}
}
}
}
</script>
<style scoped>
.relateProDialog.flex {
display: flex;
}
.relateProDialog .sub-title {
display: inline-block;
height: 52px;
line-height: 36px;
margin-right: 40px;
}
.relateProDialog .w-50 {
display: inline-block;
width: 50%;
}
.relateProDialog img {
width: 160px;
height: 160px;
margin-right: 20px;
}
.relateProDialog .dis-in-block {
/* display: inline-block; */
width: 98%;
/* margin-right: 6px; */
}
.relatePro .btn-txt {
display: inline-block;
font-size: 14px;
margin-right: 209px;
color: #606266;
}
.relatePro .select-suffix {
position: relative;
}
.relatePro .select-suffix::after {
display: inline-block;
content: '年';
position: absolute;
right: 30px;
top: 0px;
}
</style>
<!-- 关联门店弹窗 -->
<template>
<d2-dialog title="关联门店"
:isVisible.sync="relateStoreVisible"
width="70%"
btnOkLabel="关联"
@confirmDialog="handleRelateStoreConfirm"
@closeDialog="handleRelateStoreClose"
class="relateStore">
<slot></slot>
<el-row>
<el-col :span="12">
<el-table ref="seletingTable"
:data="selectingData"
height="464px"
class="table"
border
@select="handleChange"
@select-all="handleAll">
<el-table-column type="selection"
width="55"
align="center"></el-table-column>
<!-- :selectable="selectable" -->
<el-table-column v-if="sourcePage != 'serviceStore'"
prop="yqMerchantName"
label="园区店名称"
align="center">
<template slot-scope="scope">
<span
:class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{scope.row.yqMerchantName}}</span>
</template>
</el-table-column>
<el-table-column prop="merchantName"
label="4S店名称"
align="center">
<template slot-scope="scope">
<span
:class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{scope.row.merchantName}}</span>
<el-tooltip v-if="!scope.row.isSetUpgradeSettleRule"
popper-class="tooltip-class"
effect="dark"
content="该门店无配置财务分润规则,无法关联!"
placement="top">
<span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)"
class="tip-icon">?</span>
</el-tooltip>
</template></el-table-column>
</el-table>
<el-pagination small
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total"></el-pagination>
</el-col>
<el-col :span="12">
<el-table :data="selectedData"
class="table"
border
height="464px">
<el-table-column v-if="sourcePage != 'serviceStore'"
prop="yqMerchantName"
label="园区店名称"
align="center"></el-table-column>
<el-table-column prop="merchantName"
label="4S店名称"
align="center"></el-table-column>
<el-table-column label="删除"
align="center"
width="50px">
<template slot-scope="scope">
<el-button class="el-icon-delete"
@click="handleDelete(scope.row)"
type="text">
</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</d2-dialog>
</template>
<script>
export default {
name: 'relateStoreDialog',
data() {
return {
selectedData: [],
selectingData: [],
needTip: ['editProduct'],
// 分页
total: 0,
currentPage: 1,
pageSize: 20
}
},
props: {
relateStoreVisible: {
type: Boolean,
default: false
},
// 页面来源
sourcePage: {
type: String,
default: ''
},
storeApi: {
type: Function,
default: () => { }
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => { }
}
// 去掉表格中某些字段
// noTableField: {
// type: Array,
// default: () => []
// }
},
mounted() {
this.selectedData = this.storeSelected
this.getSelectingList()
},
methods: {
selectable(row, index) {
var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
if (this.sourcePage === 'editProduct') {
// 不能选的判断
// console.log('??')
isSelect = row.isSetUpgradeSettleRule
}
return isSelect
},
recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantId)
this.selectingData.forEach(item => {
exitIds.includes(item.merchantId) && this.$refs.seletingTable.toggleRowSelection(item, true)
})
},
getSelectingList() {
this.storeApi({
...this.storeSearchForm,
currentPage: this.currentPage,
pageSize: this.pageSize
}).then(res => {
this.selectingData = res.list
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.merchantId === row.merchantId)
addOrDelete
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId))
},
handleAll(selection) {
this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId)
var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && (isExit === -1) && !isServed) {
this.selectedData.push(item)
} else if (!selection.length && (isExit !== -1)) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId)
this.$refs.seletingTable.toggleRowSelection(row)
},
handleCurrentChange(val) {
this.currentPage = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
this.$emit('handleRelateStoreConfirm', this.selectedData)
},
handleRelateStoreClose() {
this.$emit('handleRelateStoreClose')
}
}
}
</script>
<style>
.relateStore .table {
margin: 0 auto 20px !important;
width: 98%;
}
.service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
}
.service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important;
}
.relateStore .red {
color: red;
}
.relateStore .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
</style>
<!-- 查看详情 -->
<template>
<el-drawer title="商品明细"
size="60%"
<el-drawer size="60%"
:with-header="false"
:visible.sync="drawerDetailVisible"
:before-close="handleDrawerClose">
<div class="d2-drawer-content car-txt">
<div class="d2-drawer-content car-txt"
style="background: #F2F4F7;">
<div class="d2-drawer-block title-block">
<p class="car-sub-head">商品明细</p>
<p class="parentGoods">{{commodityInfo.goodsInfo.goodsName}}<span
class="parent-type">{{commodityInfo.goodsInfo.goodsTypeName}}</span></p>
<p class="examineP"
v-if="examineFlag">审核人:{{userInfo.loginAccount.userName}}</p>
<p class="close-icon"
@click="handleDrawerClose">×</p>
<!-- <p class="car-disabled-txt title-tips">该商品配置为根据<span class="car-strong-txt">商户</span>比例统一分配!</p> -->
</div>
<el-form class="d2-drawer-block"
<!-- <el-form class="d2-drawer-block"
label-width="110px"
:inline="true">
<p class="car-sub-head">基础商品</p>
......@@ -32,39 +35,76 @@
label="零售价格:">
<span>{{commodityInfo.goodsInfo.retailPrice}}元</span>
</el-form-item>
</el-form>
<el-form class="d2-drawer-block"
<el-form-item class="d2-drawer-item"
label="品牌:">
<span></span>
</el-form-item>
</el-form> -->
<el-form class="child-drawer-block"
label-width="110px"
:inline="true"
v-for="(item,index) in commodityInfo.upgradeGoodsList"
:key="index">
<p class="car-sub-head">升级商品{{index + 1}}</p>
<el-form-item class="d2-drawer-item"
<p class="car-sub-head">商品{{index + 1}}-{{item.goodsInfo.goodsName}}</p>
<!-- <el-form-item class="d2-drawer-item"
label="商品名称:">
<span>{{item.goodsInfo.goodsName}}</span>
</el-form-item> -->
<el-form-item class="d2-drawer-item"
label="品牌:">
<span>{{item.goodsInfo.brandMerchantName}}</span>
</el-form-item>
<el-form-item class="d2-drawer-item"
label="所属分类:">
label="分类:">
<span>{{item.goodsInfo.goodsTypeName}}</span>
</el-form-item>
<el-form-item class="d2-drawer-item"
label="产品成本:">
<span>{{item.shopPrice ? (item.shopPrice + '元') : '无'}}</span>
</el-form-item>
<!-- style="font-weight: bold;" -->
<el-form-item class="d2-drawer-item"
style="font-weight: bold;"
label="建议升级价:">
<span class="car-strong-txt">{{item.upgradePrice}}元</span>
<!-- class="car-strong-txt" -->
<span>{{item.upgradePrice}}元</span>
</el-form-item>
<el-form-item class="d2-drawer-item"
label="商品最低价:">
<span>{{item.shopMinPrice ? (item.shopMinPrice + '元') : '无'}}</span>
</el-form-item>
<el-form-item v-if="warrantyProList.includes(item.goodsInfo.goodsType)"
class="d2-drawer-item"
label="质保年限:">
<span>{{item.warrantyPeriod ? (item.warrantyPeriod + '年') : '无'}}</span>
</el-form-item>
<el-form-item class="d2-drawer-item timeline-item_wrapper"
style="width:100%;marginTop:5px"
label="审核记录:">
<!-- <p v-for="reviewInfo in item.reviewInfoList">
{{reviewInfo.reviewMessage}}<span>{{reviewInfo.reviewDate}}</span>
</p> -->
<el-timeline v-show="item.reviewInfoList">
<el-timeline-item v-for="(reviewInfo,infoId) in item.reviewInfoList"
color="#0bbd87"
:key="infoId"
:timestamp="reviewInfo.reviewDate">
{{reviewInfo.reviewMessage}}
</el-timeline-item>
</el-timeline>
</el-form-item>
<el-form-item class="d2-drawer-item"
style="marginLeft:150px"
v-if="examineFlag && item.reviewStatus == '0'">
<el-button type="primary"
size="small"
@click="handleReview(item,1)">审核通过</el-button>
<el-button size="small"
@click="handleReview(item,2)">驳回</el-button>
</el-form-item>
</el-form>
<div>
<div class="child-drawer-block">
<p class="car-sub-head"
style="padding: 0 20px 10px;">分配可见门店</p>
style="padding: 0 0 10px;">分配可见门店</p>
<el-table :data="commodityInfo.linkMerchants"
border
class="store-table">
......@@ -99,12 +139,13 @@
</template>
<script>
import { getGoodsInfoById } from '@/api/commodity'
import { getGoodsInfoById, submitReviewResult } from '@/api/commodity'
import { userType, ghUserType } from '@/common/constants'
export default {
name: 'drawerDetail',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
warrantyProList: [1, 4, 6],
commodityInfo: {
goodsInfo: {}
......@@ -112,7 +153,9 @@ export default {
baseData: {
userTypeList: userType,
ghUserTypeList: ghUserType
}
},
examineFlag: false, //是否有审核权限
isExamineOp: false //是否做了审核操作
}
},
......@@ -128,21 +171,57 @@ export default {
},
mounted() {
getGoodsInfoById({ id: this.commodityInfoId }).then(res => {
this.commodityInfo = res
this.commodityInfo['linkMerchants'] = res.merchantRefList ? res.merchantRefList.map(item => Object.assign(item, item.merchantInfo)) : []
})
console.log(this.userInfo);
console.log(this.userInfo.loginAccount.userName);
const $store = this.$store.getters['d2admin/auth/curBtns']
console.log($store);
const btnId = '9030207' //审核权限ID
const _item = $store.find(i => (i.authId === btnId))
if (_item) {
this.examineFlag = true
}
this.getInfo(this.commodityInfoId)
// getGoodsInfoById({ id: this.commodityInfoId }).then(res => {
// this.commodityInfo = res
// this.commodityInfo['linkMerchants'] = res.merchantRefList ? res.merchantRefList.map(item => Object.assign(item, item.merchantInfo)) : []
// })
},
methods: {
handleDrawerClose() {
this.$emit('handleDrawerClose')
this.$emit('handleDrawerClose', this.isExamineOp)
},
getInfo(id) {
getGoodsInfoById({ id: id }).then(res => {
this.commodityInfo = res
this.commodityInfo['linkMerchants'] = res.merchantRefList ? res.merchantRefList.map(item => Object.assign(item, item.merchantInfo)) : []
})
},
handleReview(info, review) {
console.log(info)
var html = {
1: '通过',
2: '驳回'
}[review]
var params = {}
params.goodsId = info.id
params.reviewType = review
params.status = info.status
params.reviewStatus = info.reviewStatus
submitReviewResult(params).then(res => {
this.notice.okTips(html + '申请操作成功')
this.getInfo(this.commodityInfoId)
this.isExamineOp = true
})
}
}
}
</script>
<style>
<style lang="scss">
.el-drawer__body {
overflow: scroll;
}
......@@ -156,12 +235,14 @@ export default {
border-bottom: 1px solid #e7eaec;
padding: 0 20px 20px;
margin-bottom: 20px;
background: #ffffff;
}
.d2-drawer-content .d2-drawer-block.title-block {
position: relative;
display: flex;
justify-content: space-between;
padding: 20px 20px;
background: #ffffff;
}
.d2-drawer-block .d2-drawer-item {
width: 47%;
......@@ -171,4 +252,79 @@ export default {
width: 100%;
margin-bottom: 0;
}
.parentGoods {
font-family: PingFangSC-Medium;
font-size: 18px;
color: #333333;
line-height: 28px;
font-weight: 600;
}
.parent-type {
font-family: PingFangSC-Regular;
font-size: 16px;
color: #666666;
line-height: 24px;
font-weight: 400;
padding-left: 15px;
}
.car-txt .examineP {
font-family: PingFangSC-Regular;
font-size: 16px;
margin-left: auto;
margin-right: 40px;
padding: 3px;
}
.d2-drawer-content .child-drawer-block {
border-bottom: 1px solid #e7eaec;
padding: 20px 20px 20px;
margin-bottom: 20px;
background: #ffffff;
margin: 10px 8px 0 10px;
}
.child-drawer-block .d2-drawer-item {
font-family: PingFangSC-Regular;
font-size: 14px;
color: #333333;
font-weight: 400;
width: 30%;
margin: 0 0 0 0;
}
/* .child-drawer-block .d2-drawer-row {
width: 100%;
margin-bottom: 0;
} */
.child-drawer-block .car-sub-head {
font-family: PingFangSC-Medium;
font-size: 16px;
color: #333333;
line-height: 24px;
font-weight: 600;
}
.timeline-item_wrapper {
.el-form-item__content {
width: calc(100% - 110px);
}
.el-timeline-item__wrapper {
display: flex;
align-items: center;
justify-content: space-between;
// margin-top: 5px;
}
.el-timeline-item__timestamp.is-bottom {
margin-top: 0;
}
}
.timeline-item_wrapper .el-timeline-item__tail {
position: absolute;
left: 4px;
height: 100%;
top: 8px;
border-left: 2px solid #e4e7ed;
}
.timeline-item_wrapper .el-timeline-item__node--normal {
left: -1px;
top: 8px;
width: 12px;
height: 12px;
}
</style>
......@@ -2,30 +2,34 @@
<template>
<d2-container class="edit-commodity">
<!-- :formItemWidth="formItemWidth" -->
<d2-form v-if="show"
ref="d2Form"
:storeApi="commodityAddSeviceMerchant"
formName="commodity"
:rules="rules"
:addOrEdit="addOrEdit"
:originData="editData"
:formList="editForm"
:formRef="comFormRef"
@ydMerchantChange="getGoodsList"
@handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose">
<d2-form-goods v-if="show"
ref="d2Form"
:storeApi="commodityAddSeviceMerchant"
formName="commodity"
:rules="rules"
:addOrEdit="addOrEdit"
:originData="editData"
:formList="editForm"
:formRef="comFormRef"
@ydMerchantChange="getGoodsList"
@handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose">
<p slot="title"
class="edit-title">{{addOrEdit === 'add' ? '新增商品' : '编辑商品'}}</p>
</d2-form>
</d2-form-goods>
</d2-container>
</template>
<script>
import { mapActions } from 'vuex'
import { limitPrice } from '@/common/constants'
import d2FormGoods from './d2-form/index'
import { commodityAddSeviceMerchant, getGoodsList, baseGoodsAdd, baseGoodsUpdate, getGoodsInfoById } from '@/api/commodity'
export default {
name: 'editCommodity',
components: {
d2FormGoods
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
......@@ -66,7 +70,7 @@ export default {
comFormRef: 'com',
editForm: [{
title: '基础商品信息',
width: '50%',
// width: '50%',
headImg: {
attr: 'thumbUrl'
},
......@@ -79,50 +83,53 @@ export default {
optionList: [],
isDisabled: true,
optionId: 'goodsCode',
optionLabel: 'goodsName'
optionLabel: 'goodsName',
width: '400px'
},
{
name: 'goodsTypeName',
label: '分类',
type: 'input',
isDisabled: true
},
{
name: '',
label: '',
type: 'span'
isDisabled: true,
width: '400px'
},
// {
// name: '',
// label: '',
// type: 'span'
// },
{
name: 'sapCode',
label: '编号',
type: 'input',
isDisabled: true
isDisabled: true,
width: '400px'
},
{
name: 'shopPrice',
label: '产品成本',
type: 'input',
unit: '元',
handleBlur: () => {
if (this.markOldVal.retailPrice) {
var validateObj = (this.markOldVal.shopPrice <= this.markOldVal.retailPrice) ? 'clearValidate' : 'validateField'
this.$refs.d2Form.$refs[this.comFormRef + 'd2FormRuleForm'][validateObj]('retailPrice')
}
},
handleInput: (newVal) => {
this.$refs.d2Form.formData.shopPrice = limitPrice(newVal, this.markOldVal.shopPrice, 6, 2)
this.markOldVal.shopPrice = this.$refs.d2Form.formData.shopPrice
}
}, {
name: 'retailPrice',
label: '零售价格',
type: 'input',
unit: '元',
handleInput: (newVal) => {
this.$refs.d2Form.formData.retailPrice = limitPrice(newVal, this.markOldVal.retailPrice, 6, 2)
this.markOldVal.retailPrice = this.$refs.d2Form.formData.retailPrice
}
}
// {
// name: 'shopPrice',
// label: '产品成本',
// type: 'input',
// unit: '元',
// handleBlur: () => {
// if (this.markOldVal.retailPrice) {
// var validateObj = (this.markOldVal.shopPrice <= this.markOldVal.retailPrice) ? 'clearValidate' : 'validateField'
// this.$refs.d2Form.$refs[this.comFormRef + 'd2FormRuleForm'][validateObj]('retailPrice')
// }
// },
// handleInput: (newVal) => {
// this.$refs.d2Form.formData.shopPrice = limitPrice(newVal, this.markOldVal.shopPrice, 6, 2)
// this.markOldVal.shopPrice = this.$refs.d2Form.formData.shopPrice
// }
// }, {
// name: 'retailPrice',
// label: '零售价格',
// type: 'input',
// unit: '元',
// handleInput: (newVal) => {
// this.$refs.d2Form.formData.retailPrice = limitPrice(newVal, this.markOldVal.retailPrice, 6, 2)
// this.markOldVal.retailPrice = this.$refs.d2Form.formData.retailPrice
// }
// }
]
}, {
title: '绑定升级商品',
......@@ -208,11 +215,23 @@ export default {
})
},
handleAddClose(isRefresh = false) {
this.close({ tagName: '/commodity' })
this.$router.push({ name: 'commodity' })
this.close({ tagName: '/editCommodity' })
if (isRefresh) {
this.close({ tagName: '/commodity' })
this.$router.push({ name: 'commodity' })
this.close({ tagName: '/editCommodity' })
} else {
this.$confirm('内容未保存,是否返回?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
this.close({ tagName: '/commodity' })
this.$router.push({ name: 'commodity' })
this.close({ tagName: '/editCommodity' })
})
}
},
handleAddConfirm(data) {
// 升级商品的产品成本要大于或等于基础商品产品成本
var upgradeList = data.upgradeGoods.length ? data.upgradeGoods.filter(item => item.shopPrice < data.shopPrice) : []
if (upgradeList.length) {
......@@ -222,7 +241,7 @@ export default {
})
return true
}
var upgradeGoodsAttr = ['goodsCode', 'shopPrice', 'upgradePrice', 'incentiveType', 'shopMinPrice', 'id', 'warrantyPeriod']
var upgradeGoodsAttr = ['goodsCode', 'shopPrice', 'upgradePrice', 'incentiveType', 'shopMinPrice', 'id', 'warrantyPeriod', 'status', 'reviewStatus']
var params = {
// yqMerchantId: this.userInfo.beSuper ? data.yqMerchantId : this.userInfo.detail.merchantId,
merchantId: this.userInfo.detail.merchantId,
......@@ -233,7 +252,7 @@ export default {
upgradeGoods: data.upgradeGoods.length ? data.upgradeGoods.map(item => {
const tempVal = {}
upgradeGoodsAttr.forEach(i => {
item[i] && (tempVal[i] = item[i])
(item[i] || item[i] == '0') && (tempVal[i] = item[i])
})
return {
...tempVal
......@@ -248,18 +267,23 @@ export default {
})
}
// console.log(params)
if (this.addOrEdit === 'edit') {
params.id = data.id
baseGoodsUpdate(params).then(res => {
this.notice.okTips()
this.handleAddClose()
})
} else {
baseGoodsAdd(params).then(res => {
this.notice.okTips()
this.handleAddClose(true)
})
}
this.$confirm('提交商品需要进入审核', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
if (this.addOrEdit === 'edit') {
params.id = data.id
baseGoodsUpdate(params).then(res => {
this.notice.okTips()
this.handleAddClose(true)
})
} else {
baseGoodsAdd(params).then(res => {
this.notice.okTips()
this.handleAddClose(true)
})
}
})
}
}
}
......
<template>
<d2-dialog :title="'单店目标产值'"
:isVisible="outputVisible"
:width="'880px'"
@closeDialog="handleImport"
@confirmDialog="handleConfirmImport">
<slot>
<div class="searchWrap">
<el-col :span="13">
<el-date-picker v-model="search.targetDate"
:clearable="false"
type="month"
format="yyyy 年 MM 月"
value-format="yyyy-MM"
:picker-options="pickerOptions"
placeholder="选择月">
</el-date-picker>
</el-col>
<el-col :span="9">
<el-input v-model="search.keyword"
clearable
placeholder="输入门店名称搜索"></el-input>
</el-col>
<el-col :span="2"
class="btnContainer">
<el-button type="primary"
@click="getList"
class="searchBtn">搜索</el-button>
</el-col>
<!-- <div class="searchInput">
</div> -->
</div>
<div class="yqdTableContainer">
<!-- border -->
<el-table :data="tableData"
stripe
max-height="450"
:header-cell-style="rowClass"
style="width: 100%">
<el-table-column label="序号"
type="index"
width="50">
</el-table-column>
<el-table-column prop="yqMerchantName"
label="园区店列表"
width="300">
</el-table-column>
<el-table-column prop="merchantName"
label="门店列表"
width="300">
</el-table-column>
<!-- <el-table-column prop="outputValue"
label="门店列表">
</el-table-column> -->
<!-- width="260" -->
<el-table-column prop="outputValue"
label="产值目标">
<template slot-scope="scope">
<!-- <div>slot-scope="scope"</div> &&item.isEdit-->
<span v-if="!scope.row['isEdit']">{{scope.row['outputValue']}}</span>
<!-- @input="input($event,item)" -->
<el-input v-else
style="width: 140px"
@input="handleInput($event,scope)"
v-model="scope.row['outputValue']"
placeholder=""></el-input>
<!-- <div></div> -->
</template>
</el-table-column>
</el-table>
<div class="tips">填写后不支持修改,请谨慎输入。</div>
</div>
</slot>
</d2-dialog>
</template>
<script>
import { limitPrice } from '@/common/constants'
// import moment from 'moment'
import dayjs from 'dayjs'
import { getMerchantOutputValueTarget, setMerchantOutputValueTarget } from '@api/index'
export default {
props: {
isShow: {
// 弹窗是否展示
type: Boolean,
default: true
}
},
data() {
return {
pickerOptions: {
disabledDate: (time) => {
const maxMonth = dayjs().subtract(-1, 'months').endOf('month')
const minMonth = dayjs().subtract(5, 'months').startOf('month')
// console.log(minMonth.valueOf())
// console.log(time.getTime())
// time.getTime() > minMonth.valueOf() ||
return time.getTime() > maxMonth.valueOf() || time.getTime() < minMonth.valueOf()
}
},
nowMonth: dayjs().subtract(0, 'months').startOf('month').format('YYYY-MM'),
nextMonth: dayjs().subtract(-1, 'months').startOf('month').format('YYYY-MM'),
search: {
keyword: '',
targetDate: ''
},
// tableLabel: [],
tableData: [
// {
// date: '2016-05-02',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1518 弄'
// }
// , {
// date: '2016-05-04',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1517 弄'
// }, {
// date: '2016-05-04',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1517 弄'
// }, {
// date: '2016-05-04',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1517 弄'
// }, {
// date: '2016-05-04',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1517 弄'
// }, {
// date: '2016-05-04',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1517 弄'
// }, {
// date: '2016-05-01',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1519 弄'
// }, {
// date: '2016-05-01',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1519 弄'
// }, {
// date: '2016-05-01',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1519 弄'
// }, {
// date: '2016-05-01',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1519 弄'
// }, {
// date: '2016-05-01',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1519 弄'
// }, {
// date: '2016-05-03',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1516 弄'
// }
]
// outputVisible: true
}
},
computed: {
outputVisible: {
get() {
return this.isShow
},
set(val) {
this.$emit('update:isShow', false)
}
}
},
mounted() {
// console.log(this.nowMonth)
this.search.targetDate = this.nowMonth
this.getList()
// console.log(moment().subtract(-1, 'months').endOf('month').format('YYYY-MM-DD'))
// console.log(moment().subtract(5, 'months').startOf('month').format('YYYY-MM-DD'))
},
methods: {
getList() {
getMerchantOutputValueTarget(this.search).then((result) => {
const monthCheck = [this.nowMonth, this.nextMonth].includes(this.search.targetDate)
// console.log(monthCheck)
// 处理值能否编辑的问题
const listFilter = result
// 要单月或者下月并且值为0才可以编辑
this.tableData = listFilter.map((item) => {
item.dataMonth = this.search.targetDate
item.isEdit = monthCheck && !item.outputValue
return item
})
// console.log(result)
this.tableData = result
// console.log(this.tableData)
}).catch((err) => {
console.log(err)
})
},
handleInput(newValue, item) {
// console.log(newValue, item)
// let limitNum = limitPrice
// console.log(limitPrice(newValue, item.row.outputValue, 6))
newValue = newValue.replace(/[^\d.]/g, '') // 清除“数字”和“.”以外的字符
// console.log(newValue)
this.tableData[item.$index]['outputValue'] = limitPrice(newValue, item.row.outputValue, 6, 0, 1)
// console.log(this.tableData[item.$index]['name'])
},
// 设置表头的颜色
rowClass({ row, rowIndex }) {
// console.log(rowIndex) // 表头行标号为0
return 'background:#F4F6FC'
},
async handleConfirmImport() {
const filterList = this.tableData.filter((item) => {
// 删除无需字段 避免后台类型报错
delete item.createdDate
delete item.updatedDate
return item.isEdit && item.outputValue
})
if (filterList.length) {
// console.log('请求修改')
// const result =
await setMerchantOutputValueTarget({ list: filterList })
// console.log(result)
}
// else {
// console.log('没有能修改的')
// }
this.handleImport()
},
handleImport() {
this.outputVisible = false
}
}
}
</script>
<style lang="scss" scoped>
::v-deep.searchWrap {
height: 30px;
margin-bottom: 10px;
.el-input__inner {
height: 30px;
}
.el-input__icon {
line-height: 30px;
}
.btnContainer {
text-align: right;
padding-right: 10px;
}
.searchBtn {
font-size: 12px;
padding: 8px 10px;
}
}
::v-deep.yqdTableContainer {
.el-table .cell {
padding: 0 10px;
}
// padding-right: 3px;
.el-table__body-wrapper {
.el-table__row td:nth-child(1) {
border-left: 1px solid #ebeef5;
}
.el-table__row td:nth-last-child(1) {
border-right: 1px solid #ebeef5;
}
}
}
.tips {
margin-top: 10px;
font-size: 12px;
text-align: right;
color: #f46967;
}
</style>
<template>
<el-row>
<el-col :span="24">
<el-card :body-style="{ padding: '16px' }">
<div class="reportContainer box-card">
<div class="reportTips">数据日报{{reportDay}}已生成</div>
<div class="selectContainer">
<div>选择日期</div>
<div class="daySelect">
<el-date-picker v-model="dateValue"
type="date"
:picker-options="pickerOptions"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
<!-- <el-select v-model="model"
placeholder="">
<el-option v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select> -->
</div>
<!-- -->
<el-button type="primary"
@click="exportDailyReport"
:loading="exportDailyReportBtn"
class="exportBtn">导出日报</el-button>
</div>
<div class="inputTargetBtn"
@click="outputVisible = true"><i class="el-icon-edit"></i>输入单店产值目标</div>
</div>
</el-card>
</el-col>
<outputValueDialog v-if="outputVisible"
:isShow.sync="outputVisible"></outputValueDialog>
</el-row>
</template>
<script>
import outputValueDialog from './outputValueDialog'
// import moment from 'moment'
import dayjs from 'dayjs'
import { getExportDailyReport } from '@api/index'
import { downLoadFile } from '@/common/util'
export default {
name: 'reportDownloadsCom',
components: {
outputValueDialog
},
data() {
return {
reportDay: dayjs().subtract(1, 'day').format('YYYY年MM月DD日'),
pickerOptions: {
// 不能超过当前日期和业务开始日期
disabledDate(time) {
return time.getTime() > Date.now() - 8.64e7 || time.getTime() <
new Date('2020-10-01').getTime() -
1 * 24 * 60 * 60 * 1000
}
},
dateValue: dayjs().subtract(1, 'day').format('YYYY-MM-DD'),
outputVisible: false,
exportDailyReportBtn: false
}
},
methods: {
exportDailyReport() {
if (!this.dateValue) return this.$message.warning('请选择日期')
this.exportDailyReportBtn = true
// console.log(downLoadFile)
// return
getExportDailyReport({ endDateStr: this.dateValue }).then((result) => {
// if (result.code == 0) {
// console.log(downLoadFile)
// console.log(result)
downLoadFile(result)
// }
}).catch((err) => {
console.log(err)
}).finally((result) => {
this.exportDailyReportBtn = false
})
}
}
}
</script>
<style lang="scss">
.reportContainer {
display: flex;
height: 30px;
font-size: 14px;
.reportTips {
font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
padding-right: 25px;
border-right: 1px solid #dcdfe6;
}
.selectContainer {
display: flex;
align-items: center;
padding-left: 25px;
.exportBtn {
font-size: 12px;
padding: 8px 10px;
}
}
.daySelect {
margin: 0 8px;
.el-input__inner {
height: 30px;
}
.el-input__icon {
line-height: 30px;
}
}
.inputTargetBtn {
margin-left: auto;
line-height: 30px;
cursor: pointer;
.el-icon-edit {
margin-right: 5px;
}
}
}
</style>
<!-- 总览 -->
<template>
<div class="indexPage">
<reportDownloads v-if="curBtnsInfo"></reportDownloads>
<!-- <el-row>
<el-col :span="24">
<el-card :body-style="{ padding: '16px' }">
<div class="reportContainer box-card">
<div class="reportTips">数据日报{{reportDay}}已生成</div>
<div class="selectContainer">
<div>选择日期</div>
<div class="daySelect">
<el-date-picker v-model="dateValue"
type="date"
:picker-options="pickerOptions"
format="yyyy 年 MM 月 dd 日"
placeholder="选择日期">
</el-date-picker>
</div>
<el-button type="primary"
class="exportBtn">导出日报</el-button>
</div>
<div class="inputTargetBtn"
@click="outputVisible = true"><i class="el-icon-edit"></i>输入单店产值目标</div>
</div>
</el-card>
</el-col>
</el-row> -->
<el-row>
<el-col :span="24">
<el-card class="box-card">
......@@ -287,10 +312,12 @@
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import reportDownloads from './components/reportDownloads'
import {
// getTodayInvite,
getTotalData,
......@@ -318,8 +345,12 @@ import { getPartnerYqListApi } from '@/api/account'
import * as echarts from 'echarts'
export default {
name: 'index',
components: {
reportDownloads
},
data() {
return {
// store: $store.getters['d2admin/auth/curBtns'],
id: '',
isBeSuper: false,
userInfo: this.$store.state.d2admin.user.info,
......@@ -358,8 +389,23 @@ export default {
productType: 'thisMonth'
}
},
computed: {
curBtnsInfo() {
const curBtns = this.$store.getters['d2admin/auth/curBtns'] || []
return curBtns.some((item) => {
// 路由定义的权限id
return item.authId == '90701'
})
// return this.$store.getters['d2admin/auth/curBtns']
}
},
mounted() {
// console.log(this.$store)
// console.log(this.$store.getters['d2admin/auth/curBtns'])
// console.log(this.$store.getters)
// console.log(this.$store.getters['d2admin/auth/curBtns'])
// let reportDay = moment().subtract(1, 'day').format('YYYY年MM月DD日')
// console.log(moment().subtract(1, 'day').format('YYYY年MM月DD日'))
this.getUserId().then(() => {
this.init()
})
......@@ -709,7 +755,7 @@ export default {
params.needCompareDateStr = dayjs().startOf('day').format('YYYY-MM-DD')
}
getCustomerData(params).then((res) => {
console.log(res)
// console.log(res)
this.customerData = res
})
}
......@@ -737,6 +783,7 @@ export default {
//padding: 15px 0;
}
}
.top_card {
margin: 15px 0;
padding: 15px;
......
......@@ -30,9 +30,9 @@
<span>商品名:{{goodsInfo.baseGoodsName}}</span>
<span class="title-target-obj">{{form.merchantName}}</span>
<span>(编号:{{goodsInfo.baseGoodsCode}})</span>
<span style="float: right; margin-top: -8px;">
<block style="float: right; margin-top: -8px;">
<span style="margin-right: 30px;">所属品类:{{goodsInfo.baseGoodsTypeName}}</span>
</span>
</block>
</p>
<div class="card-box flex card-list">
......@@ -41,7 +41,7 @@
<p class="list-item">升级价:{{goodsInfo.upgradePrice}}元</p>
</div>
<!-- 单个服务商展示 -->
<!-- 单个的服务商的 -->
<div class="flex card-list"
style="height: 130px;">
<div class="list-item"
......@@ -84,7 +84,7 @@
</div>
<div style="height: 50%;">
<p style="padding-top: 20px;"
class="one-line-ellipsis">平台方:dijiaWisdomCloud</p>
class="one-line-ellipsis">平台方:嘀加智慧云</p>
<p class="card-tips">
占{{merchantInfo.settleAccountRule ? (100 - merchantInfo.settleAccountRule.partnerProfitPer) : '100'}}%
</p>
......@@ -92,12 +92,6 @@
</div>
</div>
<!-- 多个服务商展示 -->
<div class="card-list">
<vue2-org-tree :data="data" />
<!-- <org-tree :data="data" /> -->
</div>
<div class="card-box"
style="margin-top: 20px;">
<div class="flex">
......@@ -140,7 +134,7 @@
src="./images/code.png"
/> -->
<vue-qr class="middle"
:margin="0"
margin="0"
width="134"
height="134"
:text="merchantInfo.goodsOrder.payOrder.outTradeNo"></vue-qr>
......@@ -225,65 +219,10 @@ import { mapActions } from 'vuex'
import vueQr from 'vue-qr'
import { limitPrice } from '@/common/constants'
import { moneyValidApi, getWsUrlApi } from '@api/merchant'
// import orgTree from 'vue2-org-tree'
export default {
name: 'stepThree',
components: {
vueQr
// orgTree
},
data() {
return {
data: {
id: 0,
label: 'XXX科技有限公司',
children: [
{
id: 2,
label: '产品研发部',
children: [
{
id: 5,
label: '研发-前端'
},
{
id: 6,
label: '研发-后端'
},
{
id: 9,
label: 'UI设计'
},
{
id: 10,
label: '产品经理'
}
]
},
{
id: 3,
label: '销售部',
children: [
{
id: 7,
label: '销售一部'
},
{
id: 8,
label: '销售二部'
}
]
},
{
id: 4,
label: '财务部'
},
{
id: 9,
label: 'HR人事'
}
]
},
size: 'small',
stepActive: 0,
form: {},
......@@ -329,11 +268,15 @@ export default {
default: () => { }
},
merchantInfo: {
type: Object,
type: String,
default: () => { }
}
},
components: {
vueQr
},
watch: {
stepStat(val) {
if (val === 3) {
......@@ -397,7 +340,6 @@ export default {
this.needJudgeAttr.forEach(item => {
this.needJudgeMerchantList[item] = this.merchantInfo.divisionRule[item]
})
console.log(this.needJudgeMerchantList)
this.noVirtualAccMerchantList = []
this.accessFirstMerchantList = []
this.needAccountNum = 0
......@@ -443,7 +385,6 @@ export default {
</script>
<style lang="scss">
@import './orgTree/orgTree.scss';
.d2-layout-header-aside-group
.d2-layout-header-aside-content
.d2-theme-container
......
......@@ -13,7 +13,7 @@ const isDev = process.env.NODE_ENV !== 'development'
// 基础路径 注意发布之前要先修改这里
const publicPath = '/dj-carlife-web/'
// const publicPath = ''
// const publicPath = '/'
// const CDN_DOMAIN = 'https://cdn.bootcss.com'
const CDN_DOMAIN = 'https://img02.glsx.com.cn/dj-carlife-web'
const cdn = {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!