Commit 2d75a257 by wangql
2 parents 1dc20c93 a7dedc8d
......@@ -3177,6 +3177,11 @@
"dev": true,
"optional": true
},
"charenc": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz",
"integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc="
},
"check-types": {
"version": "8.0.3",
"resolved": "https://registry.npmjs.org/check-types/-/check-types-8.0.3.tgz",
......@@ -4007,6 +4012,11 @@
"which": "^1.2.9"
}
},
"crypt": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
"integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs="
},
"crypto-browserify": {
"version": "3.12.0",
"resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz",
......@@ -4501,6 +4511,11 @@
}
}
},
"default-passive-events": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/default-passive-events/-/default-passive-events-2.0.0.tgz",
"integrity": "sha512-eMtt76GpDVngZQ3ocgvRcNCklUMwID1PaNbCNxfpDXuiOXttSh0HzBbda1HU9SIUsDc02vb7g9+3I5tlqe/qMQ=="
},
"default-require-extensions": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz",
......@@ -13037,6 +13052,15 @@
"safe-buffer": "^5.0.1"
}
},
"sha1": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz",
"integrity": "sha1-rdqnqTFo85PxnrKxUJFhjicA+Eg=",
"requires": {
"charenc": ">= 0.0.1",
"crypt": ">= 0.0.1"
}
},
"shallow-clone": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz",
......
......@@ -15,6 +15,7 @@
"axios": "^0.18.0",
"better-scroll": "^1.15.2",
"dayjs": "^1.8.12",
"default-passive-events": "^2.0.0",
"element-ui": "^2.11.1",
"flex.css": "^1.1.7",
"fuse.js": "^3.4.4",
......@@ -26,6 +27,7 @@
"nprogress": "^0.2.0",
"qs": "^6.8.0",
"screenfull": "^4.2.0",
"sha1": "^1.1.1",
"ua-parser-js": "^0.7.19",
"vue": "^2.6.10",
"vue-i18n": "^8.14.0",
......
import request from './request'
const path = 'dj.api.'
export function getList(data) {
data.method = '/commodity.search'
data.method = `${path}basegoods.page`
return request(data)
}
// 分页查找服务门店
export function commodityAddSeviceMerchant(data) {
data.method = `${path}servicemerchantref.page`
return request(data)
}
// 根据基础商品Id查询商品
export function getGoodsInfoById(data) {
data.method = `${path}basegoods.get.byId`
return request(data)
}
// 根据基础商品id获取分配门店列表 - 查看门店
export function getMerchantList(data) {
data.method = 'dj.basegoodsmerchantref.list.byBaseGoodsId'
return request(data)
}
// 查询产品列表
export function getGoodsList(data) {
data.method = `${path}goodsinfo.list`
return request(data)
}
// 新增商品
export function baseGoodsAdd(data) {
data.method = `${path}basegoods.add`
return request(data, 'post')
}
// 修改商品
export function baseGoodsUpdate(data) {
data.method = `${path}basegoods.update`
return request(data, 'post')
}
import request from './request'
const path = 'dj.api.'
export function getUserInfo(data) {
data.method = `${path}user.info`
return request(data)
}
import request from './request'
const path = 'dj.api.'
export function getList(data) {
data.method = '/product.search'
data.method = `${path}goodsinfo.page`
return request(data)
}
......@@ -2,46 +2,51 @@
* @Author: limin
* @Date: 2019-08-26 18:02:41
* @Last Modified by: chenwq
* @Last Modified time: 2020-01-08 17:30:56
* @Last Modified time: 2020-11-10 20:02:13
*/
import axios from '@/plugin/axios'
import sign from './sign'
import RequestMethods from './request.methods'
import util from '@/libs/util.js'
const request = (params = {}, method = RequestMethods.GET, noSignAttr = []) => {
params.source = 'test'
params.app_key = '48e5e13229b82c1b4e6e8c96151f0637'
// params.source = 'glsx'
params.appKey = '48e5e13229b82c1b4e6e8c96151f0637'
params.timestamp = new Date().getTime()
params.v = '1.0.0'
params.format = 'json'
params.locale = 'zh_CN'
if (params.method !== 'dj.api.user.login') {
params.sessionId = util.cookies.get('token')
}
/**
* mock - url = params.method
* 调后端接口 - url = ''
*/
const url = params.method // ''
/**
* 调后端接口,请使用以下代码。
*/
// var reqData = (method === RequestMethods.POST) ? {
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
// data: sign(params, noSignAttr)
// } : {
// params: sign(params, noSignAttr)
// }
// return axios({
// url,
// method,
// ...reqData
// })
/**
* mock,请使用以下代码。
*/
var reqData = (method === RequestMethods.POST) ? {
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
baseURL: process.env.VUE_APP_API,
data: sign(params, noSignAttr)
} : {
params: sign(params, noSignAttr)
}
return axios({
url,
method,
params: sign(params, noSignAttr)
...reqData
})
/**
* mock,请使用以下代码。
*/
// return axios({
// url,
// method,
// params: sign(params, noSignAttr)
// })
}
export default request
import request from './request'
const path = 'dj.api.'
export function getList(data) {
data.method = '/serviceStore.search'
data.method = `${path}servicemerchantref.page`
return request(data)
}
// 删除门店
export function deleteMerchant(data) {
data.method = `${path}servicemerchantref.delete.byId`
return request(data)
}
/*
* @Author: limin
* @Date: 2019-08-26 18:02:49
* @Last Modified by: limin
* @Last Modified time: 2019-09-16 14:45:51
* @Last Modified by: chenwq
* @Last Modified time: 2020-11-10 15:00:08
*/
import MD5 from 'js-md5'
import sha1 from 'sha1'
import qs from 'qs'
const secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const sign = (params, noSignAttr = []) => {
delete params.sign
const keys = Object.keys(params).sort()
var objStr = qs.stringify(_.cloneDeep(params), { arrayFormat: 'indices', encode: false, allowDots: true })
var objVal = objStr.split('&')
var realObj = {}
objVal.forEach(item => {
realObj[item.split('=')[0]] = item.split('=')[1]
})
const keys = Object.keys(realObj).sort()
var str = []
var obj = null
for (const key in params) {
obj = params[key]
for (const key in realObj) {
obj = realObj[key]
if (obj === null) {
obj = ''
} else if (typeof obj === 'object') {
obj = JSON.stringify(obj)
}
params[key] = obj
realObj[key] = obj
}
keys.forEach(e => {
!noSignAttr.includes(e) && str.push(e + params[e])
!noSignAttr.includes(e) && str.push(e + realObj[e])
})
params.sign = MD5(secret + str.join('') + secret)
return params
realObj.sign = sha1(secret + str.join('') + secret).toUpperCase()
return realObj
}
export default sign
......@@ -2,17 +2,17 @@
* @Author: limin
* @Date: 2019-08-26 18:02:55
* @Last Modified by: chenwq
* @Last Modified time: 2020-10-29 17:45:50
* @Last Modified time: 2020-11-05 17:39:39
*/
import request from './request'
import RequestMethods from './request.methods'
// 用户相关
const USER_PATH = 'fims.user.'
const USER_PATH = 'dj.api.'
// 角色相关
const ROLE_PATH = 'fims.role.'
export const LOGIN_URL = `${USER_PATH}loginTem`
export const LOGIN_URL = `${USER_PATH}user.login`
export const REG_URL = `${USER_PATH}register`
export const ROLE_LIST_URL = `${ROLE_PATH}list`
......@@ -22,30 +22,24 @@ export const ROLE_LIST_URL = `${ROLE_PATH}list`
*/
export function AccountLogin(data) {
data.method = LOGIN_URL
// return request(data, RequestMethods.POST)
return new Promise(resolve => {
resolve({
// stationCode: 'STA_HEB',
roleId: 7,
roleType: 2,
// companyName: '广联',
mobile: '15234057707',
userName: 'wxw',
loginName: 'foutouren',
// postName: '部门经理',
// postCode: '2003',
// stationName: '哈尔滨',
// validTime: '2020-09-04 10:39:28',
authes: []
// authes: [{
// authId: '101',
// parentId: '0'
// }, {
// authId: '102',
// parentId: '0'
// }]
})
})
return request(data)
// return new Promise(resolve => {
// resolve({
// roleId: 7,
// roleType: 2,
// mobile: '15234057707',
// userName: 'wxw',
// loginName: 'foutouren',
// authes: []
// // authes: [{
// // authId: '101',
// // parentId: '0'
// // }, {
// // authId: '102',
// // parentId: '0'
// // }]
// })
// })
}
/**
......
......@@ -2,7 +2,7 @@
* @Author: limin
* @Date: 2019-08-26 18:02:55
* @Last Modified by: chenwq
* @Last Modified time: 2019-09-30 10:57:13
* @Last Modified time: 2020-11-05 11:19:10
*/
import request from './request'
......@@ -10,6 +10,8 @@ import RequestMethods from './request.methods'
export const BASE_DATA_URL = 'fims.configuration.from.conftype'
const path = 'dj.api.'
/**
* 获取角色列表
* @param {*} data 参数
......@@ -27,3 +29,9 @@ export function BaseDataApi(data = {}) {
data.method = BASE_DATA_URL
return request(data, RequestMethods.GET)
}
// 获取商品分类列表
export function getGoodsType(data) {
data.method = `${path}goods.type.list`
return request(data)
}
......@@ -4,53 +4,68 @@
title="关联升级商品"
:isVisible.sync="relateProVisible"
btnOkLabel="关联"
@confirmDialog="handleRelateProConfirm"
@closeDialog="handleRelateProClose"
>
<div class="relateProDialog flex">
<img :src="proInfo.img" />
<img :src="proInfo.thumbUrl" />
<el-form
:model="proInfo"
:rules="rules"
label-width="110px"
ref="proRuleForm"
>
<el-form-item label="关联升级商品" prop="relativeId">
<el-form-item
label="关联升级商品"
prop="goodsCode"
>
<el-select
v-model="proInfo.relativeId"
v-model="goodVal"
placeholder="请选择关联商品"
value-key="goodsCode"
@change="handleChangeGood"
>
<el-option
v-for="item in proOptions"
:key="item.confId"
:label="item.confValue"
:value="item.confId"
v-for="item in proList"
:key="item.goodsCode"
:label="item.goodsName"
:value="item"
:disabled="item.disabled"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="类别">
<span>{{proInfo.type}}</span>
<el-input
disabled
value="升级"
class="dis-in-block"
></el-input>
</el-form-item>
<el-form-item label="建议升级价" prop="jysjj">
<el-form-item
label="建议升级价"
prop="upgradePrice"
>
<el-input
v-model="proInfo.jysjj"
v-model="proInfo.upgradePrice"
placeholder="请输入建议升级价"
clearable
class="dis-in-block"
></el-input>
<span>元</span>
</el-form-item>
<el-form-item label="到店价" prop="ddj">
<el-form-item
label="到店价"
prop="shopPrice"
>
<el-input
v-model="proInfo.ddj"
v-model="proInfo.shopPrice"
placeholder="请输入建议到店价"
clearable
class="dis-in-block"
></el-input>
<span>元</span>
</el-form-item>
<el-form-item label="升级最大折扣">
<el-input
v-model="proInfo.sjzdzk"
v-model="proInfo.maxUpgradeDiscount"
placeholder="请输入升级最大折扣"
clearable
class="dis-in-block"
......@@ -67,33 +82,22 @@ export default {
name: 'relateProDialog',
data() {
return {
goodVal: {},
proInfo: {
img: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1244233290,1050095100&fm=26&gp=0.jpg',
relativeId: '',
relativeLabel: '',
// thumbUrl: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1244233290,1050095100&fm=26&gp=0.jpg',
thumbUrl: '',
goodsCode: '',
goodsName: '',
type: '',
jysjj: '',
ddj: '',
sjzdzk: ''
upgradePrice: '',
shopPrice: '',
maxUpgradeDiscount: ''
},
rules: {
relativeId: [{ required: true, message: '请选择关联升级商品', trigger: 'change' }],
jysjj: [{ required: true, message: '请输入建议升级价', trigger: 'blur' }],
ddj: [{ required: true, message: '请输入到店价', trigger: 'blur' }]
},
proOptions: [{
confId: '1',
confValue: 'aaa'
}, {
confId: '2',
confValue: 'bbb'
}, {
confId: '3',
confValue: 'ccc'
}, {
confId: '4',
confValue: 'ddd'
}]
goodsCode: [{ required: true, message: '请选择关联升级商品', trigger: 'blur' }],
upgradePrice: [{ required: true, message: '请输入建议升级价', trigger: 'blur' }],
shopPrice: [{ required: true, message: '请输入到店价', trigger: 'blur' }]
}
}
},
......@@ -101,12 +105,29 @@ export default {
relateProVisible: {
type: Boolean,
default: false
},
proList: {
type: Array,
default: () => []
}
},
mounted() { },
mounted() {
},
methods: {
handleChangeGood(value) {
this.proInfo.goodsName = value.goodsName
this.proInfo.goodsCode = value.goodsCode
},
handleRelateProConfirm() {
// console.log(this.proInfo)
this.$refs.proRuleForm.validate(valid => {
if (valid) {
this.$emit('handleRelateProConfirm', this.proInfo)
}
})
},
handleRelateProClose() {
this.$emit('handleRelateProClose')
}
......
......@@ -5,6 +5,7 @@
:isVisible.sync="relateStoreVisible"
width="70%"
btnOkLabel="关联"
@confirmDialog="handleRelateStoreConfirm"
@closeDialog="handleRelateStoreClose"
class="relateStore"
>
......@@ -25,8 +26,9 @@
align="center"
></el-table-column>
<el-table-column
prop="confValue"
prop="merchantName"
label="门店名称"
align="center"
></el-table-column>
</el-table>
<el-pagination
......@@ -34,7 +36,7 @@
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="10"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total"
></el-pagination>
......@@ -47,7 +49,8 @@
height="500px"
>
<el-table-column
prop="confValue"
prop="merchantName"
align="center"
label="门店名称"
></el-table-column>
</el-table>
......@@ -62,22 +65,11 @@ export default {
data() {
return {
selectedData: [],
selectingData: [{
confId: 1,
confValue: '广州上策贸易有限公司'
}, {
confId: 2,
confValue: '广州上策贸易有限公司2'
}, {
confId: 3,
confValue: '广州上策贸易有限公司3'
}, {
confId: 4,
confValue: '广州上策贸易有限公司4'
}],
selectingData: [],
// 分页
total: 100,
currentPage: 1
total: 0,
currentPage: 1,
pageSize: 10
}
},
......@@ -85,21 +77,50 @@ export default {
relateStoreVisible: {
type: Boolean,
default: false
},
storeApi: {
type: Function,
default: () => { }
},
storeSelected: {
type: Array,
default: () => []
}
},
mounted() { },
mounted() {
this.selectedData = this.storeSelected
this.getSelectingList()
},
methods: {
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({
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.confId === row.confId)
var addOrDelete = !!selection.find(item => item.merchantId === row.merchantId)
addOrDelete
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(item => item.confId !== row.confId))
: (this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId))
},
handleAll(selection) {
this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.confId === item.confId)
var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId)
if (selection.length && (isExit === -1)) {
this.selectedData.push(item)
} else if (!selection.length && (isExit !== -1)) {
......@@ -109,8 +130,10 @@ export default {
},
handleCurrentChange(val) {
this.currentPage = val
console.log(this.currentPage)
// 调接口
this.getSelectingList()
},
handleRelateStoreConfirm() {
this.$emit('handleRelateStoreConfirm', this.selectedData)
},
handleRelateStoreClose() {
this.$emit('handleRelateStoreClose')
......
......@@ -11,7 +11,7 @@
:stripe="true"
@sort-change="sortChange"
@selection-change="handleSelect"
:tree-props="{children: 'updateGoodsList'}"
:tree-props="{children: 'upgradeGoodsList'}"
>
<el-table-column
v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
......@@ -26,7 +26,7 @@
width="60px"
label="序号"
type='index'
:index="index=>index+(pagination.pageSize - 1) * pagination.pageCount + 1"
:index="index=>index+(pagination.currentPage - 1) * pagination.pageSize + 1"
></el-table-column>
<el-table-column
v-for="(item, index) in tableParams.tableColumns"
......@@ -63,8 +63,8 @@
<span v-text="item.formatter(scope.row)"></span>
</template>
<template v-else-if="getListApi">
<!-- <span>{{data[scope.$index][item.prop]}}</span> -->
<span>{{scope.row[item.prop]}}</span>
<span v-if="item.parentProp">{{scope.row[item.parentProp][item.prop]}}</span>
<span v-else>{{scope.row[item.prop]}}</span>
</template>
<template v-else>
<span v-text="tableData[scope.$index][item.prop]"></span>
......@@ -94,9 +94,9 @@
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.pageSize"
:current-page="page.currentPage"
:page-sizes="[10,20,30,40]"
:page-size="page.pageCount"
:page-size="page.pageSize"
:total="getListApi ? total : tableTotal"
:layout="layout"
>
......@@ -113,8 +113,8 @@ export default {
data: [],
// 页码
page: {
pageCount: 10,
pageSize: 1
pageSize: 10,
currentPage: 1
},
total: 10,
// 排序
......@@ -139,7 +139,7 @@ export default {
},
tableTotal: {
type: Number,
default: 10
default: 0
},
// 获取列表接口
getListApi: {
......@@ -261,9 +261,12 @@ export default {
params.sort = this.sort === 'descending' ? 1 : 0
}
this.getListApi(params).then(res => {
this.pagination = res.pagination ? res.pagination : this.page
this.pagination = {
currentPage: res.pageNum,
pageSize: res.pageSize
}
this.data = res[this.tableParams.listName]
res.pagination && (this.total = res.pagination.totalCount)
this.total = res.total
this.loading = false
}).catch(() => {
this.loading = false
......@@ -271,14 +274,15 @@ export default {
})
},
// 页码
// 每页条数
handleSizeChange(value) {
this.page.pageCount = value
this.page.pageSize = value
this.getListApi ? this.refreshTable(false) : this.$emit('refreshTable', this.page)
},
// 页码
handleCurrentChange(value) {
this.page.pageSize = value
this.page.currentPage = value
this.getListApi ? this.refreshTable(false) : this.$emit('refreshTable', this.page)
}
}
......
......@@ -11,6 +11,8 @@ import store from '@/store/index'
// import D2Crud from '@d2-projects/d2-crud'
// 菜单和路由设置
import router from './router'
import 'default-passive-events'
import notice from '@/common/notice'
// import menuHeader from '@/menu/header'
// import menuAside from '@/menu/aside'
// import { frameInRoutes } from '@/router/routes'
......@@ -23,6 +25,7 @@ import router from './router'
// })
// 核心插件
Vue.use(d2Admin)
Vue.prototype.notice = notice
// Vue.use(D2Crud)
var baseConfig = ''
axios({
......
......@@ -4,7 +4,7 @@ import {
Message
} from 'element-ui'
import util from '@/libs/util'
// import router from '@/router'
import router from '@/router'
// import {
// LogExternals
// } from '@/common/constants'
......@@ -47,7 +47,7 @@ function errorLog(error) {
// 创建一个 axios 实例
const service = axios.create({
// baseURL: baseURL,
// timeout: 5000, // 请求超时时间
timeout: 100000, // 请求超时时间
transformRequest: [function(data) {
return Qs.stringify(data)
}]
......@@ -70,8 +70,9 @@ service.interceptors.request.use(
// expires: inExpiresMinutes
// })
// }
config.url = baseConfig.axios.baseURL + config.url
config.timeout = baseConfig.axios.timeout
// config.url = baseConfig.axios.baseURL + config.url
config.url = baseConfig.axios.baseURL
// config.timeout = baseConfig.axios.timeout
resolve(config)
})
},
......@@ -91,6 +92,13 @@ service.interceptors.response.use(
const ruleResult = baseConfig.axios.result
// 这个状态码是和后端约定的
// 有 code 代表这是一个后端接口 可以进行进一步的判断
console.log('>>>>>>>>>>>>>>>>/////////////')
if (dataAxios[ruleResult.code_key] == '21') {
// await store.dispatch('d2admin/account/logout')
util.cookies.remove('token')
router.replace('/login')
return
}
switch (+dataAxios[ruleResult.code_key]) {
case ruleResult.code_success_value:
// [ 示例 ] code === 0 代表没有错误
......
......@@ -135,6 +135,7 @@ export const resources = {
label: '导出',
category: 'Button',
handle: 'handleExport'
// rule:{0: '上架',}
}, {
authId: '1030203',
parentId: '10302',
......@@ -149,17 +150,17 @@ export const resources = {
component: _import('goods/commodity')
},
'10305': {
path: '/editeCommodity',
name: 'editeCommodity',
path: '/editCommodity',
name: 'editCommodity',
icon: 'document',
meta: {
title: '商品编辑',
authId: '10305',
parentId: '103',
cache: true,
// cache: true,
sideHidden: true
},
component: _import('goods/editeCommodity')
component: _import('goods/editCommodity')
},
'106': {
path: '/systemConfig',
......
......@@ -23,7 +23,8 @@ export default {
// uuid 是用户身份唯一标识 用户注册的时候确定 并且不可改变 不可重复
// token 代表用户当前登录状态 建议在网络请求中携带 token
// 如有必要 token 需要定时更新,默认保存一天
util.cookies.set('uuid', data.loginName)
// util.cookies.set('uuid', data.loginName)
util.cookies.set('token', data.sessionId)
data.roleType = baseConfig.hasAuth ? data.roleType : SUPPER_ADMIN
const authes = (+data.roleType === SUPPER_ADMIN)
? util.permision.flatten(Object.values(localRoutes))
......
......@@ -9,26 +9,28 @@
>
<el-form-item label="商品名称">
<el-input
v-model="searchForm.name"
v-model="searchForm.goodsName"
placeholder="请输入商品名称"
clearable
></el-input>
</el-form-item>
<el-form-item label="分类">
<el-select
v-model="searchForm.class"
v-model="searchForm.goodsType"
placeholder="请选择产品分类"
clearable
>
<el-option
v-for="item in baseData.product"
:key="item.confId"
:label="item.confKey"
:value="item.confId"
v-for="item in baseData.goodsType"
:key="item.goodsType"
:label="item.goodsTypeName"
:value="item.goodsType"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="品牌商">
<el-select
v-model="searchForm.brandName"
v-model="searchForm.brandMerchantCode"
placeholder="请选择品牌商"
>
<el-option
......@@ -66,10 +68,15 @@
slot="img"
slot-scope="scope"
class="pro-img"
:src="scope.scope.img"
:src="scope.scope.goodsInfo.thumbUrl"
/>
<auth-button
v-if="Object.keys(scope.scope).includes('updateGoodsList')"
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
></auth-button>
<!-- <auth-button
v-if="Object.keys(scope.scope).includes('upgradeGoodsList')"
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
......@@ -81,7 +88,7 @@
:data="scope.scope"
type="text"
@click="handleUpOrDown"
>{{scope.scope.state ? '上架' : '下架'}}</el-button>
>{{scope.scope.state ? '上架' : '下架'}}</el-button> -->
</d2-table>
<d2-dialog
title="关联门店信息"
......@@ -90,7 +97,8 @@
@closeDialog="handleDetailClose"
>
<store-detail
:detail="detailData"
v-if="detailVisible"
:detailData="detailData"
></store-detail>
</d2-dialog>
</d2-container>
......@@ -98,15 +106,17 @@
<script>
import { getList } from '@api/commodity'
import { getGoodsType } from '@api/sys.base.js'
import _ from 'lodash'
import storeDetail from './storeDetail'
export default {
name: 'commodity',
data() {
return {
searchForm: {
name: '',
class: '',
brandName: ''
goodsName: '',
goodsType: '',
brandMerchantCode: ''
},
editFormReset: {
aa: ''
......@@ -114,7 +124,7 @@ export default {
getListApi: getList,
// 表格参数
tableParams: {
mutiSelectUniqueKey: 'id',
mutiSelectUniqueKey: 'goodsCode',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
......@@ -127,22 +137,25 @@ export default {
addHtml: 'img'
}, {
label: '商品名称',
prop: 'name'
parentProp: 'goodsInfo',
prop: 'goodsName'
}, {
label: '分类',
prop: 'class'
parentProp: 'goodsInfo',
prop: 'goodsTypeName'
}, {
label: '品牌商',
prop: 'brandName'
parentProp: 'goodsInfo',
prop: 'brandMerchantName'
}, {
label: '属性',
prop: 'attr'
}, {
label: '关联商品数',
prop: 'relativeProNum'
prop: 'upgradeGoodsNum'
}, {
label: '关联商户数',
prop: 'relativeNum'
prop: 'merchantNum'
}, {
label: '产品状态',
prop: 'state',
......@@ -154,17 +167,15 @@ export default {
}
}, {
label: '创建时间',
prop: 'createTime'
parentProp: 'goodsInfo',
prop: 'createdDate'
}]
},
// 查看门店
detailVisible: false,
// 基本数据
baseData: {
product: [{
confId: 1,
confKey: '分类1'
}],
goodsType: [],
brandList: []
}
}
......@@ -175,9 +186,13 @@ export default {
},
mounted() {
console.log(storeDetail)
getGoodsType({}).then(res => {
// console.log(res)
this.baseData.goodsType = res
})
console.log(this.$route.params)
var allOpt = { confId: '', confKey: '全部' }
this.baseData.product.unshift(allOpt)
this.baseData.goodsType.unshift(allOpt)
this.baseData.brandList.unshift(allOpt)
},
......@@ -188,23 +203,33 @@ export default {
resolve()
})
},
handleSearch() {
console.log(this.searchForm)
handleReset() {
var keys = Object.keys(this.searchForm)
keys.forEach(item => {
this.searchForm[item] = ''
})
},
handleReset() { },
handleAdd(form) {
console.log(form)
this.$router.push({
name: 'editeCommodity',
params: form
name: 'editCommodity',
params: {
addOrEdit: 'add',
form: form
}
})
},
handleExport() { },
handleEdit(row) {
console.log(row)
this.$router.push({
name: 'editCommodity',
params: {
addOrEdit: 'edit',
row: row
}
})
},
handleDetail(row) {
this.detailData = row
this.detailData = _.cloneDeep(row)
this.detailVisible = true
},
handleDetailClose() {
......
<!-- 商品编辑 -->
<template>
<div class="edit-commodity">
<d2-form
v-if="show"
ref="d2Form"
:formItemWidth="formItemWidth"
:storeApi="commodityAddSeviceMerchant"
:rules="rules"
:addOrEdit="addOrEdit"
:originData="editData"
:formList="editForm"
@handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose"
></d2-form>
</div>
</template>
<script>
import { mapActions } from 'vuex'
import { commodityAddSeviceMerchant, getGoodsList, baseGoodsAdd, baseGoodsUpdate, getGoodsInfoById } from '@/api/commodity'
export default {
name: 'editCommodity',
data() {
return {
show: false,
commodityAddSeviceMerchant: commodityAddSeviceMerchant,
editData: {
goodsCode: '',
goodsName: '',
goodsTypeName: '',
spsx: '基础商品',
retailPrice: '',
upgradeGoods: [],
linkMerchantIds: []
},
formItemWidth: '200px',
rules: {
goodsCode: [{ required: true, message: '请选择商品名称', trigger: 'blur' }],
shopPrice: [{ required: true, message: '请输入到店价', trigger: 'blur' }],
linkMerchantIds: [{ required: true, message: '请选择关联门店', trigger: 'change' }]
},
editForm: [{
title: '商品基本信息',
formBlock: [{
name: 'goodsCode',
label: '商品名称',
isRequired: true,
type: 'select',
tips: '选择基础商品',
isClear: false,
optionList: [],
isDisabled: true,
optionId: 'goodsCode',
optionLabel: 'goodsName'
}, {
name: 'goodsTypeName',
label: '类别',
type: 'input',
isDisabled: true
}, {
name: 'spsx',
label: '商品属性',
type: 'input',
isDisabled: true
}, {
name: 'sapCode',
label: 'sap编号',
type: 'input',
isDisabled: true
}]
}, {
title: '价格信息',
formBlock: [{
name: 'retailPrice',
label: '商品零售价',
type: 'input',
unit: '元',
tips: '(前端展示给车主)'
}, {
name: 'shopPrice',
label: '到店价',
type: 'input',
unit: '元',
tips: '(商品最终交易价格)'
}, {
name: 'maxRetailDiscount',
label: '到店零售折扣',
type: 'input',
unit: '折'
}]
}, {
title: '关联升级商品信息',
formBlock: [{
name: 'upgradeGoods',
label: '关联升级商品',
type: 'relatePro',
optionValue: 'goodsCode'
}]
}, {
title: '关联门店信息',
formBlock: [{
name: 'linkMerchantIds',
label: '分配关联门店',
btnTxt: '点击选择关联门店',
type: 'button',
handleName: 'relateStore',
optionValue: 'merchantId'
}]
}]
}
},
mounted() {
this.show = false
// this.$route.params.row && (this.editData = _.cloneDeep(this.$route.params.row))
// console.log(this.editData)
// add - 新增;edit - 编辑
this.addOrEdit = this.$route.params.addOrEdit
if (this.addOrEdit === 'edit') {
getGoodsInfoById({ id: this.$route.params.row.id }).then(res => {
// console.log(res)
this.editForm[0].formBlock[0].isDisabled = true
this.editData = {
id: res.id,
goodsCode: res.goodsCode,
goodsName: res.goodsInfo.goodsName,
goodsTypeName: res.goodsInfo.goodsTypeName,
spsx: '基础商品',
retailPrice: res.retailPrice,
shopPrice: res.shopPrice,
upgradeGoods: res.upgradeGoodsList,
linkMerchantIds: res.merchantRefList.length ? res.merchantRefList.map(item => Object.assign(item, item.merchantInfo)) : []
}
console.log(this.editData)
this.$nextTick(() => {
this.show = true
})
})
} else {
this.editForm[0].formBlock[0].isDisabled = false
this.getGoodsList()
this.$nextTick(() => {
this.show = true
})
}
},
methods: {
...mapActions({ close: 'd2admin/page/close' }),
// ...mapActions('d2admin/page', ['close']),
getGoodsList() {
getGoodsList({}).then(res => {
// console.log(res)
this.editForm[0].formBlock[0].optionList = res
})
},
handleAddClose(isRefresh = false) {
this.$router.push({ name: 'commodity', params: isRefresh })
this.close({ tagName: '/editCommodity' })
},
handleAddConfirm(data) {
var upgradeGoodsAttr = ['goodsCode', 'shopPrice', 'maxUpgradeDiscount', 'upgradePrice', 'profitType', 'profitValue']
var params = {
goodsCode: data.goodsCode,
retailPrice: data.retailPrice,
maxRetailDiscount: data.maxRetailDiscount,
shopPrice: data.shopPrice,
upgradeGoods: data.upgradeGoods.length ? data.upgradeGoods.map(item => {
const tempVal = {}
upgradeGoodsAttr.forEach(i => {
tempVal[i] = item[i]
})
return {
...tempVal
}
}) : [],
linkMerchantIds: data.linkMerchantIds ? data.linkMerchantIds.map(item => String(item.merchantId)) : []
}
// console.log(_.cloneDeep(params))
if (this.addOrEdit === 'edit') {
params.id = data.id
baseGoodsUpdate(params).then(res => {
console.log(res)
this.notice.okTips()
this.handleAddClose()
})
} else {
baseGoodsAdd(params).then(res => {
console.log(res)
this.notice.okTips()
this.handleAddClose(true)
})
}
}
}
}
</script>
<style>
.d2-theme-container-main-body {
overflow: scroll;
}
.edit-commodity {
margin: 0 20px;
}
</style>
<!-- 商品编辑 -->
<template>
<div class="edite-commodity">
<d2-form
:formItemWidth="formItemWidth"
:rules="rules"
:formData="editData"
:formList="editForm"
></d2-form>
</div>
</template>
<script>
export default {
name: 'editeCommodity',
data() {
return {
editData: {
name: '',
type: '',
spsx: '基础商品',
lsj: ''
},
formItemWidth: '200px',
rules: {
name: [{ required: true, message: '请选择商品名称', trigger: 'blur' }],
ddj: [{ required: true, message: '请输入到店价', trigger: 'blur' }]
},
editForm: [{
title: '商品基本信息',
formBlock: [{
name: 'name',
label: '商品名称',
isRequired: true,
type: 'select',
tips: '选择基础商品',
isClear: true,
optionList: [{
confName: 'aa',
confId: 1
}],
optionValue: 'confId',
optionLabel: 'confName'
}, {
name: 'type',
label: '类别'
}, {
name: 'spsx',
label: '商品属性'
}, {
name: 'sap',
label: 'sap编号'
}]
}, {
title: '价格信息',
formBlock: [{
name: 'lsj',
label: '商品零售价',
type: 'input',
unit: '元',
tips: '(前端展示给车主)'
}, {
name: 'ddj',
label: '到店价',
type: 'input',
unit: '元',
tips: '(商品最终交易价格)'
}, {
name: 'lszk',
label: '到店零售折扣',
type: 'input',
unit: '折'
}]
}, {
title: '关联升级商品信息',
formBlock: [{
name: 'glsjsp',
label: '关联升级商品',
type: 'relatePro'
}]
}, {
title: '关联门店信息',
formBlock: [{
name: 'glmd',
label: '分配关联门店',
btnTxt: '点击选择关联门店',
type: 'button',
handleName: 'relateStore'
}]
}]
}
},
mounted() {
// this.editData = this.$route.params
console.log(this.editData)
},
methods: {}
}
</script>
<style scoped>
.edite-commodity {
margin: 0 20px;
}
</style>
......@@ -9,14 +9,14 @@
>
<el-form-item label="产品名称">
<el-input
v-model="searchForm.name"
v-model="searchForm.goodsName"
clearable
></el-input>
</el-form-item>
<el-form-item label="分类">
<el-select
v-model="searchForm.class1"
placeholder="请选择产品分类1"
v-model="searchForm.goodsType"
placeholder="请选择产品分类"
>
<el-option
v-for="item in baseData.product1"
......@@ -25,7 +25,7 @@
:value="item.confId"
></el-option>
</el-select>
<el-select
<!-- <el-select
v-model="searchForm.class2"
placeholder="请选择产品分类2"
>
......@@ -35,11 +35,11 @@
:label="item.confKey"
:value="item.confId"
></el-option>
</el-select>
</el-select> -->
</el-form-item>
<el-form-item label="品牌商">
<el-select
v-model="searchForm.brandName"
v-model="searchForm.brandMerchantCode"
placeholder="请选择品牌商"
>
<el-option
......@@ -83,40 +83,20 @@
slot-scope="scope"
:data="scope.scope"
></auth-button>
<!-- <el-button
v-else
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
type="text"
@click="handleUpOrDown"
>{{scope.scope.state ? '上架' : '下架'}}</el-button> -->
</d2-table>
<!-- <d2-dialog
title="关联门店信息"
:className="storeDetail"
:isVisible.sync="detailVisible"
@closeDialog="handleDetailClose"
>
<store-detail
:detail="detailData"
></store-detail>
</d2-dialog> -->
</d2-container>
</template>
<script>
import { getList } from '@api/product'
// import storeDetail from './storeDetail'
export default {
name: 'product',
data() {
return {
searchForm: {
name: '',
class1: '',
class2: '',
brandName: ''
goodsName: '',
goodsType: '',
brandMerchantCode: ''
},
editFormReset: {
aa: ''
......@@ -129,23 +109,23 @@ export default {
tableOption: true,
tableColumns: [{
label: '缩略图',
prop: 'img',
prop: 'thumbUrl',
addHtml: 'img'
}, {
label: '素材名称',
prop: 'name'
}, {
label: '商品ID',
prop: 'code'
prop: 'id'
}, {
label: '分类',
prop: 'class'
prop: 'goodsTypeName'
}, {
label: '品牌商',
prop: 'brandName'
prop: 'brandMerchantName'
}, {
label: '创建时间',
prop: 'createTime'
prop: 'createdDate'
}, {
label: '产品状态',
prop: 'state',
......@@ -174,10 +154,6 @@ export default {
}
},
components: {
// storeDetail
},
mounted() {
// console.log(storeDetail)
// var allOpt = { confId: '', confKey: '全部' }
......
......@@ -14,12 +14,12 @@
:src="item.img"
/>
<block>
<p>{{index + 1}}{{item.name}}</p>
<p><span class="txt-order">{{index + 1}}</span>{{item.merchantName}}</p>
<p>
<span class="txt-num">编号{{item.num}}</span>
<span>{{item.phone}}</span>
</p>
<p>{{item.addr}}</p>
<p>{{item.address}}</p>
</block>
</div>
</el-scrollbar>
......@@ -28,83 +28,86 @@
</template>
<script>
import { getMerchantList } from '@api/commodity'
export default {
name: 'storeDetail',
data() {
return {
detailArr: [{
name: '滴滴虎智慧门店',
img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
num: 'GLS001',
phone: '0775-12345678',
addr: '广东省深圳市南山区广东省深圳'
}, {
name: '滴滴虎智慧门店',
img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
num: 'GLS001',
phone: '0775-12345678',
addr: '广东省深圳市南山区广东省深圳'
}, {
name: '滴滴虎智慧门店',
img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
num: 'GLS001',
phone: '0775-12345678',
addr: '广东省深圳市南山区广东省深圳'
}, {
name: '滴滴虎智慧门店',
img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
num: 'GLS001',
phone: '0775-12345678',
addr: '广东省深圳市南山区广东省深圳'
}, {
name: '滴滴虎智慧门店',
img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
num: 'GLS001',
phone: '0775-12345678',
addr: '广东省深圳市南山区广东省深圳'
}, {
name: '滴滴虎智慧门店',
img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
num: 'GLS001',
phone: '0775-12345678',
addr: '广东省深圳市南山区广东省深圳'
}, {
name: '滴滴虎智慧门店',
img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
num: 'GLS001',
phone: '0775-12345678',
addr: '广东省深圳市南山区广东省深圳'
}, {
name: '滴滴虎智慧门店',
img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
num: 'GLS001',
phone: '0775-12345678',
addr: '广东省深圳市南山区广东省深圳'
}, {
name: '滴滴虎智慧门店',
img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
num: 'GLS001',
phone: '0775-12345678',
addr: '广东省深圳市南山区广东省深圳'
}, {
name: '滴滴虎智慧门店',
img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
num: 'GLS001',
phone: '0775-12345678',
addr: '广东省深圳市南山区广东省深圳'
}, {
name: '滴滴虎智慧门店',
img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
num: 'GLS001',
phone: '0775-12345678',
addr: '广东省深圳市南山区广东省深圳'
}, {
name: '滴滴虎智慧门店',
img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
num: 'GLS001',
phone: '0775-12345678',
addr: '广东省深圳市南山区广东省深圳'
}]
detailArr: [
// {
// name: '滴滴虎智慧门店',
// img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
// num: 'GLS001',
// phone: '0775-12345678',
// addr: '广东省深圳市南山区广东省深圳'
// }, {
// name: '滴滴虎智慧门店',
// img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
// num: 'GLS001',
// phone: '0775-12345678',
// addr: '广东省深圳市南山区广东省深圳'
// }, {
// name: '滴滴虎智慧门店',
// img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
// num: 'GLS001',
// phone: '0775-12345678',
// addr: '广东省深圳市南山区广东省深圳'
// }, {
// name: '滴滴虎智慧门店',
// img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
// num: 'GLS001',
// phone: '0775-12345678',
// addr: '广东省深圳市南山区广东省深圳'
// }, {
// name: '滴滴虎智慧门店',
// img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
// num: 'GLS001',
// phone: '0775-12345678',
// addr: '广东省深圳市南山区广东省深圳'
// }, {
// name: '滴滴虎智慧门店',
// img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
// num: 'GLS001',
// phone: '0775-12345678',
// addr: '广东省深圳市南山区广东省深圳'
// }, {
// name: '滴滴虎智慧门店',
// img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
// num: 'GLS001',
// phone: '0775-12345678',
// addr: '广东省深圳市南山区广东省深圳'
// }, {
// name: '滴滴虎智慧门店',
// img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
// num: 'GLS001',
// phone: '0775-12345678',
// addr: '广东省深圳市南山区广东省深圳'
// }, {
// name: '滴滴虎智慧门店',
// img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
// num: 'GLS001',
// phone: '0775-12345678',
// addr: '广东省深圳市南山区广东省深圳'
// }, {
// name: '滴滴虎智慧门店',
// img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
// num: 'GLS001',
// phone: '0775-12345678',
// addr: '广东省深圳市南山区广东省深圳'
// }, {
// name: '滴滴虎智慧门店',
// img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
// num: 'GLS001',
// phone: '0775-12345678',
// addr: '广东省深圳市南山区广东省深圳'
// }, {
// name: '滴滴虎智慧门店',
// img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg',
// num: 'GLS001',
// phone: '0775-12345678',
// addr: '广东省深圳市南山区广东省深圳'
// }
]
}
},
......@@ -116,9 +119,23 @@ export default {
},
mounted() {
// console.log(this.detailData)
this.getMerchantList()
},
methods: {}
methods: {
getMerchantList() {
this.detailArr = []
getMerchantList({
baseGoodsId: this.detailData.id
}).then(res => {
// console.log(res)
res.forEach(item => {
this.detailArr.push(item.merchantInfo)
})
})
}
}
}
</script>
......@@ -131,6 +148,16 @@ export default {
width: 86%;
height: 540px;
}
.storeDetail .txt-order {
display: inline-block;
width: 18px;
height: 18px;
line-height: 18px;
border: 1px solid #999999;
border-radius: 50%;
text-align: center;
margin-right: 8px;
}
.el-scrollbar {
height: 100%;
}
......
......@@ -15,8 +15,8 @@
class="reg-dialog-form"
:rules="rules"
>
<el-form-item label="用户名:" prop="loginName">
<el-input v-model="regForm.loginName" requred maxlength="10" clearable placeholder="请输入用户名" :show-word-limit="true"></el-input>
<el-form-item label="用户名:" prop="userName">
<el-input v-model="regForm.userName" requred maxlength="10" clearable placeholder="请输入用户名" :show-word-limit="true"></el-input>
</el-form-item>
<el-form-item label="密码:" prop="password">
<el-input type="password" v-model="regForm.password" placeholder="请输入密码" clearable maxlength="12" :show-word-limit="true" :show-password="true"></el-input>
......@@ -52,12 +52,12 @@ export default {
return {
company: [],
regForm: {
loginName: '',
userName: '',
password: '',
confirm: ''
},
rules: Object.freeze({
loginName: [
userName: [
{ required: true, message: '用户名不能为空', trigger: ['blur'] }
],
password: [
......@@ -89,9 +89,9 @@ export default {
trigger: 'blur'
}
],
userName: [
{ required: true, message: '姓名不能为空', trigger: ['blur'] }
],
// userName: [
// { required: true, message: '姓名不能为空', trigger: ['blur'] }
// ],
mobile: [
{ required: true,
validator: (rule, value, callback) => {
......
......@@ -40,11 +40,11 @@
<span class="form-sub">{{systemSubName}}</span>
</div>
<div class="input-wrap">
<el-form-item prop="loginName">
<el-form-item prop="userName">
<el-input
type="text"
v-on:keyup.native.13="submit"
v-model="formLogin.loginName"
v-model="formLogin.userName"
placeholder="请输入用户名"
clearable
maxlength="10"
......@@ -121,17 +121,16 @@ export default {
time: dayjs().format('HH:mm:ss'),
// 表单
formLogin: {
loginName: '',
password: ''
userName: 'dongdao',
password: '123456'
},
// 表单校验
rules: Object.freeze({
loginName: [{
userName: [{
required: true,
message: '请输入用户名',
trigger: 'submit'
}
],
}],
password: [{
required: true,
message: '请输入密码',
......
<!-- 个人信息 -->
<template>
<div></div>
<d2-container class="personalInfo">
<p class="title">个人信息</p>
<el-form>
<el-form-item
v-for="(item, index) in formList"
:key="index"
:label="item.label"
label-width="100px"
>
<template v-if="item.type === 'photo'">
<img
v-for="(subItem, subIndex) in formData[item.name]"
:key="subIndex"
:src="subItem"
/>
</template>
<template v-else-if="Array.isArray(formData[item.name])">
<el-tag
class="tag"
type="warning"
v-for="(subItem, subIndex) in formData[item.name]"
:key="subIndex"
>{{item.attrName ? subItem.brandName : subItem}}</el-tag>
</template>
<span v-else-if="item.parentName">{{formData[item.parentName][item.name]}}</span>
<span v-else>{{formData[item.name]}}</span>
</el-form-item>
<el-form-item label=" ">
修改个人信息请到嘀加平台修改,点击快速修改<a
class="info-link"
href="http://dj.glsx.com.cn/web-dj-site/#/system/personallnfo"
target="_blank"
>http://dj.glsx.com.cn/web-dj-site/#/system/personallnfo</a>
</el-form-item>
</el-form>
</d2-container>
</template>
<script>
import { getUserInfo } from '@api/personalInfo'
export default {
name: 'personalInfo',
data() {
return {
formData: {},
formList: [{
name: 'accountName',
label: '登录账户'
}, {
name: 'loginPhone',
label: '登陆手机号'
}, {
name: 'merchantId',
label: '商户号'
}, {
name: 'merchantName',
label: '商户全称'
}, {
name: 'shortName',
label: '商户简称'
}, {
name: 'userType',
label: '商户分类'
}, {
name: 'address',
label: '商户地址'
}, {
name: 'phone',
label: '商户电话'
}, {
name: 'businessHours',
label: '营业时间'
}, {
name: 'shopMedias',
label: '门店照片',
type: 'photo'
}, {
name: 'carBrandList',
label: '主营品牌',
attrName: 'brandName'
}, {
name: 'mainBusiness',
label: '营业范围'
}, {
parentName: 'role',
name: 'name',
label: '角色权限'
}]
}
},
components: {},
computed: {},
mounted() {},
mounted() {
getUserInfo({}).then(res => {
this.formData = res.detail
})
},
methods: {}
}
</script>
<style scoped>
<style>
.personalInfo .title {
font-size: 22px;
color: #666666;
letter-spacing: 1.38px;
}
.personalInfo .info-img {
width: 85px;
height: 85px;
border-radius: 10px;
}
.personalInfo .tag {
margin-right: 10px;
color: #333333;
/* width: 20px;
height: 20px;
font-size: 14px;
color: #333333;
background: #fff8ef;
border: 1px solid #ffdfb8;
border-radius: 6px; */
}
.personalInfo .info-link {
color: #003a00;
cursor: pointer;
}
</style>
......@@ -9,7 +9,7 @@
>
<el-form-item label="商品名称">
<el-input
v-model="searchForm.name"
v-model="searchForm.merchantName"
clearable
></el-input>
</el-form-item>
......@@ -23,10 +23,7 @@
</el-form-item>
</el-form>
<d2-table-header>
<auth-button
category="Button"
:data="editFormReset"
></auth-button>
<auth-button category="Button"></auth-button>
</d2-table-header>
<d2-table
ref="serviceStoreTable"
......@@ -45,19 +42,13 @@
</template>
<script>
import { getList } from '@api/serviceStore'
import { getList, deleteMerchant } from '@api/serviceStore'
export default {
name: 'serviceStore',
data() {
return {
searchForm: {
name: '',
class1: '',
class2: '',
brandName: ''
},
editFormReset: {
aa: ''
merchantName: ''
},
getListApi: getList,
// 表格参数
......@@ -66,61 +57,45 @@ export default {
listName: 'list',
tableOption: true,
tableColumns: [{
label: '用户ID',
prop: 'userId'
}, {
label: '登录账户',
prop: 'loginName'
prop: 'accountName'
}, {
label: '商户号',
prop: 'merchant'
prop: 'merchantId'
}, {
label: '商户名称',
prop: 'merchantName'
}, {
label: '商户简称',
prop: 'merchantAbbreviation'
prop: 'shortName'
}, {
label: '商户类型',
prop: 'merchantType'
prop: 'userType'
}, {
label: '联系人',
prop: 'contacts'
prop: 'contactName'
}, {
label: '手机号',
prop: 'phone'
}, {
label: '角色权限',
prop: 'role'
}, {
label: '商户地址',
prop: 'address',
width:'200'
}, {
label: '上级商户号',
prop: 'superMerchant'
}, {
label: '上级商户名称',
prop: 'superMerchantName'
width: '200'
}, {
label: '更新时间',
prop: 'updateTime'
prop: 'updatedDate'
}, {
label: '渠道',
prop: 'channelType'
}]
},
}
}
},
components: {
// storeDetail
},
mounted() {
// console.log(storeDetail)
// var allOpt = { confId: '', confKey: '全部' }
// this.baseData.product.unshift(allOpt)
// this.baseData.brandList.unshift(allOpt)
},
mounted() { },
methods: {
beforeSearchFn() {
......@@ -136,9 +111,6 @@ export default {
handleAdd(form) {
console.log(form)
},
handleAdd(row) {
console.log(row)
},
handleDelete(row) {
console.log(row)
this.$confirm('是否要进行删除操作?', '提示', {
......@@ -146,18 +118,17 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
deleteMerchant({ id: row.id }).then(res => {
this.notice.okTips()
this.$refs.serviceStoreTable.refreshTable()
})
}).catch(err => {
console.log(err)
})
},
}
}
}
</script>
<style scoped>
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!