Commit b46a1d0f authored by jzc's avatar jzc

Merge branch 'dev' of http://git.local.topsunit.com/mes/mes-pad into dev

parents b88f621b cc932db8
# ktg-mes-pad # mes-pad
#### Description #### Description
MES系统触控屏端 MES系统触控屏端
......
# ktg-mes-pad # mes-pad
#### 介绍 #### 介绍
MES系统触控屏端 MES系统触控屏端
......
const config = { const config = {
// 产品名称 // 产品名称
productName: 'ktg-mes-pad', productName: 'mes-pad',
// 公司名称 // 公司名称
companyName: 'ktg', companyName: '',
// 产品版本号 // 产品版本号
productVersion: 'V0.1.0', productVersion: 'V0.1.0',
// 版本检查标识 // 版本检查标识
appCode: 'android', appCode: 'android',
// 内部版本号码 // 内部版本号码
appVersion: 1, appVersion: 1,
// 管理基础路径 // 管理基础路径
adminPath: '' adminPath: ''
} }
// 设置后台接口服务的基础地址 // 设置后台接口服务的基础地址
...@@ -26,4 +26,4 @@ config.baseUrl = 'http://192.168.25.105:8080'; ...@@ -26,4 +26,4 @@ config.baseUrl = 'http://192.168.25.105:8080';
//config.baseUrl = "/api"; //config.baseUrl = "/api";
//config.baseUrl = "http://101.200.162.168:8080"; //config.baseUrl = "http://101.200.162.168:8080";
export default config; export default config;
\ No newline at end of file
...@@ -26,6 +26,8 @@ const install = (Vue, vm) => { ...@@ -26,6 +26,8 @@ const install = (Vue, vm) => {
params), params),
getWorkstationList: (params = {}) => vm.$u.get(config.adminPath + getWorkstationList: (params = {}) => vm.$u.get(config.adminPath +
'/mobile/md/workstation/getWorkstationList', params), '/mobile/md/workstation/getWorkstationList', params),
getWorkUnitList: (params = {}) => vm.$u.get(config.adminPath +
'/md/workunit/getListByUser', params),
/** /**
* 生产管理相关API * 生产管理相关API
**/ **/
...@@ -90,6 +92,26 @@ const install = (Vue, vm) => { ...@@ -90,6 +92,26 @@ const install = (Vue, vm) => {
'/mobile/pro/taskissue/getReserveIssueList', params), '/mobile/pro/taskissue/getReserveIssueList', params),
//打印流转单 //打印流转单
//投料验证
listFeedingInspection: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/listIssueLine', params),
validateFeedingInspection: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/validateFeedingInspection', params),
validateFeedingInspectionById: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/validateFeedingInspectionById', params),
//查询反冲料列表
recoilMaterialList: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/getRecoilMaterial', params),
//增加反冲料
addRecoilMaterial: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/addRecoilMaterial', params),
//删除反冲料
deleteRecoilMaterial: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/deleteRecoilMaterial', params),
//领料申请
listMaterialRequest: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/listMaterialRequest', params),
addMaterialRequest: (params = {}) => vm.$u.postJson(config.adminPath + '/mobile/pro/proMaterial/addMaterialRequest', params),
//退料申请
listMaterialReturn: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/listIssueLine', params),
addMaterialReturn: (params = {}) => vm.$u.postJson(config.adminPath + '/mobile/pro/proMaterial/addMaterialReturn', params),
//质量相关api //质量相关api
//获取当前产品、当前质检类型的质检模板行信息 //获取当前产品、当前质检类型的质检模板行信息
...@@ -147,7 +169,7 @@ const install = (Vue, vm) => { ...@@ -147,7 +169,7 @@ const install = (Vue, vm) => {
detail: (params = {}) => vm.$u.get(config.adminPath+'/qc/information/list',params), detail: (params = {}) => vm.$u.get(config.adminPath+'/qc/information/list',params),
newlyAdd: (params = {}) => vm.$u.postJson(config.adminPath+'/qc/report',params), newlyAdd: (params = {}) => vm.$u.postJson(config.adminPath+'/qc/report',params),
}, },
// 增删改查例子 // 增删改查例子
testData: { testData: {
......
...@@ -79,6 +79,7 @@ const install = (Vue, vm) => { ...@@ -79,6 +79,7 @@ const install = (Vue, vm) => {
// 错误 // 错误
if (data.msg !== null) { if (data.msg !== null) {
uni.showToast({ uni.showToast({
icon: 'none',
title: data.msg, title: data.msg,
duration: 3000 duration: 3000
}) })
......
...@@ -17,22 +17,17 @@ ...@@ -17,22 +17,17 @@
<ProContent v-if="tabIndex === 'DV'"></ProContent> <ProContent v-if="tabIndex === 'DV'"></ProContent>
</view> </view>
<u-modal width="90%" v-model="showWorkstationFlag" :showConfirmButton="false" :showCancelButton="true" <u-modal width="90%" v-model="showWorkstationFlag" :showConfirmButton="false" :showCancelButton="true"
title="请选择工作站" content="操作内容"> title="请选择工作单元" content="操作内容">
<!-- <u-tabs :list="processList" :is-scroll="true" :current="currentFlag" name="processName"
@change="getWorkstationList">
</u-tabs> -->
<uv-tabs :list="processList" :current="currentFlag" keyName="processName" @change="getWorkstationList"
v-if="showWorkstationFlag"></uv-tabs>
<view class="station_list"> <view class="station_list">
<u-empty text="暂无工作站" mode="list" v-if="workstationList.length==0" <u-empty text="暂无工作单元" mode="list" v-if="workUnitList.length==0"
style="margin: 0 auto;display: block;height: 360rpx;padding: 100rpx 0;"></u-empty> style="margin: 0 auto;display: block;height: 360rpx;padding: 100rpx 0;"></u-empty>
<template v-else> <template v-else>
<u-card class="station_card" :show-foot="false" :title="'工作站'+card.workstationCode" :key="index" <u-card class="station_card" :show-foot="false" :title="'工作单元'+card.workunitCode"
v-for="(card,index) in workstationList"> v-for="(card,index) in workUnitList">
<view class="station_card_text" slot="body"> <view class="station_card_text" slot="body">
{{ '工作站名称:' + card.workstationName }} {{ '工作单元名称:' + card.workunitName }}
<u-button type="primary" @click="setWorkstation(card)" <u-button type="primary" @click="setWorkUnit(card)"
style="margin-top: 30rpx;">选择 style="margin-top: 30rpx;">选择
</u-button> </u-button>
</view> </view>
...@@ -45,7 +40,7 @@ ...@@ -45,7 +40,7 @@
title="请选择操作"> title="请选择操作">
<view class="logoutmenu"> <view class="logoutmenu">
<u-button shape="circle" class="menu_button" @click="" type="primary">更改密码</u-button> <u-button shape="circle" class="menu_button" @click="" type="primary">更改密码</u-button>
<u-button shape="circle" class="menu_button" @click="handleCommand('workstation')" type="warning">切换工作站 <u-button shape="circle" class="menu_button" @click="handleCommand('workunit')" type="warning">切换工作站
</u-button> </u-button>
<u-button shape="circle" class="menu_button" @click="handleCommand('exit')" type="error">退出登录</u-button> <u-button shape="circle" class="menu_button" @click="handleCommand('exit')" type="error">退出登录</u-button>
</view> </view>
...@@ -54,151 +49,162 @@ ...@@ -54,151 +49,162 @@
</template> </template>
<script> <script>
import TabHeader from "./TabHeader.vue" import TabHeader from "./TabHeader.vue"
import ProContent from "../mes/pro/index.vue" import ProContent from "../mes/pro/index.vue"
import GxContent from "../mes/gx/index.vue" import GxContent from "../mes/gx/index.vue"
import QcContent from "../mes/qc/index.vue" import QcContent from "../mes/qc/index.vue"
import ProdReport from "../mes/prodReport/index.vue" import ProdReport from "../mes/prodReport/index.vue"
import DictData from '@/components/DictData' import DictData from '@/components/DictData'
export default { export default {
name: 'HomePage', name: 'HomePage',
components: { components: {
TabHeader, TabHeader,
ProContent, ProContent,
GxContent, GxContent,
QcContent, QcContent,
ProdReport ProdReport
},
data() {
return {
tabIndex: "PRO",
showWorkstationFlag: false,
showLogoutMenu: false,
activeProcess: null,
userInfo: {
nickName: '张三',
avatar: require("@/static/images/head.png"),
},
processList: [], //工序清单
workstationList: [], //工作站清单
currentFlag: 0
}
},
created() {
uni.$on('switchTab', (indexCode) => {
this.tabIndex = indexCode;
})
uni.$on('changeWorkstation', (indexCode) => {
this.handleCommand('workstation');
})
this.checkWorkstation();
this.getProcessList();
},
destroyed() {
uni.$off('switchTab');
uni.$off('changeWorkstation');
},
methods: {
//用户部分点击
handleUserTaped() {
console.log("TAPED")
// this.$refs.menu_dialog.open();
this.showLogoutMenu = true;
}, },
data() {
//检查工作站设置情况 return {
checkWorkstation() { tabIndex: "PRO",
if (this.vuex_workstation == null) { showWorkstationFlag: false,
this.showWorkstationFlag = true; showLogoutMenu: false,
this.$u.toast("请设置当前触控屏的工作站!"); activeProcess: null,
userInfo: {
nickName: '张三',
avatar: require("@/static/images/head.png"),
},
processList: [], //工序清单
workstationList: [], //工作站清单
workUnitList:[],//工作站清单
currentFlag: 0
} }
}, },
//获取工序清单 created() {
getProcessList() { uni.$on('switchTab', (indexCode) => {
this.$u.api.getProcessList({}).then(res => { this.tabIndex = indexCode;
if (res.code === 200) { })
this.processList = res.data; uni.$on('changeWorkunit', (indexCode) => {
this.activeProcess = res.data[0].processCode; this.handleCommand('workunit');
this.getWorkstationList({index: 0}); })
} else {
this.$u.toast("获取工序清单异常" + res.msg);
}
}); this.checkWorkstation();
this.getWorkUnitList();
}, },
//获取工作站清单 destroyed() {
getWorkstationList(item) { uni.$off('switchTab');
this.currentFlag = item.index; uni.$off('changeWorkunit');
this.activeProcess = this.processList[item.index].processCode;
this.$u.api.getWorkstationList({
processCode: this.activeProcess
}).then(res => {
if (res.code === 200) {
this.workstationList = res.data;
} else {
this.$u.toast("获取工作站清单异常" + res.msg);
}
});
},
//设置当前触控屏的工作站
setWorkstation(station) {
this.$u.vuex('vuex_workstation', station);
this.showWorkstationFlag = false;
uni.$emit('switchWorkstation', station);
}, },
handleCommand(command) { methods: {
if (command === 'exit') { //用户部分点击
this.loading = true; handleUserTaped() {
this.$u.api.logout().then(res => { console.log("TAPED")
this.loading = false; // this.$refs.menu_dialog.open();
if (res.msg) { this.showLogoutMenu = true;
this.$u.toast(res.msg); },
//检查工作站设置情况
checkWorkstation() {
if (this.vuex_workunit == null) {
this.showWorkstationFlag = true;
this.$u.toast("请设置当前触控屏的工作单元!");
}
},
//获取工序清单
getProcessList() {
this.$u.api.getProcessList({}).then(res => {
if (res.code === 200) {
this.processList = res.data;
this.activeProcess = res.data[0].processCode;
this.getWorkstationList({index: 0});
} else {
this.$u.toast("获取工序清单异常" + res.msg);
} }
});
},
//获取工作站清单
getWorkstationList(item) {
this.currentFlag = item.index;
this.activeProcess = this.processList[item.index].processCode;
this.$u.api.getWorkstationList({
processCode: this.activeProcess
}).then(res => {
if (res.code === 200) { if (res.code === 200) {
setTimeout(() => { this.workstationList = res.data;
DictData.logout(); } else {
uni.reLaunch({ this.$u.toast("获取工作站清单异常" + res.msg);
url: '/pages/sys/login/login'
});
}, 500);
} }
}) });
} else if (command == 'workstation') { },
this.showLogoutMenu = false; getWorkUnitList(item) {
this.showWorkstationFlag = true; this.$u.api.getWorkUnitList({
}).then(res => {
if (res.code === 200) {
this.workUnitList = res.rows;
} else {
this.$u.toast("获取工作单元清单异常" + res.msg);
}
});
},
//设置当前触控屏的工作站
setWorkUnit(station) {
this.$u.vuex('vuex_workunit', station);
this.showWorkstationFlag = false;
uni.$emit('switchWorkunit', station);
},
handleCommand(command) {
if (command === 'exit') {
this.loading = true;
this.$u.api.logout().then(res => {
this.loading = false;
if (res.msg) {
this.$u.toast(res.msg);
}
if (res.code === 200) {
setTimeout(() => {
DictData.logout();
uni.reLaunch({
url: '/pages/sys/login/login'
});
}, 500);
}
})
} else if (command == 'workunit') {
this.showLogoutMenu = false;
this.showWorkstationFlag = true;
}
} }
} }
} }
}
</script> </script>
<style> <style>
.common-container { .common-container {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
display: flex; display: flex;
} }
.common-head { .common-head {
height: 40px; height: 40px;
background-color: rgb(3, 26, 60); background-color: rgb(3, 26, 60);
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 15px; padding: 0 15px;
box-sizing: border-box; box-sizing: border-box;
} }
.header { .header {
width: 120px; width: 120px;
background-color: #132138; background-color: #132138;
color: aliceblue; color: aliceblue;
font-size: 25px; font-size: 25px;
font-family: 华文楷体; font-family: 华文楷体;
line-height: 80rpx; line-height: 80rpx;
height: inherit; height: inherit;
.header-logo { .header-logo {
width: 200rpx; width: 200rpx;
...@@ -206,83 +212,83 @@ export default { ...@@ -206,83 +212,83 @@ export default {
margin: 40rpx auto; margin: 40rpx auto;
display: block; display: block;
} }
} }
.header .divItem { .header .divItem {
height: 100%; height: 100%;
align-items: center; align-items: center;
} }
.header .workstation { .header .workstation {
text-align: center; text-align: center;
flex-grow: 1; flex-grow: 1;
} }
.header .user { .header .user {
width: 30%; width: 30%;
} }
.header .user .user-icon { .header .user .user-icon {
float: right; float: right;
} }
img { img {
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 20px; border-radius: 20px;
margin-left: 10px; margin-left: 10px;
} }
.header .user .user-text { .header .user .user-text {
float: right; float: right;
} }
.logoutmenu { .logoutmenu {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.menu_button { .menu_button {
width: 100px; width: 100px;
margin: 10px; margin: 10px;
} }
.station_modal { .station_modal {
} }
.station_list { .station_list {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.station_card { .station_card {
width: 250px; width: 250px;
height: 150px; height: 150px;
} }
.common-main { .common-main {
flex: 1; flex: 1;
height: 100%; height: 100%;
padding: 6px 6px 6px 0; padding: 6px 6px 6px 0;
margin: 0; margin: 0;
width: 100%; width: 100%;
overflow: auto; overflow: auto;
background-image: linear-gradient(to top right, rgb(19 26 56), rgb(33 64 128)); background-image: linear-gradient(to top right, rgb(19 26 56), rgb(33 64 128));
} }
.setting-body { .setting-body {
position: absolute; position: absolute;
bottom: 20rpx; bottom: 20rpx;
width: 200rpx; width: 200rpx;
margin: 0 auto; margin: 0 auto;
font-size: 36rpx; font-size: 36rpx;
font-weight: initial; font-weight: initial;
text-align: center; text-align: center;
.setting-icon { .setting-icon {
margin: 10rpx 10rpx; margin: 10rpx 10rpx;
} }
} }
</style> </style>
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
</view> </view>
<view class="prod-body-right"> <view class="prod-body-right">
<view style="text-align: center;line-height: 80rpx;font-size: 28rpx;font-weight: 600;"> <view style="text-align: center;line-height: 80rpx;font-size: 28rpx;font-weight: 600;">
{{ this.vuex_workstation == null ? '请选择工作站' : this.vuex_workstation.workstationName }} {{ this.vuex_workunit == null ? '请选择工作单元' : this.vuex_workunit.workunitName }}
</view> </view>
<u-button type="primary" @click="changeWorkstation">切换工作</u-button> <u-button type="primary" @click="changeWorkstation">切换工作单元</u-button>
<br/> <br/>
<u-button type="warning" @click="commonClick('KnifeTemp')">刀模版上下机</u-button> <u-button type="warning" @click="commonClick('KnifeTemp')">刀模版上下机</u-button>
<u-button type="primary" @click="commonClick('Refresh')">刷新</u-button> <u-button type="primary" @click="commonClick('Refresh')">刷新</u-button>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<u-button type="success" @click="commonClick('Prod')">生产报工</u-button> <u-button type="success" @click="commonClick('Prod')">生产报工</u-button>
<u-button type="primary" @click="commonClick('FinshTask')">完成作业</u-button> <u-button type="primary" @click="commonClick('FinshTask')">完成作业</u-button>
<u-button type="primary" @click="commonClick('abnormal')">异常报告</u-button> <u-button type="primary" @click="commonClick('abnormal')">异常报告</u-button>
<u-button type="primary" @click="commonClick('FeedingInspection')">投料</u-button> <u-button type="primary" @click="commonClick('FeedingInspection')">投料</u-button>
<u-button type="primary" @click="commonClick('RecoilMaterial')">反冲料登记</u-button> <u-button type="primary" @click="commonClick('RecoilMaterial')">反冲料登记</u-button>
<u-button type="primary" @click="commonClick('MaterialRequest')">领料申请</u-button> <u-button type="primary" @click="commonClick('MaterialRequest')">领料申请</u-button>
<u-button type="primary" @click="commonClick('MaterialReturn')">退料申请</u-button> <u-button type="primary" @click="commonClick('MaterialReturn')">退料申请</u-button>
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
<u-input :border="true" v-model="ExceptionForms.processName"></u-input> <u-input :border="true" v-model="ExceptionForms.processName"></u-input>
</u-form-item> </u-form-item>
<u-form-item label="作业单元" prop="workstationName"> <u-form-item label="作业单元" prop="workstationName">
<u-input :border="true" v-model="ExceptionForms.workstationId"></u-input> <u-input :border="true" v-model="ExceptionForms.workstationName"></u-input>
</u-form-item> </u-form-item>
...@@ -210,31 +210,25 @@ ...@@ -210,31 +210,25 @@
<scroll-view scroll-y="true" scroll-x="true" class="scroll-list" :style="{ 'height': (this.screenHeight -280) + 'px' }"> <scroll-view scroll-y="true" scroll-x="true" class="scroll-list" :style="{ 'height': (this.screenHeight -280) + 'px' }">
<uni-table border stripe :loading="loading" emptyText="未查询到数据"> <uni-table border stripe :loading="loading" emptyText="未查询到数据">
<uni-tr> <uni-tr>
<uni-th width="100px" align="center">操作</uni-th>
<uni-th width="65px" align="center">状态</uni-th>
<uni-th width="110px" align="center">产品物料编码</uni-th> <uni-th width="110px" align="center">产品物料编码</uni-th>
<uni-th width="110px" align="center">产品物料名称</uni-th> <uni-th width="110px" align="center">产品物料名称</uni-th>
<uni-th width="150px" align="center">规格型号</uni-th>
<uni-th width="60px" align="center">单位</uni-th>
<uni-th width="80px" align="center">领料数量</uni-th> <uni-th width="80px" align="center">领料数量</uni-th>
<uni-th width="110px" align="center">批次号</uni-th> <uni-th width="110px" align="center">批次号</uni-th>
<uni-th width="100px" align="center">备注</uni-th>
<uni-th width="65px" align="center">状态</uni-th>
<uni-th width="100px" align="center">操作</uni-th>
</uni-tr> </uni-tr>
<uni-tr v-for="(line,index) in feedingInspectionList" :key="index"> <uni-tr v-for="(line,index) in feedingInspectionList" :key="index">
<uni-td align="center">{{ line.itemCode }}</uni-td>
<uni-td align="center">{{ line.itemName }}</uni-td>
<uni-td align="center">{{ line.specification}}</uni-td>
<uni-td>{{ line.unitOfMeasure }}</uni-td>
<uni-td align="center">{{ line.quantityIssued }}</uni-td>
<uni-td align="center">{{ line.batchCode }}</uni-td>
<uni-td align="center">{{ line.remark }}</uni-td>
<uni-td align="center">{{ line.state }}</uni-td>
<uni-td align="center"> <uni-td align="center">
<view class="uni-group"> <view class="uni-group">
<button class="uni-button" size="mini" type="primary" @click="qcLineClick(line)">校验 <button class="uni-button" size="mini" type="primary" @click="validateFeedingInspection(line)">校验
</button> </button>
</view> </view>
</uni-td> </uni-td>
<uni-td align="center">{{ line.attr3 == 1 ? '校验':'未校验' }}</uni-td>
<uni-td align="center">{{ line.itemCode }}</uni-td>
<uni-td align="center">{{ line.itemName }}({{line.specification}})/{{line.unitOfMeasure}}</uni-td>
<uni-td align="center">{{ line.quantityIssued }}</uni-td>
<uni-td align="center">{{ line.batchCode }}</uni-td>
</uni-tr> </uni-tr>
</uni-table> </uni-table>
</scroll-view> </scroll-view>
...@@ -251,10 +245,7 @@ ...@@ -251,10 +245,7 @@
<uni-th width="100px" align="center">操作</uni-th> <uni-th width="100px" align="center">操作</uni-th>
<uni-th width="110px" align="center">产品物料编码</uni-th> <uni-th width="110px" align="center">产品物料编码</uni-th>
<uni-th width="110px" align="center">产品物料名称</uni-th> <uni-th width="110px" align="center">产品物料名称</uni-th>
<uni-th width="150px" align="center">规格型号</uni-th>
<uni-th width="60px" align="center">单位</uni-th>
<uni-th width="110px" align="center">批次号</uni-th> <uni-th width="110px" align="center">批次号</uni-th>
<uni-th width="100px" align="center">备注</uni-th>
</uni-tr> </uni-tr>
<uni-tr v-for="(line,index) in recoilMaterialList" :key="index"> <uni-tr v-for="(line,index) in recoilMaterialList" :key="index">
<uni-td align="center"> <uni-td align="center">
...@@ -264,11 +255,8 @@ ...@@ -264,11 +255,8 @@
</view> </view>
</uni-td> </uni-td>
<uni-td align="center">{{ line.itemCode }}</uni-td> <uni-td align="center">{{ line.itemCode }}</uni-td>
<uni-td align="center">{{ line.itemName }}</uni-td> <uni-td align="center">{{ line.itemName }}({{line.specification}})/{{line.unitOfMeasure}}</uni-td>
<uni-td align="center">{{ line.specification}}</uni-td> <uni-td align="center">{{ line.batchNo }}</uni-td>
<uni-td>{{ line.unitOfMeasure }}</uni-td>
<uni-td align="center">{{ line.batchCode }}</uni-td>
<uni-td align="center">{{ line.remark }}</uni-td>
</uni-tr> </uni-tr>
</uni-table> </uni-table>
</scroll-view> </scroll-view>
...@@ -280,17 +268,12 @@ ...@@ -280,17 +268,12 @@
v-model="materialRequestVisible" width="1300rpx"> v-model="materialRequestVisible" width="1300rpx">
<view class="list-bar"> <view class="list-bar">
<scroll-view scroll-y="true" class="scroll-list" :style="{ 'height': (this.screenHeight -280) + 'px' }"> <scroll-view scroll-y="true" class="scroll-list" :style="{ 'height': (this.screenHeight -280) + 'px' }">
<uni-table ref="qcTable" border stripe :loading="loading" emptyText="未查询到数据"> <uni-table ref="materialRequestTable" border stripe :loading="loading" emptyText="未查询到数据">
<uni-tr> <uni-tr>
<uni-th width="100px" align="center">操作</uni-th> <uni-th width="100px" align="center">操作</uni-th>
<uni-th width="110px" align="center">产品物料编码</uni-th> <uni-th width="110px" align="center">产品物料编码</uni-th>
<uni-th width="110px" align="center">产品物料名称</uni-th> <uni-th width="110px" align="center">产品物料名称</uni-th>
<uni-th width="150px" align="center">规格型号</uni-th> <uni-th width="80px" align="center">领取数量</uni-th>
<uni-th width="60px" align="center">单位</uni-th>
<uni-th width="80px" align="center">补料数量</uni-th>
<uni-th width="110px" align="center">批次号</uni-th>
<uni-th width="100px" align="center">备注</uni-th>
<uni-th width="65px" align="center">状态</uni-th>
</uni-tr> </uni-tr>
<uni-tr v-for="(line,index) in materialRequestList" :key="index"> <uni-tr v-for="(line,index) in materialRequestList" :key="index">
<uni-td align="center"> <uni-td align="center">
...@@ -300,13 +283,8 @@ ...@@ -300,13 +283,8 @@
</view> </view>
</uni-td> </uni-td>
<uni-td align="center">{{ line.itemCode }}</uni-td> <uni-td align="center">{{ line.itemCode }}</uni-td>
<uni-td align="center">{{ line.itemName }}</uni-td> <uni-td align="center">{{ line.itemName }}({{line.specification}})/{{line.unitOfMeasure}}</uni-td>
<uni-td align="center">{{ line.specification}}</uni-td> <uni-td align="center">{{line.applyNum}}</uni-td>
<uni-td>{{ line.unitOfMeasure }}</uni-td>
<uni-td align="center">{{line.quantityIssued}}</uni-td>
<uni-td align="center">{{ line.batchCode }}</uni-td>
<uni-td align="center">{{ line.remark }}</uni-td>
<uni-td align="center">{{ line.state }}</uni-td>
</uni-tr> </uni-tr>
</uni-table> </uni-table>
</scroll-view> </scroll-view>
...@@ -336,7 +314,7 @@ ...@@ -336,7 +314,7 @@
</view> </view>
</u-modal> </u-modal>
<u-modal title="退料申请" @confirm="feedback()" show-cancel-button <u-modal title="退料申请" @confirm="materialReturnSave()" show-cancel-button
:title-style="{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}" :title-style="{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}"
v-model="materialReturnVisible" width="1300rpx"> v-model="materialReturnVisible" width="1300rpx">
<view class="list-bar"> <view class="list-bar">
...@@ -346,12 +324,9 @@ ...@@ -346,12 +324,9 @@
<uni-th width="100px" align="center">操作</uni-th> <uni-th width="100px" align="center">操作</uni-th>
<uni-th width="110px" align="center">产品物料编码</uni-th> <uni-th width="110px" align="center">产品物料编码</uni-th>
<uni-th width="110px" align="center">产品物料名称</uni-th> <uni-th width="110px" align="center">产品物料名称</uni-th>
<uni-th width="150px" align="center">规格型号</uni-th>
<uni-th width="60px" align="center">单位</uni-th>
<uni-th width="80px" align="center">领料数量</uni-th> <uni-th width="80px" align="center">领料数量</uni-th>
<uni-th width="80px" align="center">退料数量</uni-th> <uni-th width="80px" align="center">退料数量</uni-th>
<uni-th width="110px" align="center">批次号</uni-th> <uni-th width="110px" align="center">批次号</uni-th>
<uni-th width="100px" align="center">备注</uni-th>
</uni-tr> </uni-tr>
<uni-tr v-for="(line,index) in materialReturnList" :key="index"> <uni-tr v-for="(line,index) in materialReturnList" :key="index">
<uni-td align="center"> <uni-td align="center">
...@@ -361,13 +336,10 @@ ...@@ -361,13 +336,10 @@
</view> </view>
</uni-td> </uni-td>
<uni-td align="center">{{ line.itemCode }}</uni-td> <uni-td align="center">{{ line.itemCode }}</uni-td>
<uni-td align="center">{{ line.itemName }}</uni-td> <uni-td align="center">{{ line.itemName }}({{line.specification}})/{{line.unitOfMeasure}}</uni-td>
<uni-td align="center">{{ line.specification}}</uni-td>
<uni-td>{{ line.unitOfMeasure }}</uni-td>
<uni-td align="center">{{ line.applyNum }}</uni-td>
<uni-td align="center">{{ line.quantityIssued }}</uni-td> <uni-td align="center">{{ line.quantityIssued }}</uni-td>
<uni-td align="center">{{ line.applyNum }}</uni-td>
<uni-td align="center">{{ line.batchCode }}</uni-td> <uni-td align="center">{{ line.batchCode }}</uni-td>
<uni-td align="center">{{ line.remark }}</uni-td>
</uni-tr> </uni-tr>
</uni-table> </uni-table>
</scroll-view> </scroll-view>
...@@ -396,7 +368,7 @@ ...@@ -396,7 +368,7 @@
</u-form> </u-form>
</view> </view>
</u-modal> </u-modal>
<u-modal title="详细数据" :showConfirmButton="true" <u-modal title="详细数据" :showConfirmButton="true"
:title-style="{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}" :title-style="{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}"
v-model="showRowDeatilFlag" width="1800rpx"> v-model="showRowDeatilFlag" width="1800rpx">
<view class=""> <view class="">
...@@ -726,7 +698,7 @@ export default { ...@@ -726,7 +698,7 @@ export default {
} }
}, },
mounted() { //监听工作站切换事件 mounted() { //监听工作站切换事件
uni.$on('switchWorkstation', (station) => { uni.$on('switchWorkunit', (station) => {
this.getTaskList(); this.getTaskList();
}) })
}, },
...@@ -738,7 +710,7 @@ export default { ...@@ -738,7 +710,7 @@ export default {
} }
}) })
//监听工作站切换事件 //监听工作站切换事件
uni.$on('switchWorkstation', (station) => { uni.$on('switchWorkunit', (station) => {
// this.reset(); // this.reset();
this.getTaskList(); this.getTaskList();
}) })
...@@ -747,7 +719,7 @@ export default { ...@@ -747,7 +719,7 @@ export default {
this.getTaskList(); //刷新任务状态 this.getTaskList(); //刷新任务状态
}) })
if (this.vuex_workstation != null) { if (this.vuex_workunit != null) {
this.getTaskList(); this.getTaskList();
} }
// if (this.vuex_task != null) { // if (this.vuex_task != null) {
...@@ -755,7 +727,7 @@ export default { ...@@ -755,7 +727,7 @@ export default {
// } // }
}, },
destroyed() { destroyed() {
uni.$off('switchWorkstation'); uni.$off('switchWorkunit');
uni.$off('taskStatusChanged'); uni.$off('taskStatusChanged');
}, },
methods: { methods: {
...@@ -769,7 +741,7 @@ export default { ...@@ -769,7 +741,7 @@ export default {
console.log('99999999', arg) console.log('99999999', arg)
}, },
changeWorkstation() { changeWorkstation() {
uni.$emit('changeWorkstation'); uni.$emit('changeWorkunit');
}, },
commonClick(oper) { commonClick(oper) {
if (['Refresh', 'MaterialUsageRecord'].indexOf(oper) === -1 && this.tableSelectData.length === 0) { if (['Refresh', 'MaterialUsageRecord'].indexOf(oper) === -1 && this.tableSelectData.length === 0) {
...@@ -939,8 +911,9 @@ export default { ...@@ -939,8 +911,9 @@ export default {
}, },
getTaskList() { getTaskList() {
this.form = {} this.form = {}
const t = this;
this.$u.api.getTaskList({ this.$u.api.getTaskList({
workstationId: this.vuex_workstation.workstationId, workunitId: t.vuex_workunit.workunitId,
}).then(res => { }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.tableData = res.rows; this.tableData = res.rows;
...@@ -1062,7 +1035,9 @@ export default { ...@@ -1062,7 +1035,9 @@ export default {
processId: item.processId, processId: item.processId,
processCode: item.processCode, processCode: item.processCode,
processName: item.processName, processName: item.processName,
workstationId: item.workunitId, workstationId: this.vuex_workunit.workunitId,
workstationCode: this.vuex_workunit.workunitCode,
workstationName: this.vuex_workunit.workunitName,
abnormalType: '', abnormalType: '',
abnormalReason: '', abnormalReason: '',
abnormalTime: '' abnormalTime: ''
...@@ -1116,7 +1091,8 @@ export default { ...@@ -1116,7 +1091,8 @@ export default {
}, },
feedingInspectionLoadAndScan(){ feedingInspectionLoadAndScan(){
const t = this; const t = this;
this.$u.api.listFeedingInspection({"batchNo":""}).then(res => { const taskInfo = this.tableSelectData[0];
this.$u.api.listFeedingInspection({"taskId":taskInfo.taskId}).then(res => {
if (res.code === 200) { if (res.code === 200) {
t.feedingInspectionList = res.data; t.feedingInspectionList = res.data;
t.feedingInspectionScan(); t.feedingInspectionScan();
...@@ -1127,7 +1103,7 @@ export default { ...@@ -1127,7 +1103,7 @@ export default {
const t = this; const t = this;
uni.scanCode({ uni.scanCode({
success: function (res) { success: function (res) {
t.$u.api.validateFeedingInspection({"batchNo":res.result}).then(res2=>{ t.$u.api.validateFeedingInspection({"plnr":res.result}).then(res2=>{
if (res2.code === 200) { if (res2.code === 200) {
t.feedingInspectionLoadAndScan(); t.feedingInspectionLoadAndScan();
} }
...@@ -1136,13 +1112,27 @@ export default { ...@@ -1136,13 +1112,27 @@ export default {
}); });
this.feedingInspectionVisible=true; this.feedingInspectionVisible=true;
}, },
validateFeedingInspection(line){
const t = this;
const taskInfo = this.tableSelectData[0];
this.$u.api.validateFeedingInspectionById({"lineId":line.lineId}).then(res2=>{
if (res2.code === 200) {
t.$u.api.listFeedingInspection({"taskId":taskInfo.taskId}).then(res => {
if (res.code === 200) {
t.feedingInspectionList = res.data;
}
});
}
});
},
recoilMaterialShow(){ recoilMaterialShow(){
this.recoilMaterialVisible=true; this.recoilMaterialVisible=true;
this.recoilMaterialLoadAndScan(); this.recoilMaterialLoadAndScan();
}, },
recoilMaterialLoadAndScan(){ recoilMaterialLoadAndScan(){
const t = this; const t = this;
this.$u.api.recoilMaterialList({"batchNo":""}).then(res => { const taskInfo = this.tableSelectData[0];
this.$u.api.recoilMaterialList({"taskId":taskInfo.taskId}).then(res => {
if (res.code === 200) { if (res.code === 200) {
t.recoilMaterialList = res.data; t.recoilMaterialList = res.data;
t.recoilMaterialScan(); t.recoilMaterialScan();
...@@ -1151,10 +1141,10 @@ export default { ...@@ -1151,10 +1141,10 @@ export default {
}, },
recoilMaterialScan(){ recoilMaterialScan(){
const t = this; const t = this;
const taskInfo = this.tableSelectData[0];
uni.scanCode({ uni.scanCode({
success: function (res) { success: function (res) {
t.$u.toast(res.result); t.$u.api.addRecoilMaterial({"taskId":taskInfo.taskId, "plnr": res.result}).then(res2=>{
t.$u.api.addRecoilMaterial({"batchNo":res.result}).then(res2=>{
if (res2.code === 200) { if (res2.code === 200) {
t.recoilMaterialLoadAndScan(); t.recoilMaterialLoadAndScan();
} }
...@@ -1165,8 +1155,9 @@ export default { ...@@ -1165,8 +1155,9 @@ export default {
}, },
recoilMaterialDelete(line){ recoilMaterialDelete(line){
const t = this; const t = this;
this.$u.api.deleteRecoilMaterial({"id":line.id}).then(res2=>{ const taskInfo = this.tableSelectData[0];
t.$u.api.recoilMaterialList({"batchNo":""}).then(res => { this.$u.api.deleteRecoilMaterial({"id":line.recoilMaterialId}).then(res2=>{
t.$u.api.recoilMaterialList({"taskId":taskInfo.taskId}).then(res => {
if (res.code === 200) { if (res.code === 200) {
t.recoilMaterialList = res.data; t.recoilMaterialList = res.data;
} }
...@@ -1175,10 +1166,10 @@ export default { ...@@ -1175,10 +1166,10 @@ export default {
}, },
materialRequestShow(){ materialRequestShow(){
console.log(this.$u.config.v); const taskInfo = this.tableSelectData[0];
const t = this; const t = this;
this.materialRequestVisible=true; this.materialRequestVisible=true;
this.$u.api.listMaterialRequest({"batchNo":""}).then(res => { this.$u.api.listMaterialRequest({"taskId":taskInfo.taskId}).then(res => {
if (res.code === 200) { if (res.code === 200) {
t.materialRequestList = res.data; t.materialRequestList = res.data;
} }
...@@ -1190,33 +1181,72 @@ export default { ...@@ -1190,33 +1181,72 @@ export default {
this.materialRequestSelected = line; this.materialRequestSelected = line;
}, },
materialRequestSetting(){ materialRequestSetting(){
this.materialRequestSelected.quantityIssued = this.materialRequestFormData.applyNum; this.materialRequestSelected.applyNum = this.materialRequestFormData.applyNum;
this.materialRequestFormVisible=false; this.materialRequestFormVisible=false;
}, },
materialRequestSave(){ materialRequestSave(){
const rst = [];
const taskInfo = this.tableSelectData[0];
const t = this;
this.materialRequestList.forEach(s=>{
if(s.applyNum!=null){
rst.push({
"itemId":s.itemId,
"taskId":taskInfo.taskId,
"applyNum":s.applyNum,
"applyType":1
});
}
});
this.$u.api.addMaterialRequest(rst).then(res => {
t.materialRequestFormVisible=false;
if (res.code === 200) {
t.$u.toast('保存成功');
}
});
}, },
materialReturnShow(){ materialReturnShow(){
console.log(this.$u.config.v); const t = this;
const t = this; this.materialReturnVisible=true;
this.materialReturnVisible=true; const taskInfo = this.tableSelectData[0];
this.$u.api.listMaterialReturn({"batchNo":""}).then(res => { this.$u.api.listMaterialReturn({"taskId":taskInfo.taskId}).then(res => {
if (res.code === 200) { if (res.code === 200) {
t.materialReturnList = res.data; t.materialReturnList = res.data;
} }
}); });
}, },
materialReturnFormShow(line){ materialReturnFormShow(line){
this.materialReturnFormVisible=true; this.materialReturnFormVisible=true;
this.materialReturnFormData = {itemName: line.itemName}; this.materialReturnFormData = {itemName: line.itemName};
this.materialReturnSelected = line; this.materialReturnSelected = line;
}, },
materialReturnSetting(){ materialReturnSetting(){
this.materialReturnSelected.quantityIssued = this.materialReturnFormData.applyNum; this.materialReturnSelected.applyNum = this.materialReturnFormData.applyNum;
this.materialReturnFormVisible=false; this.materialReturnFormVisible=false;
}, },
materialReturnSave(){ materialReturnSave(){
const taskInfo = this.tableSelectData[0];
const rst = [];
const t = this;
this.materialReturnList.forEach(s=>{
if(s.applyNum!=null){
rst.push({
"itemId":s.itemId,
"taskId":taskInfo.taskId,
"backNum":s.applyNum,
"issueLineId":s.lineId,
"workOrderId":s.workorderId,
"batchNo":s.batchCode,
"packNo":s.packNo
});
}
});
this.$u.api.addMaterialReturn(rst).then(res => {
t.materialReturnFormVisible=false;
if (res.code === 200) {
t.$u.toast('保存成功');
}
});
}, },
stockInShow(){ stockInShow(){
this.stockInVisible=true; this.stockInVisible=true;
......
...@@ -12,7 +12,7 @@ try{ ...@@ -12,7 +12,7 @@ try{
// 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的 // 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的
lifeData = uni.getStorageSync('lifeData'); lifeData = uni.getStorageSync('lifeData');
}catch(e){ }catch(e){
} }
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名 // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
...@@ -41,14 +41,15 @@ const store = new Vuex.Store({ ...@@ -41,14 +41,15 @@ const store = new Vuex.Store({
vuex_remember: lifeData.vuex_remember ? lifeData.vuex_remember : '', vuex_remember: lifeData.vuex_remember ? lifeData.vuex_remember : '',
vuex_locale: lifeData.vuex_locale ? lifeData.vuex_locale : '', vuex_locale: lifeData.vuex_locale ? lifeData.vuex_locale : '',
vuex_isAgent: lifeData.vuex_isAgent ? lifeData.vuex_isAgent : '', vuex_isAgent: lifeData.vuex_isAgent ? lifeData.vuex_isAgent : '',
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式 // 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
vuex_config: config, vuex_config: config,
//当前设备绑定的工作站 //当前设备绑定的工作站
vuex_workstation: null, vuex_workstation: null,
vuex_workunit: null,
//当前工作站正在进行的生产任务 //当前工作站正在进行的生产任务
vuex_task: null, vuex_task: null,
// 自定义tabbar数据 // 自定义tabbar数据
// vuex_tabbar: [{ // vuex_tabbar: [{
// iconPath: "/static/uview/example/component.png", // iconPath: "/static/uview/example/component.png",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment