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