You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
3.3 KiB
110 lines
3.3 KiB
import Vue from 'vue'
|
|
import App from './App'
|
|
import store from './store'
|
|
import request from './common/request.js'
|
|
import url from './common/config.js'
|
|
import modelConfig from './common/modelConfig.js'
|
|
import utils from './common/utils.js'
|
|
// import message from "@/common/message";
|
|
import axios from 'axios';
|
|
let startApp = function() {
|
|
console.log('startApp', 'startApp')
|
|
uni.request({
|
|
url: './static/config.json'
|
|
}).then(res => {
|
|
//在配置中读url,company等信息
|
|
Vue.prototype.$dev_url = res[1].data.params.dev;
|
|
Vue.prototype.$companyCode = res[1].data.params.companyCode;
|
|
Vue.prototype.$warehouseCode = res[1].data.params.warehouseCode;
|
|
Vue.prototype.$putawayLocationTypes = res[1].data.params.putawayLocationTypes; //创建上架任务的库存类型
|
|
Vue.prototype.$putawayInventoryStatus = res[1].data.params.putawayInventoryStatus; //创建上架任务的库存状态
|
|
Vue.prototype.$print_url = res[1].data.params.print_url; //打印的服务地址
|
|
Vue.prototype.$isScrapScanToLocation = res[1].data.params.isScrapScanToLocation; //原料报废是否显示库位
|
|
Vue.prototype.$isReceiptToday = res[1].data.params.isReceiptToday; //采购收货是否只看今天的采购任务
|
|
|
|
Vue.prototype.$scrapReason = res[1].data.params.scrapReason; //原料报废原因字典项
|
|
Vue.prototype.$purchaseReturnReason = res[1].data.params.purchaseReturnReason; //采购退货原因字典项
|
|
Vue.prototype.$returnBeforPutawayReason = res[1].data.params.returnBeforPutawayReason; //上架前退货原因字典项
|
|
Vue.prototype.$receiptCheckReason = res[1].data.params.receiptCheckReason; //采购收货不合格原因字典项
|
|
|
|
Vue.prototype.$configList = res[1].data.configList;
|
|
getApp().globalData.text = res[1].data.params.version_update_url;
|
|
|
|
})
|
|
}
|
|
startApp()
|
|
import VueAxios from 'vue-axios';
|
|
import './router/index'; //引入拦截
|
|
// import './router/router.js';
|
|
import barcode from 'vue-barcode';
|
|
import {
|
|
RouterMount
|
|
} from "uni-simple-router";
|
|
|
|
Vue.use(barcode)
|
|
Vue.use(VueAxios, axios)
|
|
|
|
Vue.prototype.$request = request
|
|
Vue.prototype.$url = url.url_config
|
|
Vue.prototype.modelConfig = modelConfig.maxPageSize
|
|
Vue.prototype.utils = utils;
|
|
|
|
Vue.config.productionTip = false
|
|
Vue.prototype.$store = store
|
|
|
|
Vue.prototype.ScanErrorAudio = function() {
|
|
var music = null;
|
|
music = uni.createInnerAudioContext(); //创建播放器对象
|
|
music.src ="../../static/video/error.wav";
|
|
music.play(); //执行播放
|
|
music.onEnded(() => {
|
|
//播放结束
|
|
music = null;
|
|
});
|
|
}
|
|
|
|
// // 添加全局v-focus指令
|
|
// Vue.directive("focus", {
|
|
// inserted: function(el, {
|
|
// modifiers: {
|
|
// noKeyboard
|
|
// }
|
|
// }) {
|
|
// try {
|
|
// const tagName = el.tagName;
|
|
// console.log('el',el)
|
|
// console.log('tagName',tagName)
|
|
// if (tagName === "INPUT") {
|
|
// let child = el.children[0];
|
|
// if (child && child.tagName === "INPUT") {
|
|
// el = child;
|
|
// }
|
|
// }
|
|
// el.focus();
|
|
// // 不弹起软键盘
|
|
// if (noKeyboard) {
|
|
// el.setAttribute("readonly", "readonly");
|
|
// var timer = null;
|
|
// timer = setTimeout(() => {
|
|
// el.removeAttribute("readonly");
|
|
// clearTimeout(timer);
|
|
// }, 100);
|
|
// }
|
|
// } catch (error) {
|
|
// throw new Error(error);
|
|
// }
|
|
// }
|
|
// });
|
|
|
|
|
|
App.mpType = 'app'
|
|
|
|
//#ifdef H5
|
|
RouterMount(app, "#app");
|
|
//#endif
|
|
|
|
const app = new Vue({
|
|
store,
|
|
...App
|
|
})
|
|
app.$mount()
|
|
|