Commit 8a5b5bd6 authored by chenzj's avatar chenzj

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

parents 01068f2c ac7aec34
This diff is collapsed.
<template> <template>
<view class="common-container"> <view class="common-container">
<!-- <u-button @click="handleTest">跳转测试</u-button> -->
<view class="header"> <view class="header">
<image mode="widthFix" class="header-logo" style="width: 110px;margin: 10px auto;display: block;" <image mode="widthFix" class="header-logo" style="width: 100px;margin: 10px auto;display: block;"
src="/static/logo.png"></image> src="/static/logo.png"></image>
<TabHeader></TabHeader> <TabHeader></TabHeader>
<view class="setting-body" <view class="setting-body"
...@@ -55,6 +56,7 @@ ...@@ -55,6 +56,7 @@
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'
import UButton from '../../uview-ui/components/u-button/u-button.vue'
export default { export default {
name: 'HomePage', name: 'HomePage',
...@@ -63,7 +65,8 @@ ...@@ -63,7 +65,8 @@
ProContent, ProContent,
GxContent, GxContent,
QcContent, QcContent,
ProdReport ProdReport,
UButton
}, },
data() { data() {
return { return {
...@@ -97,6 +100,11 @@ ...@@ -97,6 +100,11 @@
uni.$off('changeWorkunit'); uni.$off('changeWorkunit');
}, },
methods: { methods: {
handleTest() {
uni.navigateTo({
url:'/pages/test/test'
})
},
//用户部分点击 //用户部分点击
handleUserTaped() { handleUserTaped() {
console.log("TAPED") console.log("TAPED")
...@@ -198,7 +206,7 @@ ...@@ -198,7 +206,7 @@
} }
.header { .header {
width: 120px; width: 110px;
background-color: #132138; background-color: #132138;
color: aliceblue; color: aliceblue;
font-size: 25px; font-size: 25px;
......
...@@ -56,11 +56,11 @@ ...@@ -56,11 +56,11 @@
}, },
], ],
} }
}, },
computed: { computed: {
tableData() { tableData() {
return this.data || [] return this.data || []
} }
}, },
methods: { methods: {
async commonClick(type) { async commonClick(type) {
...@@ -81,16 +81,18 @@ ...@@ -81,16 +81,18 @@
if (!flag) { if (!flag) {
return this.$u.toast('请选择状态相同的数据') return this.$u.toast('请选择状态相同的数据')
} }
} }
const params = { const params = this.tableSelectData.map(v => {
toolMachinesRecordIdList: this.tableSelectData.map(v => v.toolMachinesRecordId), return {
type toolMachinesId: v.toolMachinesId,
} type
const {code} = await this.$u.api.dModel.tmToolMachinesRecord(params) }
if (code == 200) { })
this.$emit('action') const {code} = await this.$u.api.dModel.tmToolMachinesRecord(params)
} if (code == 200) {
this.$emit('action')
}
}, },
toggleAllSelection(checked, arr) { toggleAllSelection(checked, arr) {
...@@ -109,4 +111,4 @@ ...@@ -109,4 +111,4 @@
margin-top: 20rpx; margin-top: 20rpx;
padding: 0 20rpx; padding: 0 20rpx;
} }
</style> </style>
...@@ -16,10 +16,11 @@ ...@@ -16,10 +16,11 @@
<view class="prod-body-left-task"> <view class="prod-body-left-task">
<zb-table <zb-table
ref="zbtable"
:columns="tableColumn" :columns="tableColumn"
:stripe="true" :stripe="true"
rowKey="taskWorkunitId"
@rowClick="rowClick" @rowClick="rowClick"
@cellClick="cellClick"
@toggleRowSelection="toggleRowSelection" @toggleRowSelection="toggleRowSelection"
@toggleAllSelection="toggleAllSelection" @toggleAllSelection="toggleAllSelection"
:border="true" :border="true"
...@@ -697,19 +698,22 @@ export default { ...@@ -697,19 +698,22 @@ export default {
tableColumn: [ tableColumn: [
{ {
type: 'selection', type: 'selection',
width: 35 width: 80
}, },
{ {
name: 'arrangeCode', name: 'arrangeCode',
label: '编排单号', label: '编排单号',
width: 140, width: 200,
func: 'numclik' cellFun: (row, index) => {
console.log(row, index)
this.tableDataDetail = row.proWorkorderList;
this.showRowDeatilFlag = true;
}
}, },
{ {
name: 'startTime', name: 'startTime',
label: '计划开始时间', label: '计划开始时间',
width: 140, width: 140,
func: 'numclik'
}, },
{ {
name: 'endTime', name: 'endTime',
...@@ -737,7 +741,7 @@ export default { ...@@ -737,7 +741,7 @@ export default {
ERROR_STOP: '异常停工', ERROR_STOP: '异常停工',
FINISH: '完工' FINISH: '完工'
}, },
width: 60, width: 100,
align: 'center' align: 'center'
}, },
// { // {
...@@ -748,14 +752,14 @@ export default { ...@@ -748,14 +752,14 @@ export default {
{ {
name: 'taskCode', name: 'taskCode',
label: '任务单号', label: '任务单号',
width: 110 width: 180
},
{
name: 'workorderCode',
label: '生产单号',
width: 120
}, },
// { // {
// name: 'workorderCode',
// label: '生产单号',
// width: 120
// },
// {
// name: 'itemCode', // name: 'itemCode',
// label: '物料编号', // label: '物料编号',
// width: 110, // width: 110,
...@@ -770,7 +774,7 @@ export default { ...@@ -770,7 +774,7 @@ export default {
width: 60 width: 60
}, },
{ {
name: 'quantityQuanlify', name: 'quantityQualify',
label: '合格数量', label: '合格数量',
width: 80, width: 80,
align: 'center' align: 'center'
...@@ -781,12 +785,12 @@ export default { ...@@ -781,12 +785,12 @@ export default {
width: 80, width: 80,
align: 'center' align: 'center'
}, },
{ // {
name: 'clientName', // name: 'clientName',
label: '作业人员', // label: '作业人员',
width: 60, // width: 60,
align: 'center' // align: 'center'
} // }
], ],
dModelData: [], dModelData: [],
tableSelectData: [], tableSelectData: [],
...@@ -944,12 +948,14 @@ export default { ...@@ -944,12 +948,14 @@ export default {
urls: this.viewSop urls: this.viewSop
}); });
}, },
cellClick(row, index, column) { // cellClick(row, index, column) {
if (column.name === 'arrangeCode') { // if (column.name === 'arrangeCode') {
this.tableDataDetail = row.proWorkorderList; // this.tableDataDetail = row.proWorkorderList;
this.showRowDeatilFlag = true; // this.showRowDeatilFlag = true;
} // console.log(e)
}, // e.stopPropagation()
// }
// },
numclik(...arg) { numclik(...arg) {
console.log('99999999', arg); console.log('99999999', arg);
}, },
...@@ -1067,6 +1073,7 @@ export default { ...@@ -1067,6 +1073,7 @@ export default {
workunitName: this.vuex_workunit.workunitName, workunitName: this.vuex_workunit.workunitName,
processId: selectData.processId, processId: selectData.processId,
taskId: selectData.taskId, taskId: selectData.taskId,
taskWorkunitId: selectData.taskWorkunitId,
workorderId: selectData.workorderId, workorderId: selectData.workorderId,
toolRequestUseId: data[0].toolRequestUseId, toolRequestUseId: data[0].toolRequestUseId,
toolMachinesRecordList: data.map((v) => { toolMachinesRecordList: data.map((v) => {
...@@ -1096,14 +1103,16 @@ export default { ...@@ -1096,14 +1103,16 @@ export default {
}); });
}, },
rowClick(row, index) { rowClick(row, index) {
this.$refs.zbtable.toggleRowSelection(row)
this.curTaskInfo = row; this.curTaskInfo = row;
this.getMaterialUsageRecordList(); this.getMaterialUsageRecordList();
}, },
toggleAllSelection(checked, arr) { toggleAllSelection(checked, arr) {
// console.log(arr, 'this.tableSelectData');
this.tableSelectData = arr; this.tableSelectData = arr;
}, },
toggleRowSelection(checked, arr) { toggleRowSelection(checked, arr) {
console.log(this.tableSelectData, 'this.tableSelectData'); // console.log(arr, 'this.tableSelectData');
this.tableSelectData = arr; this.tableSelectData = arr;
}, },
knifeTemp() { knifeTemp() {
...@@ -1292,6 +1301,8 @@ export default { ...@@ -1292,6 +1301,8 @@ export default {
// this.reset(); // this.reset();
this.feedbackForms = []; this.feedbackForms = [];
this.tableSelectData.forEach((item) => { this.tableSelectData.forEach((item) => {
let tempQualify = item.quantity-item.quantityQualify<0?0:item.quantity-item.quantityQualify;
tempQualify = tempQualify>item.quantityWait?item.quantityWait:tempQualify;
const feedback = { const feedback = {
...item, ...item,
workstationId: item.workstationId, workstationId: item.workstationId,
...@@ -1300,7 +1311,7 @@ export default { ...@@ -1300,7 +1311,7 @@ export default {
taskWorkunitId: item.taskWorkunitId, taskWorkunitId: item.taskWorkunitId,
feedbackChannel: 'PAD', feedbackChannel: 'PAD',
quantity: item.quantity, quantity: item.quantity,
quantityQualify: item.quantity-item.quantityQuanlify-item.quantityUnquanlify,//默认为排产数量-合格数-不合格数 quantityQualify: tempQualify,//默认为排产数量-合格数
quantityUnqualify: 0, quantityUnqualify: 0,
printName: false, printName: false,
nickName: this.vuex_user.nicfeedbackkName, nickName: this.vuex_user.nicfeedbackkName,
...@@ -1358,8 +1369,8 @@ export default { ...@@ -1358,8 +1369,8 @@ export default {
taskId: item.taskId, taskId: item.taskId,
taskCode: item.taskCode, taskCode: item.taskCode,
quantityFeedback: item.quantityQualify+item.quantityUnqualify, quantityFeedback: item.quantityQualify+item.quantityUnqualify,
quantityQualified: item.quantityQualify, quantityQualify: item.quantityQualify,
quantityUnquanlified: item.quantityUnqualify, quantityUnqualify: item.quantityUnqualify,
userName: this.vuex_user.userName, userName: this.vuex_user.userName,
feedbackType: item.feedbackType, feedbackType: item.feedbackType,
routeId: item.routeId, routeId: item.routeId,
...@@ -1411,9 +1422,10 @@ export default { ...@@ -1411,9 +1422,10 @@ export default {
}, },
feedingInspectionScan() { feedingInspectionScan() {
const t = this; const t = this;
const taskInfo = this.tableSelectData[0];
uni.scanCode({ uni.scanCode({
success: function (res) { success: function (res) {
t.$u.api.validateFeedingInspection({ plnr: res.result }).then((res2) => { t.$u.api.validateFeedingInspection({ plnr: res.result,taskId: taskInfo.taskId }).then((res2) => {
if (res2.code === 200) { if (res2.code === 200) {
t.feedingInspectionLoadAndScan(true); t.feedingInspectionLoadAndScan(true);
} }
......
<template> <template>
<view class="login"> <view class="login">
<u-form ref="loginForm" :modelValue="loginForm" :rules="loginRules" class="login-form"> <u-form ref="loginForm" :modelValue="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">MES-PAD</h3> <h3 class="title">MES作业端</h3>
<u-form-item prop="username"> <u-form-item prop="username">
<input <input
v-model="loginForm.username" v-model="loginForm.username"
......
...@@ -140,6 +140,11 @@ ...@@ -140,6 +140,11 @@
<text v-else>{{ ite.emptyString }}</text> <text v-else>{{ ite.emptyString }}</text>
</view> </view>
</template> </template>
<template v-else-if="ite.cellFun">
<view @click.stop="ite.cellFun(item,index)" class="cellfunction">
<text>{{ ite.filters ? itemFilter(item, ite) : formatterAction(item, ite, index, i) }}</text>
</view>
</template>
<template v-else> <template v-else>
<!-- {{ ite.filters?itemFilter(item,ite):(item[ite.name]==null||item[ite.name]==='')?ite.emptyString:item[ite.name] }}--> <!-- {{ ite.filters?itemFilter(item,ite):(item[ite.name]==null||item[ite.name]==='')?ite.emptyString:item[ite.name] }}-->
{{ ite.filters ? itemFilter(item, ite) : formatterAction(item, ite, index, i) }} {{ ite.filters ? itemFilter(item, ite) : formatterAction(item, ite, index, i) }}
...@@ -796,6 +801,30 @@ export default { ...@@ -796,6 +801,30 @@ export default {
cellClick(row, index, column) { cellClick(row, index, column) {
this.$emit('cellClick', row, index, column) this.$emit('cellClick', row, index, column)
}, },
toggleRowSelection(row) {
const items = this.selectArr.find(v => v[this.rowKey] === row[this.rowKey])
if (items&&Object.keys(items).length > 0) {
this.data.forEach(item => {
if (item[this.rowKey] === row[this.rowKey]) {
this.$set(item, 'checked', false)
}
})
this.selectArr.forEach((item, index) => {
if (item[this.rowKey] === row[this.rowKey]) {
this.selectArr.splice(index, 1)
}
});
this.$emit('toggleRowSelection', false, this.selectArr)
} else {
this.data.forEach(item => {
if (item[this.rowKey] === row[this.rowKey]) {
this.$set(item, 'checked', true)
this.selectArr.push(item)
}
})
this.$emit('toggleRowSelection', true, this.selectArr)
}
},
rowClick(row, index) { rowClick(row, index) {
if (this.highlight) { if (this.highlight) {
this.currentRowIndex = index this.currentRowIndex = index
...@@ -1352,6 +1381,9 @@ export default { ...@@ -1352,6 +1381,9 @@ export default {
//height: 100%; //height: 100%;
width: 100%; width: 100%;
} }
.cellfunction{
text-align: left;
}
.even { .even {
background-color: white; background-color: white;
......
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