|
|
@ -6,31 +6,6 @@ import url from './common/config.js' |
|
|
|
import modelConfig from './common/modelConfig.js' |
|
|
|
import utils from './common/utils.js' |
|
|
|
import uView from "./uni_modules/uview-ui"; |
|
|
|
import config from "./static/config.js" |
|
|
|
|
|
|
|
let initData =function(){ |
|
|
|
Vue.prototype.$dev_url = config.params.dev; |
|
|
|
console.log("请求地址11",Vue.prototype.$dev_url) |
|
|
|
Vue.prototype.$companyCode = config.params.companyCode; |
|
|
|
Vue.prototype.$warehouseCode = config.params.warehouseCode; |
|
|
|
Vue.prototype.$putawayLocationTypes = config.params.putawayLocationTypes; //创建上架任务的库存类型
|
|
|
|
Vue.prototype.$putawayInventoryStatus = config.params.putawayInventoryStatus; //创建上架任务的库存状态
|
|
|
|
Vue.prototype.$print_url = config.params.print_url; //打印的服务地址
|
|
|
|
Vue.prototype.$isScrapScanToLocation = config.params.isScrapScanToLocation; //原料报废是否显示库位
|
|
|
|
Vue.prototype.$isReceiptToday = config.params.isReceiptToday; //采购收货是否只看今天的采购任务
|
|
|
|
|
|
|
|
Vue.prototype.$scrapReason = config.params.scrapReason; //原料报废原因字典项
|
|
|
|
Vue.prototype.$purchaseReturnReason = config.params.purchaseReturnReason; //采购退货原因字典项
|
|
|
|
Vue.prototype.$returnBeforPutawayReason = config.params.returnBeforPutawayReason; //上架前退货原因字典项
|
|
|
|
Vue.prototype.$receiptCheckReason = config.params.receiptCheckReason; //采购收货不合格原因字典项
|
|
|
|
|
|
|
|
Vue.prototype.$configList = config.configList; |
|
|
|
// getApp().globalData.text = config.params.version_update_url;
|
|
|
|
} |
|
|
|
|
|
|
|
initData() |
|
|
|
// import message from "@/common/message";
|
|
|
|
import axios from 'axios'; |
|
|
|
|
|
|
|
import VueAxios from 'vue-axios'; |
|
|
|
import './router/index'; //引入拦截
|
|
|
@ -39,73 +14,106 @@ import barcode from 'vue-barcode'; |
|
|
|
import { |
|
|
|
RouterMount |
|
|
|
} from "uni-simple-router"; |
|
|
|
// import message from "@/common/message";
|
|
|
|
import axios from 'axios'; |
|
|
|
|
|
|
|
Vue.use(barcode) |
|
|
|
Vue.use(VueAxios, axios) |
|
|
|
Vue.use(uView); |
|
|
|
let startApp = function() { |
|
|
|
console.log('startApp', 'startApp') |
|
|
|
uni.request({ |
|
|
|
url: `./static/config.json?t=${new Date().getTime()}` |
|
|
|
}).then(res => { |
|
|
|
//在配置中读url,company等信息
|
|
|
|
Vue.prototype.$dev_url = res[1].data.params.dev; |
|
|
|
console.log("请求地址", Vue.prototype.$dev_url) |
|
|
|
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.$request = request |
|
|
|
Vue.prototype.$url = url.url_config |
|
|
|
Vue.prototype.modelConfig = modelConfig.maxPageSize |
|
|
|
Vue.prototype.versionCode = modelConfig.version |
|
|
|
Vue.prototype.utils = utils; |
|
|
|
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.config.productionTip = false |
|
|
|
Vue.prototype.$store = store |
|
|
|
Vue.prototype.$configList = res[1].data.configList; |
|
|
|
initData() |
|
|
|
getApp().globalData.text = res[1].data.params.version_update_url; |
|
|
|
|
|
|
|
Vue.prototype.ScanErrorAudio = function() { |
|
|
|
var music = null; |
|
|
|
music = uni.createInnerAudioContext(); //创建播放器对象
|
|
|
|
music.src ="../../static/video/error.wav"; |
|
|
|
music.play(); //执行播放
|
|
|
|
music.onEnded(() => { |
|
|
|
//播放结束
|
|
|
|
music = null; |
|
|
|
}); |
|
|
|
}) |
|
|
|
} |
|
|
|
startApp() |
|
|
|
|
|
|
|
function initData() { |
|
|
|
Vue.use(barcode) |
|
|
|
Vue.use(VueAxios, axios) |
|
|
|
Vue.use(uView); |
|
|
|
|
|
|
|
Vue.prototype.$request = request |
|
|
|
Vue.prototype.$url = url.url_config |
|
|
|
Vue.prototype.modelConfig = modelConfig.maxPageSize |
|
|
|
Vue.prototype.versionCode = modelConfig.version |
|
|
|
Vue.prototype.utils = utils; |
|
|
|
|
|
|
|
// // 添加全局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);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
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; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
App.mpType = 'app' |
|
|
|
// // 添加全局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);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
|
|
|
|
//#ifdef H5
|
|
|
|
RouterMount(app, "#app"); |
|
|
|
//#endif
|
|
|
|
|
|
|
|
const app = new Vue({ |
|
|
|
store, |
|
|
|
...App |
|
|
|
}) |
|
|
|
app.$mount() |
|
|
|
App.mpType = 'app' |
|
|
|
|
|
|
|
//#ifdef H5
|
|
|
|
RouterMount(app, "#app"); |
|
|
|
//#endif
|
|
|
|
|
|
|
|
const app = new Vue({ |
|
|
|
store, |
|
|
|
...App |
|
|
|
}) |
|
|
|
app.$mount() |
|
|
|
} |
|
|
|