纽迪希亚平板
This commit is contained in:
71
pages/home/home.vue
Normal file
71
pages/home/home.vue
Normal file
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<view class="home_content">
|
||||
<nav-bar title="首页"></nav-bar>
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row menu-wrap">
|
||||
<view class="menu-item" v-for="(e, i) in menuList" :key="e.id" @tap="toPage(e)">
|
||||
<image class="menu-img" :style="{'background-color': ['#ff814a', '#4982fd'][i]}" :src="require('../../static/images/menu/' + e.icon + '.png')" alt="">
|
||||
<view class="menu-name">{{e.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
userName: this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).person_name : '',
|
||||
menuList: [
|
||||
{id: 1, title: '工单管理', icon: 'RF1', path: '/pages/management/order-detail'},
|
||||
{id: 2, title: '退桶任务', icon: 'RF2', path: '/pages/management/call-task'},
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
toPage (e) {
|
||||
let url = e.path + '?title=' + e.title
|
||||
uni.redirectTo({
|
||||
url: url
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
@import '../../common/style/mixin.styl';
|
||||
.home_content
|
||||
_wh(100%, 100%)
|
||||
padding 2.07rem 0.4rem 1.4rem 0.4rem
|
||||
_bis(,'../../static/images/home_bg.jpg', 100%, 100%,bottom)
|
||||
.zd_wrapper
|
||||
_wh(100%,100%)
|
||||
padding 0.37rem 0.4rem 0.4rem 0.4rem
|
||||
_bis(,'../../static/images/bg-task-r2.png', 100%, 100%,center)
|
||||
.menu-wrap
|
||||
flex-wrap wrap
|
||||
justify-content center
|
||||
align-content center
|
||||
height 100%
|
||||
|
||||
.menu-item
|
||||
width 25%
|
||||
padding 0 2%
|
||||
::v-deep .menu-img
|
||||
display block
|
||||
_wh(90px, auto)
|
||||
margin 0 auto
|
||||
img
|
||||
position relative
|
||||
opacity 1
|
||||
width 100%
|
||||
.menu-name
|
||||
margin-top .6rem
|
||||
_font(.4rem, .4rem, #00a7ea, 700,center)
|
||||
</style>
|
||||
173
pages/login/login.vue
Normal file
173
pages/login/login.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<view class="login-bg relative">
|
||||
<view class="logo-wrap"><h1>ACS</h1></view>
|
||||
<view class="login_wrap">
|
||||
<view class="login_w">
|
||||
<view class="login_tab">
|
||||
<view class="login_tab_item login_tab_active">配置</view>
|
||||
</view>
|
||||
<view class="login_cnt">
|
||||
<view class="login_card">
|
||||
<view class="zd-row card_wrap">
|
||||
<view class="zd-col-4 login_label">域名</view>
|
||||
<view class="zd-col-20">
|
||||
<input type="text" placeholder="域名地址" v-model="baseUrl" class="inputStyle">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<button class="primary-button" @tap="toConfig">配置</button>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<text class="zd-col-24 san_text" @tap="isUpdate">升级版本</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="daoying_bg"></view>
|
||||
</view>
|
||||
<view v-if="version !== ''" class="version-name">v{{version}}</view>
|
||||
<Up-grade v-if="grade === true" @closeUpdate="closeUpdate" :androidUrl="androidUrl"></up-grade>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { RSAencrypt } from '@/utils/jsencrypt.js'
|
||||
import {handLogin, pdaUpdate} from '@/utils/getData2.js'
|
||||
import permision from "@/utils/permission.js"
|
||||
import UpGrade from './upgrade.vue'
|
||||
export default {
|
||||
components: {
|
||||
UpGrade
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loginname: this.$store.getters.loginName,
|
||||
password: '',
|
||||
baseUrl: this.$store.getters.baseUrl,
|
||||
setTime: this.$store.getters.setTime / 1000,
|
||||
inputType: 'password',
|
||||
eyeOpen: true,
|
||||
drift: 0,
|
||||
disabled: false,
|
||||
jobnum: '',
|
||||
qrcode: '',
|
||||
logintype: '',
|
||||
version: '',
|
||||
versionCode: '',
|
||||
grade: false,
|
||||
androidUrl: ''
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
toConfig () {
|
||||
let obj = {
|
||||
baseUrl: this.baseUrl,
|
||||
setTime: this.setTime * 1000
|
||||
}
|
||||
this.$store.dispatch('setConfig', obj)
|
||||
uni.redirectTo({
|
||||
url: '/pages/home/home'
|
||||
})
|
||||
},
|
||||
isUpdate () {
|
||||
this._pdaUpdate()
|
||||
},
|
||||
async _pdaUpdate () {
|
||||
let res = await pdaUpdate()
|
||||
if (res.code === 1) {
|
||||
this.grade = true
|
||||
this.androidUrl = res.result[0].url
|
||||
console.log(this.androidUrl)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
closeUpdate () {
|
||||
this.grade = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '../../common/style/mixin.styl';
|
||||
.login-bg
|
||||
_wh(100%, 100%)
|
||||
_bis(#fff,'../../static/images/page_bg.jpg', 100%, 100%,bottom)
|
||||
.logo-wrap
|
||||
position fixed
|
||||
_wh(100%, 1.25rem)
|
||||
_bis(,'../../static/images/login_header_bg.png', 16.82rem, 100%,bottom)
|
||||
h1
|
||||
_font(.8rem, 1rem, #CF6A46,,center)
|
||||
font-family 'YouSheBiaoTiHei'
|
||||
.login_wrap
|
||||
position fixed
|
||||
left 50%
|
||||
top 50%
|
||||
width 9rem
|
||||
padding .87rem .85rem .82rem .98rem
|
||||
transform translate3d(-50%, -50%, 0)
|
||||
_bis(,'../../static/images/form_bg.png', 100%, 100%,bottom)
|
||||
.login_w
|
||||
_wh(100%, 100%)
|
||||
overflow hidden
|
||||
.login_tab
|
||||
height 1.07rem
|
||||
margin-bottom .51rem
|
||||
_bis(,'../../static/images/login_tabs_bg.png', 100%, 100%,bottom)
|
||||
.login_tab_item
|
||||
_wh(2.7rem, .73rem)
|
||||
_font(.4rem,.73rem,#99B1DD,,center)
|
||||
font-family 'YouSheBiaoTiHei'
|
||||
.login_tab_active
|
||||
color #fff
|
||||
_bis(,'../../static/images/login_tab_active.png', 100%, 100%,bottom)
|
||||
.login_cnt
|
||||
100%
|
||||
.login_card
|
||||
width 100%
|
||||
padding 0 .41rem
|
||||
.card_wrap
|
||||
margin-bottom .52rem
|
||||
.login_label
|
||||
_font(.3rem, .8rem, #AFBED8,700,)
|
||||
.inputStyle
|
||||
_font(.3rem, .8rem, #fff,,)
|
||||
_wh(100%, .8rem)
|
||||
background: rgba(45,88,184,0.1);
|
||||
border: 1px solid #4980BD;
|
||||
padding 0 .22rem
|
||||
.inputStyle[focus]
|
||||
background: rgba(45,88,184,0.25);
|
||||
border: 1px solid #21D0F2;
|
||||
line-height .8rem
|
||||
.login_icon
|
||||
position absolute
|
||||
top 5px
|
||||
right 10px
|
||||
.primary-button
|
||||
_wh(3.36rem, .93rem)
|
||||
_font(.48rem,.93rem,#fff,,center)
|
||||
font-family 'YouSheBiaoTiHei'
|
||||
_bis(,'../../static/images/button.png', 100%, 100%,bottom)
|
||||
.san_text
|
||||
margin-top .4rem
|
||||
_font(0.34rem,0.34rem,#fff,,center)
|
||||
.drift
|
||||
transition left .3s linear
|
||||
.version-name
|
||||
width 100%
|
||||
position: absolute
|
||||
bottom 3%
|
||||
_font(15px, 30px, #fff,,center)
|
||||
.daoying_bg
|
||||
position: absolute
|
||||
bottom -30%
|
||||
left 0
|
||||
_wh(100%, 30%)
|
||||
_bis(,'../../static/images/daoy.png', 100%, 100%,bottom)
|
||||
</style>
|
||||
229
pages/login/upgrade.vue
Normal file
229
pages/login/upgrade.vue
Normal file
@@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<view class="mask flex-center">
|
||||
<view class="content-update botton-radius">
|
||||
<view class="content-top">
|
||||
<text class="content-top-text">发现新版本</text>
|
||||
<image class="content-top" style="top: 0;" width="100%" height="100%" src="../../static/images/bg_top.png">
|
||||
</image>
|
||||
</view>
|
||||
<view class="content-header"></view>
|
||||
<view class="content-body">
|
||||
<view class="title">
|
||||
<text>特科拉ACS系统又有新版本了,升级到最新版本,享受更丰富、稳定、快速的功能和体验!</text>
|
||||
</view>
|
||||
<view class="footer flex-center">
|
||||
<template>
|
||||
<template v-if="!downloadSuccess">
|
||||
<view class="progress-box flex-column" v-if="downloading">
|
||||
<progress class="progress" border-radius="35" :percent="downLoadPercent" activeColor="#3DA7FF" show-info stroke-width="10" />
|
||||
<view style="width:100%;font-size: 14px;display: flex;justify-content: space-around;">
|
||||
<text>安装包下载中,请稍后</text>
|
||||
<text>({{downloadedSize}}/{{packageFileSize}}M)</text>
|
||||
</view>
|
||||
</view>
|
||||
<button v-else class="content-button" style="border: none;color: #fff;" plain @click="updateApp">立即升级</button>
|
||||
</template>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<image v-if="is_mandatory" class="close-img" src="../../static/images/app_update_close.png" @click.stop="closeUpdate"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
downloadSuccess: false,
|
||||
downloading: false,
|
||||
downLoadPercent: 0,
|
||||
downloadedSize: 0,
|
||||
packageFileSize: 0,
|
||||
is_mandatory: true
|
||||
}
|
||||
},
|
||||
props: {
|
||||
androidUrl: String
|
||||
},
|
||||
methods: {
|
||||
updateApp() {
|
||||
this.is_mandatory = false
|
||||
this.downloading = true
|
||||
this.doUpData(this.androidUrl);
|
||||
},
|
||||
doUpData(Url) {
|
||||
const downloadTask = uni.downloadFile({
|
||||
url: Url,
|
||||
success: downloadResult => {
|
||||
if (downloadResult.statusCode == 200) {
|
||||
this.downloadSuccess = true;
|
||||
plus.runtime.install(
|
||||
//安装软件
|
||||
downloadResult.tempFilePath,
|
||||
{
|
||||
force: true
|
||||
},
|
||||
function(res) {
|
||||
plus.runtime.restart();
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
complete: () => {
|
||||
this.downloading = false;
|
||||
this.downLoadPercent = 0
|
||||
this.downloadedSize = 0
|
||||
this.packageFileSize = 0
|
||||
}
|
||||
});
|
||||
// 下载进度
|
||||
downloadTask.onProgressUpdate(res => {
|
||||
this.downLoadPercent = res.progress;
|
||||
this.downloadedSize = (res.totalBytesWritten / Math.pow(1024, 2)).toFixed(2);
|
||||
this.packageFileSize = (res.totalBytesExpectedToWrite / Math.pow(1024, 2)).toFixed(2);
|
||||
});
|
||||
},
|
||||
closeUpdate () {
|
||||
this.$emit('closeUpdate')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.flex-center {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.mask {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, .65);
|
||||
}
|
||||
|
||||
.botton-radius {
|
||||
border-bottom-left-radius: 15px;
|
||||
border-bottom-right-radius: 15px;
|
||||
}
|
||||
|
||||
.content-update {
|
||||
position: relative;
|
||||
top: 0;
|
||||
width: 300px;
|
||||
background-color: #fff;
|
||||
box-sizing: border-box;
|
||||
padding: 0 20px;
|
||||
font-family: Source Han Sans CN;
|
||||
}
|
||||
|
||||
.text {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: block;
|
||||
/* #endif */
|
||||
line-height: 200px;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.content-top {
|
||||
position: absolute;
|
||||
top: -97.5px;
|
||||
left: 0;
|
||||
width: 300px;
|
||||
height: 135px;
|
||||
}
|
||||
|
||||
.content-top-text {
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
color: #F8F8FA;
|
||||
position: absolute;
|
||||
top: 60px;
|
||||
left: 25px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #3DA7FF;
|
||||
line-height: 20px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.footer {
|
||||
height: 75px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.box-des-scroll {
|
||||
box-sizing: border-box;
|
||||
padding: 0 20px;
|
||||
height: 25px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.box-des {
|
||||
font-size: 13px;
|
||||
color: #000000;
|
||||
line-height: 50px;
|
||||
}
|
||||
|
||||
.progress-box {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.progress {
|
||||
width: 90%;
|
||||
height: 20px;
|
||||
border-radius: 13px;
|
||||
}
|
||||
|
||||
.close-img {
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
z-index: 1000;
|
||||
position: absolute;
|
||||
bottom: -60px;
|
||||
left: calc(50% - 35px / 2);
|
||||
}
|
||||
|
||||
.content-button {
|
||||
text-align: center;
|
||||
flex: 1;
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
border-radius: 20px;
|
||||
margin: 0 10px;
|
||||
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
|
||||
background: linear-gradient(to right, #1785ff, #3DA7FF);
|
||||
}
|
||||
|
||||
.flex-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
68
pages/management/call-task.vue
Normal file
68
pages/management/call-task.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<view class="contianer">
|
||||
<nav-bar type="2" title="退桶任务"></nav-bar>
|
||||
<view class="contianer content">
|
||||
<view class="zd-row jcenter contianer">
|
||||
<view class="setup-wrap">
|
||||
<view class="zd-row filter-item">
|
||||
<view class="zd-col-6 filter-label">起 点</view>
|
||||
<view class="zd-col-18 filter-select">
|
||||
<uni-data-select v-model="val1" :localdata="options"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row jcenter button-wrap">
|
||||
<button class="button btn-primary" :class="{'btn-info': !val1}" :disabled="disabled" @click="_callTask">生成任务</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
// import {queryDevices} from '@/utils/mork2.js'
|
||||
import {queryDevices, callTask} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
val1: '',
|
||||
options: [],
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
mounted () {
|
||||
this._queryDevices()
|
||||
},
|
||||
methods: {
|
||||
async _queryDevices () {
|
||||
let res = await queryDevices()
|
||||
this.options = [...res]
|
||||
this.options.map(el => {
|
||||
this.$set(el, 'text', el.device_name)
|
||||
this.$set(el, 'value', el.device_code)
|
||||
})
|
||||
},
|
||||
async _callTask () {
|
||||
this.disabled = true
|
||||
try {
|
||||
let res = await callTask(this.val1)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'success'
|
||||
})
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
|
||||
</style>
|
||||
160
pages/management/order-detail.vue
Normal file
160
pages/management/order-detail.vue
Normal file
@@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<view class="contianer">
|
||||
<nav-bar type="2" title="工单明细"></nav-bar>
|
||||
<view class="contianer content">
|
||||
<view class="contianer content_wraper">
|
||||
<view class="contianer mgt2 grid_wraper">
|
||||
<table>
|
||||
<tr>
|
||||
<th>工单编码</th>
|
||||
<th>产品编号</th>
|
||||
<th>产品名称</th>
|
||||
<th>计划重量</th>
|
||||
<th>产线</th>
|
||||
<th>开工时间</th>
|
||||
<th><div style="width: 3.1rem">起点编码</div></th>
|
||||
<th><div style="width: 3.1rem">终点编码</div></th>
|
||||
<th>工单状态</th>
|
||||
<th style="text-align: center">操作</th>
|
||||
</tr>
|
||||
<tr v-for="(e, i) in dataList" :key="i">
|
||||
<td>{{ e.mfg_order_name }}</td>
|
||||
<td>{{ e.product_name }}</td>
|
||||
<td>{{ e.description }}</td>
|
||||
<td>{{ e.total_qty }}</td>
|
||||
<td>{{ e.resource_name }}</td>
|
||||
<td>{{ e.realstart_time }}</td>
|
||||
<td>
|
||||
<div class="filter-select">
|
||||
<uni-data-select v-model="e.start_device_code" :localdata="options"></uni-data-select>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="filter-select">
|
||||
<uni-data-select v-model="e.next_device_code" :localdata="options"></uni-data-select>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{ e.status }}</td>
|
||||
<td>
|
||||
<div class="zd-row btn_wraper">
|
||||
<button class="grid_button" :class="{'grid_button_disabled': e.checked && disabled3}" :disabled="disabled3" @click="_updateOrder(e)">修改</button>
|
||||
<button v-if="e.status === '执行中'" class="grid_button" @click="toJump(e)">执行中</button>
|
||||
<button v-else class="grid_button" :class="{'grid_button_disabled': e.checked && disabled1}" :disabled="disabled1" @click="_startOrder(e)">开始</button>
|
||||
<button class="grid_button" :class="{'grid_button_disabled': e.checked && disabled2}" :disabled="disabled2" @click="_forceFinish(e)">强制完成</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
// import {queryDevices, queryOrders, updateOrder, startOrder} from '@/utils/mork2.js'
|
||||
// import {forceFinish} from '@/utils/getData2.js'
|
||||
import {queryDevices, queryOrders, updateOrder, startOrder, forceFinish} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: '',
|
||||
options: [],
|
||||
dataList: [],
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false
|
||||
};
|
||||
},
|
||||
mounted () {
|
||||
this._queryDevices()
|
||||
},
|
||||
onShow () {
|
||||
this._queryOrders()
|
||||
},
|
||||
methods: {
|
||||
async _queryDevices () {
|
||||
let res = await queryDevices()
|
||||
this.options = [...res]
|
||||
this.options.map(el => {
|
||||
this.$set(el, 'text', el.device_name)
|
||||
this.$set(el, 'value', el.device_code)
|
||||
})
|
||||
},
|
||||
async _queryOrders () {
|
||||
let res = await queryOrders()
|
||||
this.dataList = [...res]
|
||||
this.dataList.map(el => {
|
||||
this.$set(el, 'checked', false)
|
||||
})
|
||||
},
|
||||
async _updateOrder (e) {
|
||||
this.disabled3 = true
|
||||
e.checked = true
|
||||
try {
|
||||
let res = await updateOrder(e.start_device_code, e.next_device_code, e.mfg_order_name)
|
||||
this._queryOrders()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'success'
|
||||
})
|
||||
this.disabled3 = false
|
||||
e.checked = false
|
||||
} catch (e) {
|
||||
this.disabled3 = false
|
||||
e.checked = false
|
||||
}
|
||||
},
|
||||
async _startOrder (e) {
|
||||
this.disabled1 = true
|
||||
e.checked = true
|
||||
try {
|
||||
let res = await startOrder(e.mfg_order_name)
|
||||
if (res.message) {
|
||||
this.disabled1 = false
|
||||
e.checked = false
|
||||
uni.navigateTo({
|
||||
url: '/pages/management/task?order=' + e.mfg_order_name
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
e.checked = false
|
||||
}
|
||||
},
|
||||
toJump (e) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/management/task?order=' + e.mfg_order_name
|
||||
})
|
||||
},
|
||||
async _forceFinish (e) {
|
||||
this.disabled2 = true
|
||||
e.checked = true
|
||||
try {
|
||||
let res = await forceFinish(e.mfg_order_name)
|
||||
this._queryOrders(this.value)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'success'
|
||||
})
|
||||
this.disabled2 = false
|
||||
e.checked = false
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
e.checked = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.btn_wraper
|
||||
width 3.4rem
|
||||
.filter-select
|
||||
width 3.1rem
|
||||
</style>
|
||||
215
pages/management/task.vue
Normal file
215
pages/management/task.vue
Normal file
@@ -0,0 +1,215 @@
|
||||
<template>
|
||||
<view class="contianer">
|
||||
<nav-bar type="3" title="配料作业"></nav-bar>
|
||||
<view class="contianer content">
|
||||
<view class="contianer content_wraper">
|
||||
<view class="contianer mgt2 grid_wraper">
|
||||
<table>
|
||||
<tr>
|
||||
<th>工单编码</th>
|
||||
<th>序号</th>
|
||||
<th>物料编码</th>
|
||||
<th>物料名称</th>
|
||||
<th>产线</th>
|
||||
<th>终点编码</th>
|
||||
<th>配料桶数</th>
|
||||
<th>剩余桶数</th>
|
||||
<th>物料重量</th>
|
||||
<th>状态</th>
|
||||
<th style="text-align: center">操作</th>
|
||||
</tr>
|
||||
<tr v-for="(e, i) in dataList" :key="i">
|
||||
<td>{{ e.mfg_order_name }}</td>
|
||||
<td>{{ e.seq_no }}</td>
|
||||
<td>{{ e.material_code }}</td>
|
||||
<td>{{ e.material_name }}</td>
|
||||
<td>{{ e.resource_name }}</td>
|
||||
<td>{{ e.next_device_code }}</td>
|
||||
<td>{{ e.require_num }}</td>
|
||||
<td>{{ e.remain_num }}</td>
|
||||
<td>{{ e.qty }}</td>
|
||||
<td>{{ e.status }}</td>
|
||||
<td>
|
||||
<div class="zd-row btn_wraper">
|
||||
<button class="grid_button" :class="{'grid_button_disabled': e.checked && disabled1}" :disabled="disabled1" @tap="_sendWork(e)">下发</button>
|
||||
<button class="grid_button" :class="{'grid_button_disabled': e.checked && disabled2}" :disabled="disabled2" @tap="openDialog(e)">补发</button>
|
||||
<button class="grid_button" :class="{'grid_button_disabled': e.checked && disabled3}" :disabled="disabled3" @tap="_pdaPause(e)">暂停</button>
|
||||
<button class="grid_button" :class="{'grid_button_disabled': e.checked && disabled4}" :disabled="disabled4" @tap="_finishWork(e)">完成</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="dialog__wrapper" :class="dialogVisible ? 'popshow' : 'pophide'">
|
||||
<view class="dialog">
|
||||
<view class="dialog__body">
|
||||
<view class="zd-row filter-item">
|
||||
<view class="zd-col-6 filter-label">补发桶数</view>
|
||||
<view class="zd-col-17">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-2 icon-plus" @tap="decrement">-</view>
|
||||
<input type="number" class="zd-col-20 filter-input" v-model.number="inputNumber" @input="handleInput" placeholder="请输入数字">
|
||||
<view class="zd-col-2 icon-plus" @tap="increment">+</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row jcenter button-wrap">
|
||||
<button class="zd-col-4 button_cancle" @click="dialogVisible = false">取 消</button>
|
||||
<button class="zd-col-4 button_primary" @click="handleConfirm">确 定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <el-dialog :visible.sync="dialogVisible">
|
||||
<div class="zd-row filter-item">
|
||||
<div class="zd-col-6 filter-label">补发桶数</div>
|
||||
<el-input-number class="zd-col-17" v-model="inputNumber" :min="1" label="请输入数字"></el-input-number>
|
||||
</div>
|
||||
<div class="zd-row jcenter button-wrap">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleConfirm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
// import {queryWorks} from '@/utils/mork2.js'
|
||||
import {queryWorks, sendWork, reSendWork, pdaPause, finishWork} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
order: '',
|
||||
dataList: [],
|
||||
pkObj: '',
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false,
|
||||
disabled4: false,
|
||||
dialogVisible: false,
|
||||
inputNumber: 1
|
||||
};
|
||||
},
|
||||
mounted () {
|
||||
this._queryWorks()
|
||||
},
|
||||
onLoad (options) {
|
||||
this.order = options.order
|
||||
},
|
||||
methods: {
|
||||
decrement () {
|
||||
if (this.inputNumber > 1) {
|
||||
this.inputNumber -= 1
|
||||
}
|
||||
},
|
||||
increment () {
|
||||
this.inputNumber += 1
|
||||
},
|
||||
handleInput(event) {
|
||||
const value = event.target.value
|
||||
if (value === "" || Number(value) >= 1) {
|
||||
this.inputNumber = Math.floor(Number(value))
|
||||
} else {
|
||||
this.inputNumber = 1
|
||||
}
|
||||
},
|
||||
async _queryWorks () {
|
||||
let res = await queryWorks(this.order)
|
||||
this.dataList = [...res]
|
||||
this.dataList.map(el => {
|
||||
this.$set(el, 'checked', false)
|
||||
})
|
||||
},
|
||||
async _sendWork (e) {
|
||||
this.disabled1 = true
|
||||
e.checked = true
|
||||
try {
|
||||
let res = await sendWork(e.work_code)
|
||||
this._queryWorks()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'success'
|
||||
})
|
||||
this.disabled1 = false
|
||||
e.checked = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
e.checked = false
|
||||
}
|
||||
},
|
||||
async _reSendWork (e, num) {
|
||||
this.disabled2 = true
|
||||
e.checked = true
|
||||
try {
|
||||
let res = await reSendWork(e.work_code, num)
|
||||
this._queryWorks()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'success'
|
||||
})
|
||||
this.disabled2 = false
|
||||
e.checked = false
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
e.checked = false
|
||||
}
|
||||
},
|
||||
async _pdaPause (e) {
|
||||
this.disabled3 = true
|
||||
e.checked = true
|
||||
try {
|
||||
let res = await pdaPause(e.work_code)
|
||||
this._queryWorks()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'success'
|
||||
})
|
||||
this.disabled3 = false
|
||||
e.checked = false
|
||||
} catch (e) {
|
||||
this.disabled3 = false
|
||||
e.checked = false
|
||||
}
|
||||
},
|
||||
async _finishWork (e) {
|
||||
this.disabled4 = true
|
||||
e.checked = true
|
||||
try {
|
||||
let res = await finishWork(e.work_code)
|
||||
this._queryWorks()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'success'
|
||||
})
|
||||
this.disabled4 = false
|
||||
e.checked = false
|
||||
} catch (e) {
|
||||
this.disabled4 = false
|
||||
e.checked = false
|
||||
}
|
||||
},
|
||||
openDialog (e) {
|
||||
this.dialogVisible = true
|
||||
this.inputNumber = 1
|
||||
this.pkObj = e
|
||||
},
|
||||
handleConfirm () {
|
||||
this.dialogVisible = false
|
||||
this._reSendWork(this.pkObj, this.inputNumber)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.grid_wraper
|
||||
height 100%
|
||||
.btn_wraper
|
||||
width 3.5rem
|
||||
</style>
|
||||
Reference in New Issue
Block a user