Merge branch 'master' of https://gitee.com/doan-tech/shanghaiganxiangtuzhuangworkshop_WMS_PDA
This commit is contained in:
commit
a325e56ff7
@ -2,8 +2,8 @@
|
||||
"name" : "干巷仓库APP",
|
||||
"appid" : "__UNI__A67E78B",
|
||||
"description" : "",
|
||||
"versionName" : "2.1.8",
|
||||
"versionCode" : 218,
|
||||
"versionName" : "2.1.9",
|
||||
"versionCode" : 219,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
|
||||
@ -9,158 +9,156 @@
|
||||
<!-- 登录表单 -->
|
||||
<u--form labelPosition="left" :model="loginForm" ref="uForm">
|
||||
<u-form-item prop="username" borderBottom>
|
||||
<u--input v-model="loginForm.username" border="none" placeholder="账号" prefixIcon="account"
|
||||
prefixIconStyle="font-size: 22px;color: #909399"></u--input>
|
||||
<u--input v-model="loginForm.username" border="none" placeholder="账号" prefixIcon="account" prefixIconStyle="font-size: 22px;color: #909399"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item prop="password" borderBottom>
|
||||
<u--input v-model="loginForm.password" border="none" placeholder="密码" prefixIcon="lock"
|
||||
prefixIconStyle="font-size: 22px;color: #909399"></u--input>
|
||||
<u--input v-model="loginForm.password" border="none" placeholder="密码" prefixIcon="lock" prefixIconStyle="font-size: 22px;color: #909399"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item prop="BaseUrl" borderBottom>
|
||||
<u-input v-model="BaseUrl" border="none" placeholder="连接地址,例:127.0.0.1:8888"
|
||||
prefixIcon="ie" prefixIconStyle="font-size: 22px;color: #909399">
|
||||
<u-input v-model="BaseUrl" border="none" placeholder="连接地址,例:127.0.0.1:8888" prefixIcon="ie" prefixIconStyle="font-size: 22px;color: #909399">
|
||||
<template slot="suffix">
|
||||
<u-button type="primary" size="mini" text="修改地址" @click="handlerBaseUrlConfirm"
|
||||
shape="circle"></u-button>
|
||||
<u-button type="primary" size="mini" text="修改地址" @click="handlerBaseUrlConfirm" shape="circle"></u-button>
|
||||
</template>
|
||||
</u-input>
|
||||
</u-form-item>
|
||||
<u-form-item prop="button" style="margin-top: 60px;">
|
||||
<u-form-item prop="button" style="margin-top: 60px">
|
||||
<u-button @click="handleLogin" type="primary" :color="buttonColor" text="登录" shape="circle"></u-button>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
</view>
|
||||
|
||||
<!-- 无网络处理 -->
|
||||
<u-no-network></u-no-network>
|
||||
<view class="bangben">版本号:{{ version }}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getCodeImg
|
||||
} from '@/api/login';
|
||||
import {
|
||||
getToken,
|
||||
setToken,
|
||||
removeToken
|
||||
} from '@/utils/auth';
|
||||
import {
|
||||
getBaseUrl,
|
||||
setBaseUrl,
|
||||
removeBaseUrl
|
||||
} from '@/utils/baseUrl';
|
||||
import config from '@/config';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
codeUrl: '',
|
||||
captchaEnabled: false,
|
||||
// 用户注册开关
|
||||
register: false,
|
||||
globalConfig: getApp().globalData.config,
|
||||
BaseUrl: '127.0.0.1:8888',
|
||||
buttonColor: 'linear-gradient(to right, #3296F9, #235FF5)',
|
||||
loginForm: {
|
||||
username: 'admin',
|
||||
password: '123456',
|
||||
code: '',
|
||||
uuid: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
// this.getCode();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 初始化链接地址设计
|
||||
let baseUrl = getBaseUrl();
|
||||
if (!baseUrl) {
|
||||
baseUrl = '192.168.60.251:8888';
|
||||
setBaseUrl(baseUrl);
|
||||
}
|
||||
this.BaseUrl = baseUrl;
|
||||
},
|
||||
// 获取图形验证码
|
||||
getCode() {
|
||||
getCodeImg().then((res) => {
|
||||
if (res.code !== 200) {
|
||||
uni.showToast({
|
||||
title: '获取验证码失败!请检查网络!',
|
||||
icon: 'error'
|
||||
});
|
||||
return;
|
||||
}
|
||||
const result = res.data;
|
||||
if (result.captchaOff === 'off') {
|
||||
this.captchaEnabled = false;
|
||||
return;
|
||||
} else {
|
||||
this.captchaEnabled = true;
|
||||
}
|
||||
this.codeUrl = 'data:image/gif;base64,' + result.img;
|
||||
this.loginForm.uuid = result.uuid;
|
||||
});
|
||||
},
|
||||
// 登录方法
|
||||
async handleLogin() {
|
||||
// debug快速登录
|
||||
if (this.loginForm.username === 'debug') {
|
||||
setToken('123');
|
||||
this.$tab.reLaunch('/pages/index/index');
|
||||
return;
|
||||
}
|
||||
if (this.loginForm.username === '') {
|
||||
this.$modal.msgError('请输入您的账号');
|
||||
} else if (this.loginForm.password === '') {
|
||||
this.$modal.msgError('请输入您的密码');
|
||||
} else if (this.loginForm.code === '' && this.captchaEnabled) {
|
||||
this.$modal.msgError('请输入验证码');
|
||||
} else {
|
||||
this.$modal.loading('登录中,请耐心等待...');
|
||||
setTimeout(()=>{
|
||||
this.$modal.closeLoading();
|
||||
},30000)
|
||||
this.pwdLogin();
|
||||
}
|
||||
},
|
||||
// 密码登录
|
||||
async pwdLogin() {
|
||||
this.$store
|
||||
.dispatch('Login', this.loginForm)
|
||||
.then(() => {
|
||||
this.$modal.closeLoading();
|
||||
this.loginSuccess();
|
||||
})
|
||||
.catch(() => {
|
||||
this.$modal.closeLoading();
|
||||
if (this.captchaEnabled) {
|
||||
this.getCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
// 登录成功后,处理函数
|
||||
loginSuccess(result) {
|
||||
// 获取户信息
|
||||
this.$store.dispatch('GetInfo').then((res) => {
|
||||
this.$tab.reLaunch('/pages/index/index');
|
||||
});
|
||||
},
|
||||
// 确认修改链接地址
|
||||
handlerBaseUrlConfirm() {
|
||||
const baseUrl = this.BaseUrl;
|
||||
console.log('changeBaseUrl', baseUrl);
|
||||
uni.showToast({
|
||||
title: '链接地址已修改:' + baseUrl,
|
||||
icon: 'none'
|
||||
});
|
||||
import { getCodeImg } from '@/api/login';
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth';
|
||||
import { getBaseUrl, setBaseUrl, removeBaseUrl } from '@/utils/baseUrl';
|
||||
import config from '@/config';
|
||||
export default {
|
||||
onLoad() {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
this.version = systemInfo.appVersion;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
version: '',
|
||||
codeUrl: '',
|
||||
captchaEnabled: false,
|
||||
// 用户注册开关
|
||||
register: false,
|
||||
globalConfig: getApp().globalData.config,
|
||||
BaseUrl: '127.0.0.1:8888',
|
||||
buttonColor: 'linear-gradient(to right, #3296F9, #235FF5)',
|
||||
loginForm: {
|
||||
username: 'admin',
|
||||
password: '123456',
|
||||
code: '',
|
||||
uuid: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
// this.getCode();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 初始化链接地址设计
|
||||
let baseUrl = getBaseUrl();
|
||||
if (!baseUrl) {
|
||||
baseUrl = '192.168.60.251:8888';
|
||||
setBaseUrl(baseUrl);
|
||||
}
|
||||
this.BaseUrl = baseUrl;
|
||||
},
|
||||
// 获取图形验证码
|
||||
getCode() {
|
||||
getCodeImg().then((res) => {
|
||||
if (res.code !== 200) {
|
||||
uni.showToast({
|
||||
title: '获取验证码失败!请检查网络!',
|
||||
icon: 'error'
|
||||
});
|
||||
return;
|
||||
}
|
||||
const result = res.data;
|
||||
if (result.captchaOff === 'off') {
|
||||
this.captchaEnabled = false;
|
||||
return;
|
||||
} else {
|
||||
this.captchaEnabled = true;
|
||||
}
|
||||
this.codeUrl = 'data:image/gif;base64,' + result.img;
|
||||
this.loginForm.uuid = result.uuid;
|
||||
});
|
||||
},
|
||||
// 登录方法
|
||||
async handleLogin() {
|
||||
// debug快速登录
|
||||
if (this.loginForm.username === 'debug') {
|
||||
setToken('123');
|
||||
this.$tab.reLaunch('/pages/index/index');
|
||||
return;
|
||||
}
|
||||
if (this.loginForm.username === '') {
|
||||
this.$modal.msgError('请输入您的账号');
|
||||
} else if (this.loginForm.password === '') {
|
||||
this.$modal.msgError('请输入您的密码');
|
||||
} else if (this.loginForm.code === '' && this.captchaEnabled) {
|
||||
this.$modal.msgError('请输入验证码');
|
||||
} else {
|
||||
this.$modal.loading('登录中,请耐心等待...');
|
||||
setTimeout(() => {
|
||||
this.$modal.closeLoading();
|
||||
}, 30000);
|
||||
this.pwdLogin();
|
||||
}
|
||||
},
|
||||
// 密码登录
|
||||
async pwdLogin() {
|
||||
this.$store
|
||||
.dispatch('Login', this.loginForm)
|
||||
.then(() => {
|
||||
this.$modal.closeLoading();
|
||||
this.loginSuccess();
|
||||
})
|
||||
.catch(() => {
|
||||
this.$modal.closeLoading();
|
||||
if (this.captchaEnabled) {
|
||||
this.getCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
// 登录成功后,处理函数
|
||||
loginSuccess(result) {
|
||||
// 获取户信息
|
||||
this.$store.dispatch('GetInfo').then((res) => {
|
||||
this.$tab.reLaunch('/pages/index/index');
|
||||
});
|
||||
},
|
||||
// 确认修改链接地址
|
||||
handlerBaseUrlConfirm() {
|
||||
const baseUrl = this.BaseUrl;
|
||||
console.log('changeBaseUrl', baseUrl);
|
||||
uni.showToast({
|
||||
title: '链接地址已修改:' + baseUrl,
|
||||
icon: 'none'
|
||||
});
|
||||
setBaseUrl(baseUrl);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import url("login.scss");
|
||||
</style>
|
||||
.bangben {
|
||||
margin-top: 110px;
|
||||
margin-left: 35%;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
@import url('login.scss');
|
||||
</style>
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
<u-col span="2">
|
||||
<span>已经上件数</span>
|
||||
</u-col>
|
||||
<u-col span="4" offset="1">
|
||||
<u-col span="4">
|
||||
<span>选中</span>
|
||||
</u-col>
|
||||
</u-row>
|
||||
@ -63,15 +63,17 @@
|
||||
<u-list-item v-for="(item, index) in workerorder_list" :key="index">
|
||||
<u-row gutter="30">
|
||||
<u-col span="4">
|
||||
<u-tag :text="item.blankNumber" size="large"></u-tag>
|
||||
<u-tag v-if="containsChinese(item.clientWorkorder)" :text="item.blankNumber" size="large" type="warning"></u-tag>
|
||||
<u-tag v-else :text="item.blankNumber" size="large"></u-tag>
|
||||
</u-col>
|
||||
<u-col span="2">
|
||||
<u-tag :text="item.previousNumber"></u-tag>
|
||||
<u-tag v-if="containsChinese(item.clientWorkorder)" :text="item.previousNumber" size="large" type="warning"></u-tag>
|
||||
<u-tag v-else :text="item.previousNumber"></u-tag>
|
||||
</u-col>
|
||||
<u-col span="2">
|
||||
<u-tag type="success" :text="item.previousNumbered" plain></u-tag>
|
||||
</u-col>
|
||||
<u-col span="4" offset="1">
|
||||
<u-col span="4">
|
||||
<u-switch v-model="item.selected" size="60" asyncChange @change="switch_change(index, item.selected)"></u-switch>
|
||||
</u-col>
|
||||
</u-row>
|
||||
@ -79,15 +81,15 @@
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
</view>
|
||||
<uni-pagination show-icon="true" :total="page.total" :current="page.pageNum" :pageSize="page.pageSize" @change="changepage"></uni-pagination>
|
||||
<uni-pagination show-icon="true" :total="page.total" :current="page.pageNum" :pageSize="page.pageSize" @change="changepage"></uni-pagination>
|
||||
<u-modal :show="show_model" title="确认选中数量" @confirm="ingredient_confirm">
|
||||
<u--form labelPosition="left" labelWidth="240" :labelStyle="labelstyle">
|
||||
<u-form-item label="配料数量" borderBottom>
|
||||
<u--input v-model="ingredient" border="surround" type="number"></u--input>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
</u--form>
|
||||
</u-modal>
|
||||
<u-button type="primary" size="big" text="生成配料任务" @click="generatetask"></u-button>
|
||||
<u-button style="margin-top: 10px;" type="primary" size="big" text="生成配料任务" @click="generatetask"></u-button>
|
||||
<u-modal :show="task.show" :title="task.title" :content="task.content" @confirm="task.show = false"></u-modal>
|
||||
<u-loading-page :loading="loading" loading-text="加载数据中..." loading-color="#00ff00" icon-size="150"></u-loading-page>
|
||||
<u-notify ref="uNotify" message="Hi uView"></u-notify>
|
||||
@ -143,6 +145,10 @@ export default {
|
||||
this.get_startpoints();
|
||||
},
|
||||
methods: {
|
||||
containsChinese(str) {
|
||||
var pattern = /[\u4e00-\u9fa5]/;
|
||||
return pattern.test(str);
|
||||
},
|
||||
// todo 获取上料起点
|
||||
get_startpoints() {
|
||||
achievestartpoints().then((res) => {
|
||||
@ -163,9 +169,9 @@ export default {
|
||||
});
|
||||
},
|
||||
//todo 下拉更新
|
||||
changepage({type,current}) {
|
||||
this.page.pageNum=current;
|
||||
|
||||
changepage({ type, current }) {
|
||||
this.page.pageNum = current;
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.get_workorder_list();
|
||||
});
|
||||
@ -203,12 +209,13 @@ export default {
|
||||
safeAreaInsetTop: true
|
||||
});
|
||||
this.workerorder_list = res.data.item1;
|
||||
this.page.total=res.data.item2
|
||||
this.page.total = res.data.item2;
|
||||
// this.workerorder_list = res.data;
|
||||
for (let item = 0; item < this.workerorder_list.length; item++) {
|
||||
this.workerorder_list[item].selected = false;
|
||||
this.workerorder_list[item].previousNumbered = 0;
|
||||
}
|
||||
console.log('this.workerorder_list', this.workerorder_list);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -287,7 +294,6 @@ export default {
|
||||
}
|
||||
|
||||
.scrollable-container {
|
||||
|
||||
overflow: auto;
|
||||
border: 3px solid #9e9b99;
|
||||
}
|
||||
|
||||
@ -1,14 +1,12 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-subsection :list="list" :current="current" @change="sectionChange" mode="subsection"
|
||||
fontSize="1.5rem"></u-subsection>
|
||||
<u-subsection :list="list" :current="current" @change="sectionChange" mode="subsection" fontSize="1.5rem"></u-subsection>
|
||||
<view v-if="current == 0" :key="0">
|
||||
<view>
|
||||
<u-row>
|
||||
<u-col span="6">
|
||||
<u-button @click="timeshow = true">选择日期</u-button>
|
||||
<u-datetime-picker :show="timeshow" v-model="queryParams.workerorder_time" mode="date"
|
||||
@confirm="confirm" @cancel="timeshow = false"></u-datetime-picker>
|
||||
<u-datetime-picker :show="timeshow" v-model="queryParams.workerorder_time" mode="date" @confirm="confirm" @cancel="timeshow = false"></u-datetime-picker>
|
||||
</u-col>
|
||||
<u-col span="6">
|
||||
<view style="font-size: 1.2rem">{{ queryParams.workerorder_time | formatDate }}</view>
|
||||
@ -27,14 +25,10 @@
|
||||
<view class="cartoon-list-item">
|
||||
<u-row>
|
||||
<u-col span="2">{{ item.id }}</u-col>
|
||||
<u-col span="1"><u-tag :text="item.agvPosition" size="mini"
|
||||
type="primary"></u-tag></u-col>
|
||||
<u-col span="3" offset="1"><u-icon name="arrow-right-double" color="#2979ff"
|
||||
size="50" @click="detail_item(item.taskId)"></u-icon></u-col>
|
||||
<u-col span="2"><u-button type="success" text="开始" size="mini"
|
||||
@click="confirm_startpoint(item.agvPosition)"></u-button></u-col>
|
||||
<u-col span="2"><u-button type="error" text="上线" size="mini"
|
||||
@click="final_task(item.taskId)"></u-button></u-col>
|
||||
<u-col span="1"><u-tag :text="item.agvPosition" size="mini" type="primary"></u-tag></u-col>
|
||||
<u-col span="3" offset="1"><u-icon name="arrow-right-double" color="#2979ff" size="50" @click="detail_item(item.taskId)"></u-icon></u-col>
|
||||
<u-col span="2"><u-button type="success" text="开始" size="mini" @click="confirm_startpoint(item.agvPosition)"></u-button></u-col>
|
||||
<u-col span="2"><u-button type="error" text="上线" size="mini" @click="final_task(item.taskId)"></u-button></u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
</u-list-item>
|
||||
@ -66,15 +60,33 @@
|
||||
</view>
|
||||
</u-modal>
|
||||
<view class="tip-box">
|
||||
<view>
|
||||
<u-row>
|
||||
<u-col span="2">小车1</u-col>
|
||||
<u-col span="1">
|
||||
<view class="tip-icon-small"></view>
|
||||
</u-col>
|
||||
<u-col span="2" offset="1">小车2</u-col>
|
||||
<u-col span="1">
|
||||
<view class="tip-icon-small"></view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
<u-divider text="agv状态"></u-divider>
|
||||
|
||||
<u-row>
|
||||
<u-col span="2">起点</u-col>
|
||||
<u-col span="1">起点</u-col>
|
||||
<u-col span="2">
|
||||
<u--input border="surround" v-model="start_point" @change="get_fab_go_points"></u--input>
|
||||
</u-col>
|
||||
<u-col span="2" offset="2">终点</u-col>
|
||||
<u-col span="4">
|
||||
<u-col span="1" offset="0.5">终点</u-col>
|
||||
<u-col span="3">
|
||||
<uni-data-select v-model="end_point" :localdata="fab_go_points"></uni-data-select>
|
||||
</u-col>
|
||||
<u-col span="1" offset="0.5">agv</u-col>
|
||||
<u-col span="3">
|
||||
<uni-data-select v-model="agv_num" :localdata="agv_num_list"></uni-data-select>
|
||||
</u-col>
|
||||
</u-row>
|
||||
|
||||
<u-row>
|
||||
@ -90,19 +102,25 @@
|
||||
</view>
|
||||
<view v-if="current == 1" :key="1">
|
||||
<view class="tip-box">
|
||||
|
||||
<u-row :gutter="20">
|
||||
<u-col span="2">
|
||||
<u-text text="起点" size="48"></u-text>
|
||||
<u-col span="1">
|
||||
<u-text text="起点" size="32"></u-text>
|
||||
</u-col>
|
||||
<u-col span="4">
|
||||
<u-col span="3">
|
||||
<uni-data-select v-model="start_point" :localdata="startOptions"></uni-data-select>
|
||||
</u-col>
|
||||
<u-col span="2">
|
||||
<u-text text="终点" size="48"></u-text>
|
||||
<u-col span="1">
|
||||
<u-text text="终点" size="32"></u-text>
|
||||
</u-col>
|
||||
<u-col span="4">
|
||||
<u-col span="3">
|
||||
<uni-data-select v-model="end_point" :localdata="endOptions"></uni-data-select>
|
||||
</u-col>
|
||||
|
||||
<u-col span="1" offset="0.5">agv</u-col>
|
||||
<u-col span="3">
|
||||
<uni-data-select v-model="agv_num" :localdata="agv_num_list"></uni-data-select>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<u-gap height="20"></u-gap>
|
||||
<u-row>
|
||||
@ -120,336 +138,354 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getIngredientTask,
|
||||
getIngredientTask_son,
|
||||
getfabgopoints,
|
||||
go_workshop,
|
||||
emergency_stop_agv,
|
||||
getStartOptions,
|
||||
getEndOptions,
|
||||
FinisBatchingTask
|
||||
} from '@/api/materialManagement/MaterialRequsition.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: ['车间叫料', '空箱返程'],
|
||||
current: 0,
|
||||
queryParams: {
|
||||
workerorder_time: Number(new Date()),
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
sort: undefined,
|
||||
sortType: undefined,
|
||||
totalNum: 0
|
||||
},
|
||||
timeshow: false,
|
||||
taskList: [],
|
||||
show_popup: false,
|
||||
title: '',
|
||||
taskList_son: [],
|
||||
loading: false,
|
||||
start_point: '',
|
||||
end_point: '',
|
||||
fab_go_points: [],
|
||||
reqCode: '',
|
||||
// 空车返程
|
||||
startOptions: [],
|
||||
endOptions: []
|
||||
import {
|
||||
getIngredientTask,
|
||||
getIngredientTask_son,
|
||||
getfabgopoints,
|
||||
go_workshop,
|
||||
emergency_stop_agv,
|
||||
getStartOptions,
|
||||
getEndOptions,
|
||||
FinisBatchingTask
|
||||
} from '@/api/materialManagement/MaterialRequsition.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: ['车间叫料', '空箱返程'],
|
||||
current: 0,
|
||||
queryParams: {
|
||||
workerorder_time: Number(new Date()),
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
sort: undefined,
|
||||
sortType: undefined,
|
||||
totalNum: 0
|
||||
},
|
||||
timeshow: false,
|
||||
taskList: [],
|
||||
show_popup: false,
|
||||
title: '',
|
||||
taskList_son: [],
|
||||
loading: false,
|
||||
start_point: '',
|
||||
end_point: '',
|
||||
fab_go_points: [],
|
||||
reqCode: '',
|
||||
// 空车返程
|
||||
startOptions: [],
|
||||
endOptions: [],
|
||||
agv_num_list: [
|
||||
{ value: '1743', text: '1号' },
|
||||
{ value: '1744', text: '2号' }
|
||||
],
|
||||
agv_num: ''
|
||||
};
|
||||
},
|
||||
watch: {},
|
||||
filters: {
|
||||
formatDate: function (value) {
|
||||
// 创建一个 Date 对象,并使用时间戳初始化
|
||||
const date = new Date(value);
|
||||
|
||||
// 提取年、月、日信息
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1; // 月份从 0 开始,所以要加 1
|
||||
const day = date.getDate();
|
||||
|
||||
return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getInitList();
|
||||
this.getSelectOptions();
|
||||
},
|
||||
methods: {
|
||||
// todo 分页查询
|
||||
getInitList() {
|
||||
// 使用时间戳创建一个日期对象
|
||||
let date = new Date(this.queryParams.workerorder_time);
|
||||
|
||||
// 获取上海时区的时间偏移量(以分钟为单位)
|
||||
let offset = 8 * 60; // 上海时区为 UTC+8
|
||||
|
||||
// 计算上海时区的时间
|
||||
let shanghaiTime = new Date(date.getTime() + offset * 60 * 1000);
|
||||
|
||||
let queryTask = {
|
||||
...this.queryParams
|
||||
};
|
||||
queryTask.datetimespan = shanghaiTime;
|
||||
delete queryTask.workerorder_time;
|
||||
getIngredientTask(queryTask).then((res) => {
|
||||
if (res.code == 200) {
|
||||
res.data.forEach((item, index) => {
|
||||
item.id = index;
|
||||
});
|
||||
this.taskList = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
watch: {},
|
||||
filters: {
|
||||
formatDate: function(value) {
|
||||
// 创建一个 Date 对象,并使用时间戳初始化
|
||||
const date = new Date(value);
|
||||
|
||||
// 提取年、月、日信息
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1; // 月份从 0 开始,所以要加 1
|
||||
const day = date.getDate();
|
||||
|
||||
return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;
|
||||
getSelectOptions() {
|
||||
getStartOptions().then((res) => {
|
||||
if (res.code === 200) {
|
||||
let _list = [];
|
||||
res.data.forEach((item) => {
|
||||
_list.push({
|
||||
value: item,
|
||||
text: item
|
||||
});
|
||||
});
|
||||
this.startOptions = _list;
|
||||
}
|
||||
});
|
||||
getEndOptions().then((res) => {
|
||||
if (res.code === 200) {
|
||||
let _list = [];
|
||||
res.data.forEach((item) => {
|
||||
_list.push({
|
||||
value: item,
|
||||
text: item
|
||||
});
|
||||
});
|
||||
this.endOptions = _list;
|
||||
}
|
||||
});
|
||||
this.get_fab_go_points();
|
||||
},
|
||||
sectionChange(index) {
|
||||
this.current = index;
|
||||
this.start_point = '';
|
||||
this.end_point = '';
|
||||
},
|
||||
// scrolltolower() {
|
||||
// this.loadmore();
|
||||
// },
|
||||
// loadmore() {
|
||||
// for (let i = 0; i < 30; i++) {
|
||||
// this.indexList.push({
|
||||
// url: this.urls[uni.$u.random(0, this.urls.length - 1)]
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
//todo 选择时间
|
||||
confirm() {
|
||||
this.timeshow = false;
|
||||
this.$nextTick(() => {
|
||||
this.getInitList();
|
||||
});
|
||||
},
|
||||
//todo 查看详细信息
|
||||
detail_item(taskId) {
|
||||
const query = {
|
||||
taskId: taskId
|
||||
};
|
||||
this.loading = true;
|
||||
getIngredientTask_son(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.loading = false;
|
||||
this.taskList_son = res.data;
|
||||
this.show_popup = true;
|
||||
this.title = '任务号:' + taskId;
|
||||
}
|
||||
});
|
||||
},
|
||||
//todo 确认起点
|
||||
confirm_startpoint(point) {
|
||||
this.start_point = point;
|
||||
},
|
||||
//todo获取车间点
|
||||
get_fab_go_points() {
|
||||
getfabgopoints().then((res) => {
|
||||
if (res.code == 200) {
|
||||
let array = [];
|
||||
res.data.forEach((item) => {
|
||||
array.push({
|
||||
value: item,
|
||||
text: item
|
||||
});
|
||||
});
|
||||
this.fab_go_points = array;
|
||||
}
|
||||
});
|
||||
},
|
||||
//todo 开始agv
|
||||
start_agv() {
|
||||
if (this.start_point == '' || this.end_point == '') {
|
||||
this.$refs.uToast.show({
|
||||
type: 'error',
|
||||
message: '起点或者终点不能为空'
|
||||
});
|
||||
return;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getInitList();
|
||||
this.getSelectOptions();
|
||||
},
|
||||
methods: {
|
||||
// todo 分页查询
|
||||
getInitList() {
|
||||
// 使用时间戳创建一个日期对象
|
||||
let date = new Date(this.queryParams.workerorder_time);
|
||||
|
||||
// 获取上海时区的时间偏移量(以分钟为单位)
|
||||
let offset = 8 * 60; // 上海时区为 UTC+8
|
||||
|
||||
// 计算上海时区的时间
|
||||
let shanghaiTime = new Date(date.getTime() + offset * 60 * 1000);
|
||||
|
||||
let queryTask = {
|
||||
...this.queryParams
|
||||
};
|
||||
queryTask.datetimespan = shanghaiTime;
|
||||
delete queryTask.workerorder_time;
|
||||
getIngredientTask(queryTask).then((res) => {
|
||||
if (res.code == 200) {
|
||||
res.data.forEach((item, index) => {
|
||||
item.id = index;
|
||||
});
|
||||
this.taskList = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
getSelectOptions() {
|
||||
getStartOptions().then(res => {
|
||||
if (res.code === 200) {
|
||||
let _list = [];
|
||||
res.data.forEach(item => {
|
||||
_list.push({
|
||||
value: item,
|
||||
text: item
|
||||
})
|
||||
})
|
||||
this.startOptions = _list;
|
||||
}
|
||||
})
|
||||
getEndOptions().then(res => {
|
||||
if (res.code === 200) {
|
||||
let _list = [];
|
||||
res.data.forEach(item => {
|
||||
_list.push({
|
||||
value: item,
|
||||
text: item
|
||||
})
|
||||
})
|
||||
this.endOptions = _list;
|
||||
}
|
||||
})
|
||||
this.get_fab_go_points();
|
||||
},
|
||||
sectionChange(index) {
|
||||
this.current = index;
|
||||
this.start_point = '';
|
||||
this.end_point = '';
|
||||
},
|
||||
// scrolltolower() {
|
||||
// this.loadmore();
|
||||
// },
|
||||
// loadmore() {
|
||||
// for (let i = 0; i < 30; i++) {
|
||||
// this.indexList.push({
|
||||
// url: this.urls[uni.$u.random(0, this.urls.length - 1)]
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
//todo 选择时间
|
||||
confirm() {
|
||||
this.timeshow = false;
|
||||
this.$nextTick(() => {
|
||||
this.getInitList();
|
||||
});
|
||||
},
|
||||
//todo 查看详细信息
|
||||
detail_item(taskId) {
|
||||
const query = {
|
||||
taskId: taskId
|
||||
};
|
||||
this.loading = true;
|
||||
getIngredientTask_son(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.loading = false;
|
||||
this.taskList_son = res.data;
|
||||
this.show_popup = true;
|
||||
this.title = '任务号:' + taskId;
|
||||
}
|
||||
});
|
||||
},
|
||||
//todo 确认起点
|
||||
confirm_startpoint(point) {
|
||||
this.start_point = point;
|
||||
|
||||
},
|
||||
//todo获取车间点
|
||||
get_fab_go_points() {
|
||||
getfabgopoints().then((res) => {
|
||||
if (res.code == 200) {
|
||||
let array = [];
|
||||
res.data.forEach((item) => {
|
||||
array.push({
|
||||
value: item,
|
||||
text: item
|
||||
});
|
||||
});
|
||||
this.fab_go_points = array;
|
||||
}
|
||||
});
|
||||
},
|
||||
//todo 开始agv
|
||||
start_agv() {
|
||||
if (this.start_point == '' || this.end_point == '') {
|
||||
this.$refs.uToast.show({
|
||||
type: 'error',
|
||||
message: '起点或者终点不能为空'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const query = {
|
||||
start_point: this.start_point,
|
||||
end_point: this.end_point
|
||||
};
|
||||
go_workshop(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
try {
|
||||
let json = JSON.parse(res.data);
|
||||
this.reqCode = json.data;
|
||||
this.$refs.uToast.show({
|
||||
type: 'success',
|
||||
message: 'agv起动成功' + this.reqCode
|
||||
});
|
||||
} catch (e) {
|
||||
this.$refs.uToast.show({
|
||||
type: 'error',
|
||||
message: 'agv起动失败:' + this.reqCode
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//todo 紧急终止agv
|
||||
stop_agv() {
|
||||
if (this.reqCode === '' || this.reqCode === null || this.reqCode === undefined) {
|
||||
this.$refs.uToast.show({
|
||||
type: 'error',
|
||||
message: '无任务编号'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// const query = {
|
||||
// reqCode: this.reqCode
|
||||
// };
|
||||
|
||||
const query = {
|
||||
reqCode: this.reqCode
|
||||
};
|
||||
|
||||
emergency_stop_agv(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
const query = {
|
||||
start_point: this.start_point,
|
||||
end_point: this.end_point,
|
||||
agvCode: this.agv_num
|
||||
};
|
||||
go_workshop(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
try {
|
||||
let json = JSON.parse(res.data);
|
||||
this.reqCode = json.data;
|
||||
this.$refs.uToast.show({
|
||||
type: 'success',
|
||||
message: '成功取消' + res.data
|
||||
message: 'agv起动成功' + this.reqCode
|
||||
});
|
||||
} catch (e) {
|
||||
this.$refs.uToast.show({
|
||||
type: 'error',
|
||||
message: 'agv起动失败:' + this.reqCode
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//todo 紧急终止agv
|
||||
stop_agv() {
|
||||
if (this.reqCode === '' || this.reqCode === null || this.reqCode === undefined) {
|
||||
this.$refs.uToast.show({
|
||||
type: 'error',
|
||||
message: '无任务编号'
|
||||
});
|
||||
},
|
||||
|
||||
//todo 完成任务
|
||||
final_task(taskid) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否确定完成任务?',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '确定',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
let query = {
|
||||
start_point: this.start_point,
|
||||
end_point: this.end_point,
|
||||
taskId: taskid
|
||||
}
|
||||
FinisBatchingTask(query).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.getInitList();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
// const query = {
|
||||
// reqCode: this.reqCode
|
||||
// };
|
||||
|
||||
const query = {
|
||||
reqCode: this.reqCode
|
||||
};
|
||||
|
||||
emergency_stop_agv(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$refs.uToast.show({
|
||||
type: 'success',
|
||||
message: '成功取消' + res.data
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//todo 完成任务
|
||||
final_task(taskid) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否确定完成任务?',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '确定',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
let query = {
|
||||
start_point: this.start_point,
|
||||
end_point: this.end_point,
|
||||
taskId: taskid
|
||||
};
|
||||
FinisBatchingTask(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.getInitList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.area {
|
||||
height: 350px;
|
||||
background-color: white;
|
||||
.area {
|
||||
height: 350px;
|
||||
background-color: white;
|
||||
|
||||
overflow: hidden;
|
||||
/* 隐藏超出部分 */
|
||||
overflow-y: scroll;
|
||||
/* 添加垂直滚动条 */
|
||||
}
|
||||
overflow: hidden;
|
||||
/* 隐藏超出部分 */
|
||||
overflow-y: scroll;
|
||||
/* 添加垂直滚动条 */
|
||||
}
|
||||
|
||||
.cartoon-list-item {
|
||||
background-color: #c8d3db;
|
||||
/* 设置蓝色背景 */
|
||||
padding: 10px;
|
||||
/* 设置内边距 */
|
||||
border-radius: 10px;
|
||||
/* 设置圆角边框 */
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
/* 添加阴影效果 */
|
||||
margin-bottom: 10px;
|
||||
/* 设置底部外边距 */
|
||||
font-family: 'Comic Sans MS', cursive;
|
||||
/* 设置卡通化字体 */
|
||||
color: white;
|
||||
/* 设置文字颜色为白色 */
|
||||
}
|
||||
.cartoon-list-item {
|
||||
background-color: #c8d3db;
|
||||
/* 设置蓝色背景 */
|
||||
padding: 10px;
|
||||
/* 设置内边距 */
|
||||
border-radius: 10px;
|
||||
/* 设置圆角边框 */
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
/* 添加阴影效果 */
|
||||
margin-bottom: 10px;
|
||||
/* 设置底部外边距 */
|
||||
font-family: 'Comic Sans MS', cursive;
|
||||
/* 设置卡通化字体 */
|
||||
color: white;
|
||||
/* 设置文字颜色为白色 */
|
||||
}
|
||||
|
||||
.cartoon-list-item:hover {
|
||||
transform: scale(1.05);
|
||||
/* 鼠标悬停时放大 */
|
||||
}
|
||||
.cartoon-list-item:hover {
|
||||
transform: scale(1.05);
|
||||
/* 鼠标悬停时放大 */
|
||||
}
|
||||
|
||||
.tip-box {
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
background-color: #fff;
|
||||
/* 白色背景 */
|
||||
padding: 20px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
/* 添加阴影 */
|
||||
}
|
||||
.tip-box {
|
||||
width: 100%;
|
||||
margin-top: 5px;
|
||||
background-color: #fff;
|
||||
/* 白色背景 */
|
||||
padding: 20px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
/* 添加阴影 */
|
||||
}
|
||||
.tip-icon-small {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background-color: #00ff00;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
/* 添加阴影 */
|
||||
}
|
||||
|
||||
.tip-icon {
|
||||
margin-top: 5px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background-color: #00ff00;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 24px;
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
/* 添加阴影 */
|
||||
}
|
||||
.tip-icon {
|
||||
margin-top: 5px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background-color: #00ff00;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 24px;
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
/* 添加阴影 */
|
||||
}
|
||||
|
||||
.tip-icon2 {
|
||||
margin-top: 5px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background-color: red;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 24px;
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
/* 添加阴影 */
|
||||
}
|
||||
.tip-icon2 {
|
||||
margin-top: 5px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background-color: red;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 24px;
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
/* 添加阴影 */
|
||||
}
|
||||
|
||||
.tip-text {
|
||||
margin-top: 10px;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
}
|
||||
</style>
|
||||
.tip-text {
|
||||
margin-top: 10px;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -3,20 +3,24 @@
|
||||
<view :key="1">
|
||||
<view class="tip-box">
|
||||
<u-row :gutter="20">
|
||||
<u-col span="2">
|
||||
<u-text text="起点" size="48"></u-text>
|
||||
<u-col span="1">
|
||||
<u-text text="起点" size="32"></u-text>
|
||||
</u-col>
|
||||
<u-col span="4">
|
||||
<u-col span="3">
|
||||
<uni-data-select v-model="start_point" :localdata="startOptions"
|
||||
placeholder="请选择起点"></uni-data-select>
|
||||
</u-col>
|
||||
<u-col span="2">
|
||||
<u-text text="终点" size="48"></u-text>
|
||||
<u-col span="1">
|
||||
<u-text text="终点" size="32"></u-text>
|
||||
</u-col>
|
||||
<u-col span="4">
|
||||
<u-col span="3">
|
||||
<uni-data-select v-model="end_point" :localdata="endOptions"
|
||||
placeholder="请选择终点"></uni-data-select>
|
||||
</u-col>
|
||||
<u-col span="1" offset="0.5">agv</u-col>
|
||||
<u-col span="3">
|
||||
<uni-data-select v-model="agv_num" :localdata="agv_num_list"></uni-data-select>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<u-gap height="20"></u-gap>
|
||||
<u-row>
|
||||
@ -47,7 +51,9 @@
|
||||
startOptions: [],
|
||||
end_point: '',
|
||||
endOptions: [],
|
||||
reqCode: ''
|
||||
reqCode: '',
|
||||
agv_num_list:[{value:"1743",text:"1号"},{value:"1744",text:"2号"}],
|
||||
agv_num:""
|
||||
};
|
||||
},
|
||||
watch: {},
|
||||
@ -84,7 +90,8 @@
|
||||
}
|
||||
const query = {
|
||||
start_point: this.start_point,
|
||||
end_point: this.end_point
|
||||
end_point: this.end_point,
|
||||
agvCode:this.agv_num
|
||||
};
|
||||
go_workshop(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user