Commit d851c946 by chenwq

bug修复,common包来源修改

1 parent cd638a04
...@@ -9,16 +9,16 @@ ...@@ -9,16 +9,16 @@
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js') // let request = require('@/http/request.js')
let cfg = require('./conf.js') let cfg = require('./conf.js')
import { Http, utils } from 'glsx-common' // import { Http, utils } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) { export const fetchConfig = function(isEnv = true, common) {
// if (isEnv) { // if (isEnv) {
// let { request } = cfg // let { request } = cfg
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
// return Promise.resolve(cfg) // return Promise.resolve(cfg)
let params = { moduleName: 'commodity', mockUrl: 'http://oss-config.dev.glsx.com.cn/mock/64489a52ad0aa72e7cd2bd3d/commodity/config', env: 'test', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } } let params = { moduleName: 'commodity', mockUrl: 'http://oss-config.dev.glsx.com.cn/mock/64489a52ad0aa72e7cd2bd3d/commodity/config', env: 'test', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
return utils.getConfig(params) return common.utils.getConfig(params)
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config') // return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config')
// return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('http://config-center-backend.test.glsx.com/glsxAdmin/config?moduleUrl=home').then(res => res) // return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('http://config-center-backend.test.glsx.com/glsxAdmin/config?moduleUrl=home').then(res => res)
} }
......
...@@ -14,7 +14,7 @@ Vue.use(GLTable) ...@@ -14,7 +14,7 @@ Vue.use(GLTable)
Vue.use(GLTableButton) Vue.use(GLTableButton)
Vue.use(GLDialog) Vue.use(GLDialog)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret, sign_common, request_common } = await fetchConfig() const { response, request, sign, secret, sign_common, request_common } = await fetchConfig(false, common)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
......
...@@ -134,6 +134,7 @@ export default { ...@@ -134,6 +134,7 @@ export default {
}, },
mounted() { mounted() {
this.keyDown()
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
this.routeInfo.editType != 'add' ? this.getInfo() : '' this.routeInfo.editType != 'add' ? this.getInfo() : ''
this.$utils.getOptionsList(this, 'editFormData', false) this.$utils.getOptionsList(this, 'editFormData', false)
...@@ -142,6 +143,17 @@ export default { ...@@ -142,6 +143,17 @@ export default {
}, },
methods: { methods: {
keyDown() {
document.onkeydown = function () {
var evt = window.event || arguments[0]
if (evt && evt.keyCode == 13) {
if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true
if (typeof evt.stopPropagation == 'function') evt.stopPropagation()
return false
}
return true
}
},
getInfo() { getInfo() {
let params = { let params = {
upgradeGoodsId: this.routeInfo.info.upgradeGoodsId upgradeGoodsId: this.routeInfo.info.upgradeGoodsId
...@@ -160,7 +172,7 @@ export default { ...@@ -160,7 +172,7 @@ export default {
}, },
validateProduct(goodsCode) { validateProduct(goodsCode) {
let isFlag = goodsCode != '太阳膜' let isFlag = goodsCode != '太阳膜'
let AttrList = isFlag ? ['售价/元', '最低售价/元', '产品成本/元'] : ['产品类型','质保年限'] let AttrList = isFlag ? ['售价/元', '最低售价/元', '产品成本/元'] : ['产品类型', '质保年限']
this.changeFormAttr('editFormData', 'isHide', AttrList, false) this.changeFormAttr('editFormData', 'isHide', AttrList, false)
if (!isFlag) if (!isFlag)
return (val, attr) => { return (val, attr) => {
...@@ -199,8 +211,8 @@ export default { ...@@ -199,8 +211,8 @@ export default {
minSellPrice: '', minSellPrice: '',
productCost: '', productCost: '',
warningValue: '', warningValue: '',
giftCost:'', giftCost: '',
warrantyPeriod:'' warrantyPeriod: ''
} }
}, },
changeFormAttr(formName, attrName, labelList, attrValue) { changeFormAttr(formName, attrName, labelList, attrValue) {
...@@ -279,7 +291,7 @@ export default { ...@@ -279,7 +291,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => {}) .catch(() => { })
} else { } else {
this.cancelJump() this.cancelJump()
} }
......
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
}, },
{ {
label: '所属系列', label: '所属系列',
prop: 'goodsCode', prop: 'goodsCodeName',
width: '100' width: '100'
}, },
{ {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!