配料功能完成
This commit is contained in:
parent
f40021e8f8
commit
2a7124d40d
5
App.vue
5
App.vue
@ -12,7 +12,7 @@ export default {
|
|||||||
initApp() {
|
initApp() {
|
||||||
// 初始化应用配置
|
// 初始化应用配置
|
||||||
this.initConfig();
|
this.initConfig();
|
||||||
// 检查用户登录状态
|
// 检查用户登录状态(H5 debug跳过)
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
this.checkLogin();
|
this.checkLogin();
|
||||||
//#endif
|
//#endif
|
||||||
@ -31,4 +31,7 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import '@/static/scss/index.scss';
|
@import '@/static/scss/index.scss';
|
||||||
|
.border {
|
||||||
|
border: 1px solid #000000;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
46
api/preparationTask/index.js
Normal file
46
api/preparationTask/index.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获取全部线
|
||||||
|
export function getLineOptions(params) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/Mobile/PreparationTask/get_lines',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据线获取工单
|
||||||
|
export function getWorkOrderList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/Mobile/PreparationTask/get_workorder',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据工单获取任务
|
||||||
|
export function getWorkOrderTaskList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/Mobile/PreparationTask/get_workorder_task',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取任务详情
|
||||||
|
export function getTaskInfoList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/Mobile/PreparationTask/get_task_info',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 任务生成
|
||||||
|
export function generateIngredientTask(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/Mobile/PreparationTask/generate_ingredient_task',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
10
api/scan/index.js
Normal file
10
api/scan/index.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 解析标签信息
|
||||||
|
export function analysisScanCode(params) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/Mobile/PreparationTask/parse_material_code',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
62
components/scan-input/scan-input.vue
Normal file
62
components/scan-input/scan-input.vue
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<template>
|
||||||
|
<view class="sacn-box">
|
||||||
|
<!-- inputmode="none" -->
|
||||||
|
<input class="uni-input scan-border" v-model="scanValue" :maxlength="-1" :focus="focus" placeholder="请扫码" @input="onKeyInput" @confirm="inputConfirm" />
|
||||||
|
<!-- <uni-icons type="scan" size="32" color="#b9b9b9" @click="getFocus"></uni-icons> -->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'scan-input',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
focus: true,
|
||||||
|
scanValue: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onKeyInput: function (event) {
|
||||||
|
this.scanValue = event.target.value;
|
||||||
|
},
|
||||||
|
emitValue() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$emit('scanConfirm', this.scanValue);
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scanValue = '';
|
||||||
|
}, 500);
|
||||||
|
this.getFocus();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
inputConfirm() {
|
||||||
|
this.emitValue();
|
||||||
|
},
|
||||||
|
// 重置焦点
|
||||||
|
getFocus() {
|
||||||
|
// 重置焦点
|
||||||
|
this.focus = false;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.focus = true;
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.sacn-box {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-item: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.uni-input {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
.scan-border {
|
||||||
|
border-radis: 10%;
|
||||||
|
border: 1px solid #b9b9b9;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
11
main.js
11
main.js
@ -3,11 +3,20 @@ import App from './App'
|
|||||||
import store from './store' // store
|
import store from './store' // store
|
||||||
import plugins from './plugins' // plugins
|
import plugins from './plugins' // plugins
|
||||||
import './permission' // permission
|
import './permission' // permission
|
||||||
|
|
||||||
|
// dayjs
|
||||||
|
|
||||||
|
import dayjs from 'dayjs'
|
||||||
|
|
||||||
|
// 插件安装
|
||||||
|
import scanInputVue from './components/scan-input/scan-input.vue'
|
||||||
|
Vue.component('ScanInput', scanInputVue)
|
||||||
|
|
||||||
Vue.use(plugins)
|
Vue.use(plugins)
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
Vue.prototype.$store = store
|
Vue.prototype.$store = store
|
||||||
|
Vue.prototype.$dayjs = dayjs
|
||||||
App.mpType = 'app'
|
App.mpType = 'app'
|
||||||
|
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
|
|||||||
5
package.json
Normal file
5
package.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"dayjs": "^1.11.13"
|
||||||
|
}
|
||||||
|
}
|
||||||
51
pages.json
51
pages.json
@ -2,7 +2,8 @@
|
|||||||
"pages": [{
|
"pages": [{
|
||||||
"path": "pages/login",
|
"path": "pages/login",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "登录"
|
"navigationBarTitleText": "登录",
|
||||||
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/register",
|
"path": "pages/register",
|
||||||
@ -12,18 +13,18 @@
|
|||||||
}, {
|
}, {
|
||||||
"path": "pages/index",
|
"path": "pages/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "首页",
|
"navigationBarTitleText": "首页"
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/work/index",
|
"path": "pages/work/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "工作台"
|
"navigationBarTitleText": "功能"
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/mine/index",
|
"path": "pages/mine/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的"
|
"navigationBarTitleText": "我的",
|
||||||
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/mine/avatar/index",
|
"path": "pages/mine/avatar/index",
|
||||||
@ -70,10 +71,38 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "浏览文本"
|
"navigationBarTitleText": "浏览文本"
|
||||||
}
|
}
|
||||||
}],
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/materialManagement/materialPreparation/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "备料管理"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/materialManagement/materialPreparation/batching",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "配料任务"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/materialManagement/materialPreparation/taskDetail",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "任务详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/materialManagement/materialPreparation/scanAddBatching",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "扫码配料"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
"color": "#000000",
|
"color": "#000000",
|
||||||
"selectedColor": "#000000",
|
"selectedColor": "#2979ff",
|
||||||
"borderStyle": "white",
|
"borderStyle": "white",
|
||||||
"backgroundColor": "#ffffff",
|
"backgroundColor": "#ffffff",
|
||||||
"list": [{
|
"list": [{
|
||||||
@ -85,7 +114,7 @@
|
|||||||
"pagePath": "pages/work/index",
|
"pagePath": "pages/work/index",
|
||||||
"iconPath": "static/images/tabbar/work.png",
|
"iconPath": "static/images/tabbar/work.png",
|
||||||
"selectedIconPath": "static/images/tabbar/work_.png",
|
"selectedIconPath": "static/images/tabbar/work_.png",
|
||||||
"text": "工作台"
|
"text": "功能"
|
||||||
}, {
|
}, {
|
||||||
"pagePath": "pages/mine/index",
|
"pagePath": "pages/mine/index",
|
||||||
"iconPath": "static/images/tabbar/mine.png",
|
"iconPath": "static/images/tabbar/mine.png",
|
||||||
@ -94,8 +123,8 @@
|
|||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarTitleText": "RuoYi",
|
"navigationBarTitleText": "首页",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
"navigationBarBackgroundColor": "#2979ff"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,43 +1,59 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<image class="logo" src="@/static/logo.png"></image>
|
<div class="scan-row">
|
||||||
<view class="text-area">
|
<ScanInput @scanConfirm="scanConfirm"></ScanInput>
|
||||||
<text class="title">Hello RuoYi</text>
|
</div>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
import { analysisScanCode } from '@/api/scan/index';
|
||||||
onLoad: function() {
|
export default {
|
||||||
|
onLoad: function () {},
|
||||||
|
onShow() {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dateTime: this.$dayjs(),
|
||||||
|
value: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
scanConfirm(val) {
|
||||||
|
analysisScanCode({ materialCode: val }).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
console.log(res.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
margin-top: 200rpx;
|
margin-top: 200rpx;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
margin-bottom: 50rpx;
|
margin-bottom: 50rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-area {
|
.text-area {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
color: #8f8f94;
|
color: #8f8f94;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -20,28 +20,34 @@
|
|||||||
<image :src="codeUrl" @click="getCode" class="login-code-img"></image>
|
<image :src="codeUrl" @click="getCode" class="login-code-img"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 后台地址 -->
|
||||||
|
<view class="input-item flex align-center">
|
||||||
|
<view class="iconfont icon-setting icon"></view>
|
||||||
|
<input v-model="baseUrl" class="input" type="text" placeholder="请输入服务地址" maxlength="255" @confirm="handlerBaseUrlConfirm" />
|
||||||
|
</view>
|
||||||
<view class="action-btn">
|
<view class="action-btn">
|
||||||
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
|
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="reg text-center" v-if="register">
|
<!-- <view class="reg text-center" v-if="register">
|
||||||
<text class="text-grey1">没有账号?</text>
|
<text class="text-grey1">没有账号?</text>
|
||||||
<!-- <text @click="handleUserRegister" class="text-blue">立即注册</text> -->
|
<text @click="handleUserRegister" class="text-blue">立即注册</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="xieyi text-center">
|
<view class="xieyi text-center">
|
||||||
<text class="text-grey1">登录即代表同意</text>
|
<text class="text-grey1">登录即代表同意</text>
|
||||||
<!-- <text @click="handleUserAgrement" class="text-blue">《用户协议》</text>
|
<text @click="handleUserAgrement" class="text-blue">《用户协议》</text>
|
||||||
<text @click="handlePrivacy" class="text-blue">《隐私协议》</text> -->
|
<text @click="handlePrivacy" class="text-blue">《隐私协议》</text>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getCodeImg } from '@/api/login';
|
import { getCodeImg } from '@/api/login';
|
||||||
|
import { getBaseUrl, setBaseUrl, removeBaseUrl } from '@/utils/baseUrl';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
baseUrl: '',
|
||||||
codeUrl: '',
|
codeUrl: '',
|
||||||
captchaEnabled: true,
|
captchaEnabled: true,
|
||||||
// 用户注册开关
|
// 用户注册开关
|
||||||
@ -56,9 +62,20 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.init();
|
||||||
this.getCode();
|
this.getCode();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
init() {
|
||||||
|
// 初始化链接地址设计
|
||||||
|
let _baseUrl = getBaseUrl();
|
||||||
|
if (!_baseUrl) {
|
||||||
|
// _baseUrl = '192.168.0.58:7000';
|
||||||
|
_baseUrl = '192.168.50.163:7000';
|
||||||
|
setBaseUrl(_baseUrl);
|
||||||
|
}
|
||||||
|
this.baseUrl = _baseUrl;
|
||||||
|
},
|
||||||
// 用户注册
|
// 用户注册
|
||||||
handleUserRegister() {
|
handleUserRegister() {
|
||||||
this.$tab.redirectTo(`/pages/register`);
|
this.$tab.redirectTo(`/pages/register`);
|
||||||
@ -75,7 +92,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取图形验证码
|
// 获取图形验证码
|
||||||
getCode() {
|
getCode() {
|
||||||
this.captchaEnabled = false
|
this.captchaEnabled = false;
|
||||||
// getCodeImg().then((res) => {
|
// getCodeImg().then((res) => {
|
||||||
// this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
|
// this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
|
||||||
// if (this.captchaEnabled) {
|
// if (this.captchaEnabled) {
|
||||||
@ -117,6 +134,16 @@ export default {
|
|||||||
this.$store.dispatch('GetInfo').then((res) => {
|
this.$store.dispatch('GetInfo').then((res) => {
|
||||||
this.$tab.reLaunch('/pages/index');
|
this.$tab.reLaunch('/pages/index');
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
// 确认修改链接地址
|
||||||
|
handlerBaseUrlConfirm() {
|
||||||
|
const _baseUrl = this.baseUrl;
|
||||||
|
// console.log('changeBaseUrl', baseUrl);
|
||||||
|
uni.showToast({
|
||||||
|
title: '链接地址已修改:' + _baseUrl,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
setBaseUrl(_baseUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
84
pages/materialManagement/materialPreparation/batching.vue
Normal file
84
pages/materialManagement/materialPreparation/batching.vue
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 配料任务 -->
|
||||||
|
<view>
|
||||||
|
<uni-card :title="title">
|
||||||
|
<text>{{ note }}</text>
|
||||||
|
</uni-card>
|
||||||
|
<uni-list style="width: 100%">
|
||||||
|
<uni-list-item v-for="(item, index) in workOrderTaskList" :key="index" :title="item.title" link rightText="任务详情" @click="onListItemClick(item)"></uni-list-item>
|
||||||
|
</uni-list>
|
||||||
|
<view>
|
||||||
|
<button type="primary" @click="toScanBatching">扫码配料</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getWorkOrderTaskList, getTaskInfoList } from '@/api/preparationTask/index.js';
|
||||||
|
import { tansParams } from '@/utils/common';
|
||||||
|
export default {
|
||||||
|
onLoad: function (option) {
|
||||||
|
this.workOrder = option.workOrder;
|
||||||
|
this.title = option.title;
|
||||||
|
this.note = option.note;
|
||||||
|
},
|
||||||
|
onShow:function(){
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.doGetWorkOrderTaskList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '',
|
||||||
|
note: '',
|
||||||
|
workOrder: '',
|
||||||
|
workOrderTaskList: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
doGetWorkOrderTaskList() {
|
||||||
|
uni.showLoading();
|
||||||
|
const params = {
|
||||||
|
workorder: this.workOrder
|
||||||
|
};
|
||||||
|
getWorkOrderTaskList(params)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.workOrderTaskList = res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
workOrder: item.fkWorkorder,
|
||||||
|
taskCode: item.taskCode,
|
||||||
|
title: `任务号:${item.taskCode}`,
|
||||||
|
taskList: []
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 工单点击
|
||||||
|
onListItemClick(item) {
|
||||||
|
const params = {
|
||||||
|
taskCode: item.taskCode,
|
||||||
|
title: item.title
|
||||||
|
};
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/materialManagement/materialPreparation/taskDetail?' + tansParams(params)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
toScanBatching() {
|
||||||
|
const params = {
|
||||||
|
workOrder: this.workOrder
|
||||||
|
};
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/materialManagement/materialPreparation/scanAddBatching?' + tansParams(params)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
146
pages/materialManagement/materialPreparation/index.vue
Normal file
146
pages/materialManagement/materialPreparation/index.vue
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 备料 -->
|
||||||
|
<view class="content">
|
||||||
|
<view class="row">
|
||||||
|
<uni-forms style="width: 100%" ref="form">
|
||||||
|
<uni-forms-item label="日期">
|
||||||
|
<uni-datetime-picker type="date" :clear-icon="false" v-model="dateTime" @change="dateChange" />
|
||||||
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="线别">
|
||||||
|
<uni-data-select v-model="routeCode" :localdata="routeOptions" @change="routeSelectChange"></uni-data-select>
|
||||||
|
</uni-forms-item>
|
||||||
|
</uni-forms>
|
||||||
|
</view>
|
||||||
|
<uni-list style="width: 100%">
|
||||||
|
<uni-list-item
|
||||||
|
v-for="(item, index) in workOrderList"
|
||||||
|
:key="index"
|
||||||
|
:title="item.title"
|
||||||
|
:note="item.note"
|
||||||
|
rightText="配料任务"
|
||||||
|
link
|
||||||
|
@click="onListItemClick(item)"
|
||||||
|
></uni-list-item>
|
||||||
|
</uni-list>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getLineOptions, getWorkOrderList } from '@/api/preparationTask/index.js';
|
||||||
|
import { tansParams } from '@/utils/common';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dateTime: this.$dayjs().format('YYYY-MM-DD'),
|
||||||
|
value: '',
|
||||||
|
// 线别
|
||||||
|
routeOptions: [],
|
||||||
|
routeCode: '',
|
||||||
|
// 工单
|
||||||
|
workOrderList: [],
|
||||||
|
workOrderSelect: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
onShow:function(){
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.handlerGetWorkOrderList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
this.getLineSelectOptions();
|
||||||
|
},
|
||||||
|
getLineSelectOptions() {
|
||||||
|
uni.showLoading();
|
||||||
|
getLineOptions()
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.routeOptions = res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
text: `${item.name}`,
|
||||||
|
value: `${item.code}`
|
||||||
|
};
|
||||||
|
});
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.routeOptions.length > 0) {
|
||||||
|
this.routeCode = this.routeOptions[0].value;
|
||||||
|
this.handlerGetWorkOrderList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 日期改变
|
||||||
|
dateChange() {
|
||||||
|
this.handlerGetWorkOrderList();
|
||||||
|
},
|
||||||
|
// 线别修改
|
||||||
|
routeSelectChange() {
|
||||||
|
this.handlerGetWorkOrderList();
|
||||||
|
},
|
||||||
|
// 获取工单
|
||||||
|
handlerGetWorkOrderList() {
|
||||||
|
const params = {
|
||||||
|
HandleDate: this.dateTime,
|
||||||
|
route_code: this.routeCode
|
||||||
|
};
|
||||||
|
getWorkOrderList(params).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.workOrderList = res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
workOrder: item.workorder,
|
||||||
|
title: `工单号:${item.workorder}`,
|
||||||
|
note: `零件号:${item.productionCode} \n描述:${item.productionName ?? ''}\n规格:${item.specification ?? ''}`
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
WorkOrderStatusColor(status) {
|
||||||
|
const list = ['', '未开始', '已开始', '已完成'];
|
||||||
|
const colorList = ['#fff', '#8f939c', '#2979ff', '#18bc37'];
|
||||||
|
return colorList[status * 1];
|
||||||
|
},
|
||||||
|
// 工单点击
|
||||||
|
onListItemClick(item) {
|
||||||
|
const params = {
|
||||||
|
workOrder: item.workOrder,
|
||||||
|
title: item.title,
|
||||||
|
note: item.note
|
||||||
|
};
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/materialManagement/materialPreparation/batching?' + tansParams(params)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.row {
|
||||||
|
background-color: #fff;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.card-box {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
130
pages/materialManagement/materialPreparation/scanAddBatching.vue
Normal file
130
pages/materialManagement/materialPreparation/scanAddBatching.vue
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<uni-card>
|
||||||
|
<text>{{ '工单号:' + workOrder }}</text>
|
||||||
|
<ScanInput @scanConfirm="scanConfirm"></ScanInput>
|
||||||
|
</uni-card>
|
||||||
|
<uni-card v-for="(item, index) in materialList" :key="index" :title="item.title">
|
||||||
|
<uni-forms ref="formRef" :modelValue="item">
|
||||||
|
<uni-forms-item label="已扫箱" required name="cases">
|
||||||
|
<uni-easyinput type="number" :clearable="false" v-model.number="item.cases" />
|
||||||
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="零件数" required name="quantity">
|
||||||
|
<uni-easyinput type="number" :clearable="false" v-model.number="item.quantity" />
|
||||||
|
</uni-forms-item>
|
||||||
|
</uni-forms>
|
||||||
|
<!-- <uni-list style="width: 100%">
|
||||||
|
<uni-list-item :title="item.materialCode" :rightText="item.materialName"></uni-list-item>
|
||||||
|
</uni-list> -->
|
||||||
|
</uni-card>
|
||||||
|
<uni-row :gutter="20">
|
||||||
|
<uni-col :span="12">
|
||||||
|
<button type="default" @click="clear">清空</button>
|
||||||
|
</uni-col>
|
||||||
|
<uni-col :span="12">
|
||||||
|
<button type="primary" @click="submit()">提交</button>
|
||||||
|
</uni-col>
|
||||||
|
</uni-row>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { analysisScanCode } from '@/api/scan/index';
|
||||||
|
import { generateIngredientTask } from '@/api/preparationTask/index.js';
|
||||||
|
import { warn } from 'vue';
|
||||||
|
export default {
|
||||||
|
onLoad: function (option) {
|
||||||
|
this.workOrder = option.workOrder;
|
||||||
|
this.$nextTick(() => {});
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
formRef: null,
|
||||||
|
workOrder: '',
|
||||||
|
clearMaterialList: [],
|
||||||
|
materialList: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 扫码结果
|
||||||
|
scanConfirm(val) {
|
||||||
|
analysisScanCode({ materialCode: val }).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
console.log(res.data);
|
||||||
|
const _data = res.data;
|
||||||
|
let options = {
|
||||||
|
title: `${_data.partnumber} ${_data.materialName}`,
|
||||||
|
materialCode: _data.partnumber,
|
||||||
|
materialName: _data.materialName,
|
||||||
|
specification: _data.specification,
|
||||||
|
color: _data.color,
|
||||||
|
unit: _data.unit,
|
||||||
|
cases: 1,
|
||||||
|
quantity: 0
|
||||||
|
};
|
||||||
|
let _index = this.hasMaterial(options.materialCode);
|
||||||
|
if (_index === -1) {
|
||||||
|
this.materialList.push(options);
|
||||||
|
} else {
|
||||||
|
this.materialList[_index].cases += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 是否已存在此零件
|
||||||
|
hasMaterial(materialCode) {
|
||||||
|
let index = 0;
|
||||||
|
const list = this.materialList;
|
||||||
|
for (index; index < list.length; index++) {
|
||||||
|
if (list[index].materialCode === materialCode) {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
},
|
||||||
|
clear() {
|
||||||
|
this.materialList = JSON.parse(JSON.stringify(this.clearMaterialList));
|
||||||
|
},
|
||||||
|
submit(ref) {
|
||||||
|
if (!this.formValidate()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const postData = {
|
||||||
|
Ingredient_task: this.materialList,
|
||||||
|
workorder: this.workOrder
|
||||||
|
};
|
||||||
|
generateIngredientTask(postData).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'success',
|
||||||
|
title: '提交成功'
|
||||||
|
});
|
||||||
|
this.clear();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 手动校验
|
||||||
|
formValidate() {
|
||||||
|
for (let item of this.materialList) {
|
||||||
|
if (item.quantity === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: item.materialCode + '零件号不可为0'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (item.quantity === '') {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: item.materialCode + '零件号不可为空'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
59
pages/materialManagement/materialPreparation/taskDetail.vue
Normal file
59
pages/materialManagement/materialPreparation/taskDetail.vue
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<uni-card>
|
||||||
|
<text>{{ title }}</text>
|
||||||
|
</uni-card>
|
||||||
|
<uni-list style="width: 100%">
|
||||||
|
<uni-list-item v-for="(item, index) in taskList" :key="index" :title="item.title" :note="item.note" :rightText="item.rightText"></uni-list-item>
|
||||||
|
</uni-list>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getTaskInfoList } from '@/api/preparationTask/index.js';
|
||||||
|
export default {
|
||||||
|
onLoad: function (option) {
|
||||||
|
this.taskCode = option.taskCode;
|
||||||
|
this.title = option.title;
|
||||||
|
|
||||||
|
},
|
||||||
|
onShow:function(){
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.doGetTaskInfoList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title:'',
|
||||||
|
taskCode: '',
|
||||||
|
taskList: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
doGetTaskInfoList() {
|
||||||
|
uni.showLoading();
|
||||||
|
const params = {
|
||||||
|
task_code: this.taskCode
|
||||||
|
};
|
||||||
|
getTaskInfoList(params)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.taskList = res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
title: `物料号:${item.materialCode}`,
|
||||||
|
note: `描述:${item.materialName ?? ''} 规格:${item.specification ?? ''}`,
|
||||||
|
rightText: `配料数量:${item.quantity}`
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="mine-container" :style="{height: `${windowHeight}px`}">
|
<view class="mine-container" :style="{ height: `${windowHeight}px` }">
|
||||||
<!--顶部个人信息栏-->
|
<!--顶部个人信息栏-->
|
||||||
<view class="header-section">
|
<view class="header-section">
|
||||||
<view class="flex padding justify-between">
|
<view class="flex padding justify-between">
|
||||||
@ -7,15 +7,10 @@
|
|||||||
<view v-if="!avatar" class="cu-avatar xl round bg-white">
|
<view v-if="!avatar" class="cu-avatar xl round bg-white">
|
||||||
<view class="iconfont icon-people text-gray icon"></view>
|
<view class="iconfont icon-people text-gray icon"></view>
|
||||||
</view>
|
</view>
|
||||||
<image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
|
<image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix"></image>
|
||||||
</image>
|
<view v-if="!name" @click="handleToLogin" class="login-tip">点击登录</view>
|
||||||
<view v-if="!name" @click="handleToLogin" class="login-tip">
|
|
||||||
点击登录
|
|
||||||
</view>
|
|
||||||
<view v-if="name" @click="handleToInfo" class="user-info">
|
<view v-if="name" @click="handleToInfo" class="user-info">
|
||||||
<view class="u_title">
|
<view class="u_title">用户名:{{ name }}</view>
|
||||||
用户名:{{ name }}
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="handleToInfo" class="flex align-center">
|
<view @click="handleToInfo" class="flex align-center">
|
||||||
@ -71,78 +66,76 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import storage from '@/utils/storage'
|
import storage from '@/utils/storage';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: this.$store.state.user.name,
|
name: this.$store.state.user.name,
|
||||||
version: getApp().globalData.config.appInfo.version
|
version: getApp().globalData.config.appInfo.version
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
avatar() {
|
avatar() {
|
||||||
return this.$store.state.user.avatar
|
return this.$store.state.user.avatar;
|
||||||
},
|
},
|
||||||
windowHeight() {
|
windowHeight() {
|
||||||
return uni.getSystemInfoSync().windowHeight - 50
|
return uni.getSystemInfoSync().windowHeight - 50;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleToInfo() {
|
handleToInfo() {
|
||||||
this.$tab.navigateTo('/pages/mine/info/index')
|
this.$tab.navigateTo('/pages/mine/info/index');
|
||||||
},
|
},
|
||||||
handleToEditInfo() {
|
handleToEditInfo() {
|
||||||
this.$tab.navigateTo('/pages/mine/info/edit')
|
this.$tab.navigateTo('/pages/mine/info/edit');
|
||||||
},
|
},
|
||||||
handleToSetting() {
|
handleToSetting() {
|
||||||
this.$tab.navigateTo('/pages/mine/setting/index')
|
this.$tab.navigateTo('/pages/mine/setting/index');
|
||||||
},
|
},
|
||||||
handleToLogin() {
|
handleToLogin() {
|
||||||
this.$tab.reLaunch('/pages/login')
|
this.$tab.reLaunch('/pages/login');
|
||||||
},
|
},
|
||||||
handleToAvatar() {
|
handleToAvatar() {
|
||||||
this.$tab.navigateTo('/pages/mine/avatar/index')
|
this.$tab.navigateTo('/pages/mine/avatar/index');
|
||||||
},
|
},
|
||||||
handleLogout() {
|
handleLogout() {
|
||||||
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
|
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
|
||||||
this.$store.dispatch('LogOut').then(() => {
|
this.$store.dispatch('LogOut').then(() => {
|
||||||
this.$tab.reLaunch('/pages/index')
|
this.$tab.reLaunch('/pages/index');
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
handleHelp() {
|
handleHelp() {
|
||||||
this.$tab.navigateTo('/pages/mine/help/index')
|
this.$tab.navigateTo('/pages/mine/help/index');
|
||||||
},
|
},
|
||||||
handleAbout() {
|
handleAbout() {
|
||||||
this.$tab.navigateTo('/pages/mine/about/index')
|
this.$tab.navigateTo('/pages/mine/about/index');
|
||||||
},
|
},
|
||||||
handleJiaoLiuQun() {
|
handleJiaoLiuQun() {
|
||||||
this.$modal.showToast('QQ群:①133713780、②146013835')
|
this.$modal.showToast('QQ群:①133713780、②146013835');
|
||||||
},
|
},
|
||||||
handleBuilding() {
|
handleBuilding() {
|
||||||
this.$modal.showToast('模块建设中~')
|
this.$modal.showToast('模块建设中~');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background-color: #f5f6f7;
|
background-color: #f5f6f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mine-container {
|
.mine-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
|
|
||||||
.header-section {
|
.header-section {
|
||||||
padding: 15px 15px 45px 15px;
|
padding: 15px 15px 45px 15px;
|
||||||
background-color: #3c96f3;
|
background-color: #3c96f3;
|
||||||
@ -194,5 +187,5 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="work-container">
|
<view class="work-container">
|
||||||
<!-- 轮播图 -->
|
<!-- 轮播图 -->
|
||||||
<uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
|
<uni-swiper-dot class="uni-swiper-dot-box" :info="bannerList" :current="current" field="content">
|
||||||
<swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
|
<swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
|
||||||
<swiper-item v-for="(item, index) in data" :key="index">
|
<swiper-item v-for="(item, index) in bannerList" :key="index">
|
||||||
<view class="swiper-item" @click="clickBannerItem(item)">
|
<view class="swiper-item" @click="clickBannerItem(item)">
|
||||||
<image :src="item.image" mode="aspectFill" :draggable="false" />
|
<image :src="item.image" mode="aspectFill" :draggable="false" />
|
||||||
</view>
|
</view>
|
||||||
@ -12,61 +12,13 @@
|
|||||||
</uni-swiper-dot>
|
</uni-swiper-dot>
|
||||||
|
|
||||||
<!-- 宫格组件 -->
|
<!-- 宫格组件 -->
|
||||||
<uni-section title="系统管理" type="line"></uni-section>
|
<uni-section title="物料管理" type="line"></uni-section>
|
||||||
<view class="grid-body">
|
<view class="grid-body">
|
||||||
<uni-grid :column="4" :showBorder="false" @change="changeGrid">
|
<uni-grid :column="4" :showBorder="false" @change="changeGrid">
|
||||||
<uni-grid-item>
|
<uni-grid-item v-for="(item, index) in materialOptions" :key="index" :index="index">
|
||||||
<view class="grid-item-box">
|
<view class="grid-item-box">
|
||||||
<uni-icons type="person-filled" size="30"></uni-icons>
|
<uni-icons :type="item.icon" size="30"></uni-icons>
|
||||||
<text class="text">用户管理</text>
|
<text class="text">{{ item.name }}</text>
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="staff-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">角色管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="color" size="30"></uni-icons>
|
|
||||||
<text class="text">菜单管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="settings-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">部门管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="heart-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">岗位管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="bars" size="30"></uni-icons>
|
|
||||||
<text class="text">字典管理</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="gear-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">参数设置</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="chat-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">通知公告</text>
|
|
||||||
</view>
|
|
||||||
</uni-grid-item>
|
|
||||||
<uni-grid-item>
|
|
||||||
<view class="grid-item-box">
|
|
||||||
<uni-icons type="wallet-filled" size="30"></uni-icons>
|
|
||||||
<text class="text">日志管理</text>
|
|
||||||
</view>
|
</view>
|
||||||
</uni-grid-item>
|
</uni-grid-item>
|
||||||
</uni-grid>
|
</uni-grid>
|
||||||
@ -75,12 +27,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
import { fail } from 'assert';
|
||||||
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
current: 0,
|
current: 0,
|
||||||
swiperDotIndex: 0,
|
swiperDotIndex: 0,
|
||||||
data: [{
|
bannerList: [
|
||||||
|
{
|
||||||
image: '/static/images/banner/banner01.jpg'
|
image: '/static/images/banner/banner01.jpg'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -89,48 +43,77 @@
|
|||||||
{
|
{
|
||||||
image: '/static/images/banner/banner03.jpg'
|
image: '/static/images/banner/banner03.jpg'
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
// 物料模块
|
||||||
|
materialOptions: [
|
||||||
|
{
|
||||||
|
name: '备料管理',
|
||||||
|
icon: 'upload-filled',
|
||||||
|
url: '/pages/materialManagement/materialPreparation/index'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '参数设置',
|
||||||
|
icon: 'gear-filled',
|
||||||
|
url: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '通知公告',
|
||||||
|
icon: 'chat-filled',
|
||||||
|
url: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '配料日志',
|
||||||
|
icon: 'wallet-filled',
|
||||||
|
url: ''
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clickBannerItem(item) {
|
clickBannerItem(item) {
|
||||||
console.info(item)
|
console.info(item);
|
||||||
},
|
},
|
||||||
changeSwiper(e) {
|
changeSwiper(e) {
|
||||||
this.current = e.detail.current
|
this.current = e.detail.current;
|
||||||
},
|
},
|
||||||
changeGrid(e) {
|
changeGrid(e) {
|
||||||
this.$modal.showToast('模块建设中~')
|
const _url = this.materialOptions[e.detail.index].url;
|
||||||
}
|
uni.navigateTo({
|
||||||
|
url: _url,
|
||||||
|
fail: () => {
|
||||||
|
this.$modal.showToast('模块建设中~');
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
page {
|
page {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
view {
|
view {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* #endif */
|
/* #endif */
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.grid-item-box {
|
.grid-item-box {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -139,23 +122,22 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 15px 0;
|
padding: 15px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-margin-wrap {
|
.uni-margin-wrap {
|
||||||
width: 690rpx;
|
width: 690rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.swiper {
|
.swiper {
|
||||||
height: 300rpx;
|
height: 300rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.swiper-box {
|
.swiper-box {
|
||||||
height: 150px;
|
height: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.swiper-item {
|
.swiper-item {
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
display: flex;
|
display: flex;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
@ -165,9 +147,9 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
height: 300rpx;
|
height: 300rpx;
|
||||||
line-height: 300rpx;
|
line-height: 300rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 500px) {
|
@media screen and (min-width: 500px) {
|
||||||
.uni-swiper-dot-box {
|
.uni-swiper-dot-box {
|
||||||
width: 400px;
|
width: 400px;
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
@ -179,5 +161,5 @@
|
|||||||
.image {
|
.image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -20,9 +20,9 @@ list.forEach(item => {
|
|||||||
uni.addInterceptor(item, {
|
uni.addInterceptor(item, {
|
||||||
invoke(to) {
|
invoke(to) {
|
||||||
if (getToken()) {
|
if (getToken()) {
|
||||||
if (to.url === loginPage) {
|
// if (to.url === loginPage) {
|
||||||
uni.reLaunch({ url: "/" })
|
// uni.reLaunch({ url: "/" })
|
||||||
}
|
// }
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
if (checkWhite(to.url)) {
|
if (checkWhite(to.url)) {
|
||||||
|
|||||||
@ -34,26 +34,26 @@
|
|||||||
top: 50%;
|
top: 50%;
|
||||||
margin-top: -6px;
|
margin-top: -6px;
|
||||||
right: 30rpx;
|
right: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-cell {
|
.list-cell {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
color: #333;
|
color: #333;
|
||||||
padding: 26rpx 30rpx;
|
padding: 26rpx 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-cell:first-child {
|
.list-cell:first-child {
|
||||||
border-radius: 8rpx 8rpx 0 0;
|
border-radius: 8rpx 8rpx 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-cell:last-child {
|
.list-cell:last-child {
|
||||||
border-radius: 0 0 8rpx 8rpx;
|
border-radius: 0 0 8rpx 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-cell::after {
|
.list-cell::after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border-bottom: 1px solid #eaeef1;
|
border-bottom: 1px solid #eaeef1;
|
||||||
@ -64,10 +64,9 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.menu-list {
|
||||||
.menu-list {
|
|
||||||
margin: 15px 15px;
|
margin: 15px 15px;
|
||||||
|
|
||||||
.menu-item-box {
|
.menu-item-box {
|
||||||
@ -76,7 +75,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.menu-icon {
|
.menu-icon {
|
||||||
color: #007AFF;
|
color: #007aff;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
@ -87,4 +86,4 @@
|
|||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
utils/baseUrl.js
Normal file
13
utils/baseUrl.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
const BaseUrlKey = 'BaseUrl'
|
||||||
|
|
||||||
|
export function getBaseUrl() {
|
||||||
|
return uni.getStorageSync(BaseUrlKey)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setBaseUrl(BaseUrl) {
|
||||||
|
return uni.setStorageSync(BaseUrlKey, BaseUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function removeBaseUrl() {
|
||||||
|
return uni.removeStorageSync(BaseUrlKey)
|
||||||
|
}
|
||||||
@ -3,6 +3,11 @@ import config from '@/config'
|
|||||||
import {
|
import {
|
||||||
getToken
|
getToken
|
||||||
} from '@/utils/auth'
|
} from '@/utils/auth'
|
||||||
|
import {
|
||||||
|
getBaseUrl,
|
||||||
|
setBaseUrl,
|
||||||
|
removeBaseUrl
|
||||||
|
} from '@/utils/baseUrl';
|
||||||
import errorCode from '@/utils/errorCode'
|
import errorCode from '@/utils/errorCode'
|
||||||
import {
|
import {
|
||||||
toast,
|
toast,
|
||||||
@ -15,6 +20,7 @@ const baseUrl = config.baseUrl
|
|||||||
|
|
||||||
const request = config => {
|
const request = config => {
|
||||||
// 是否需要设置 token
|
// 是否需要设置 token
|
||||||
|
const storageBaseUrl = 'http://' + getBaseUrl();
|
||||||
const isToken = (config.headers || {}).isToken === false
|
const isToken = (config.headers || {}).isToken === false
|
||||||
config.header = config.header || {}
|
config.header = config.header || {}
|
||||||
if (getToken() && !isToken) {
|
if (getToken() && !isToken) {
|
||||||
@ -30,7 +36,7 @@ const request = config => {
|
|||||||
uni.request({
|
uni.request({
|
||||||
method: config.method || 'get',
|
method: config.method || 'get',
|
||||||
timeout: config.timeout || timeout,
|
timeout: config.timeout || timeout,
|
||||||
url: config.baseUrl || baseUrl + config.url,
|
url: config.baseUrl || storageBaseUrl + config.url,
|
||||||
data: config.data,
|
data: config.data,
|
||||||
header: config.header,
|
header: config.header,
|
||||||
dataType: 'json'
|
dataType: 'json'
|
||||||
|
|||||||
42
utils/scan.js
Normal file
42
utils/scan.js
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
|
||||||
|
|
||||||
|
// 案例
|
||||||
|
const example = ["20103484/20240907//2142","20103237/20240907//2142"]
|
||||||
|
|
||||||
|
|
||||||
|
export function formatValue(value) {
|
||||||
|
try {
|
||||||
|
if (value === "" || value === null || value === undefined) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return analysisScanValue1(value)
|
||||||
|
} catch (err) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '标题',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 反馈对象 零件号,批次号(日期),数量,供应商代码
|
||||||
|
let jsonObj = {
|
||||||
|
partnumber: '',
|
||||||
|
batchnumber: '',
|
||||||
|
quantity: 0.0,
|
||||||
|
code: ''
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getNewJsonObj() {
|
||||||
|
return JSON.parse(JSON.stringify(jsonObj))
|
||||||
|
}
|
||||||
|
|
||||||
|
function analysisScanValue1(value) {
|
||||||
|
const parts = value.split('/');
|
||||||
|
const filteredParts = parts.filter(part => part !== '');
|
||||||
|
const [first, second, third] = filteredParts;
|
||||||
|
let newJsonObj = getNewJsonObj();
|
||||||
|
newJsonObj.partnumber = first;
|
||||||
|
newJsonObj.batchnumber = second;
|
||||||
|
newJsonObj.code = third;
|
||||||
|
return newJsonObj
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user