Commit 6a46ddbb authored by 沈翠玲's avatar 沈翠玲

作业端-》包装标签报工

parent ddecc0dc
...@@ -77,22 +77,18 @@ ...@@ -77,22 +77,18 @@
{{ this.vuex_workunit == null ? '请选择工作单元' : this.vuex_workunit.workunitName }} {{ this.vuex_workunit == null ? '请选择工作单元' : this.vuex_workunit.workunitName }}
</view> </view>
<u-button type="primary" @click="commonClick('Refresh')">刷新</u-button> <u-button type="primary" @click="commonClick('Refresh')">刷新</u-button>
<u-button type="primary" @click="commonClick('KnifeTemp')" v-if="!buttonShow || buttonShow.processToolView === '1'">刀模版上下机</u-button> <u-button type="primary" @click="commonClick('KnifeTemp')" v-if="!isWaiXie" v-show="!buttonShow || buttonShow.processToolView === '1'">刀模版上下机</u-button>
<u-button type="primary" @click="commonClick('FeedingInspection')" v-if="!buttonShow || buttonShow.materialView === '1'">投料校验</u-button> <u-button type="primary" @click="commonClick('FeedingInspection')" v-if="!isWaiXie" v-show="!buttonShow || buttonShow.materialView === '1'">投料校验</u-button>
<u-button type="primary" @click="commonClick('RecoilMaterial')" v-if="!buttonShow || buttonShow.recoilMaterialView === '1'">反冲料登记</u-button> <u-button type="primary" @click="commonClick('RecoilMaterial')" v-if="!isWaiXie" v-show="!buttonShow || buttonShow.recoilMaterialView === '1'">反冲料登记</u-button>
<u-button type="success" @click="commonClick('StartTask')">开始作业</u-button> <u-button type="success" @click="commonClick('StartTask')" v-if="!isWaiXie">开始作业</u-button>
<u-button type="warning" @click="commonClick('StopTask')">暂停作业</u-button> <u-button type="warning" @click="commonClick('StopTask')" v-if="!isWaiXie">暂停作业</u-button>
<u-button type="success" @click="commonClick('Prod')">生产报工</u-button> <u-button type="success" @click="commonClick('Prod')">生产报工</u-button>
<u-button type="success" @click="commonClick('editProd')">修改报工</u-button> <u-button type="success" @click="commonClick('editProd')" v-if="!isWaiXie">修改报工</u-button>
<u-button type="primary" @click="commonClick('FinshTask')">完成作业</u-button> <u-button type="primary" @click="commonClick('FinshTask')" v-if="!isWaiXie">完成作业</u-button>
<u-button type="primary" @click="commonClick('MaterialRequest')" v-if="!isWaiXie" v-show="!buttonShow || buttonShow.MaterialRequestView === '1'">补料申请</u-button>
<!-- <u-button type="primary" @click="commonClick('KnifeTemp2')">刀模版上下机2</u-button> --> <u-button type="primary" @click="commonClick('MaterialReturn')" v-if="!isWaiXie" v-show="!buttonShow || buttonShow.MaterialReturnView === '1'">退料申请</u-button>
<u-button type="primary" @click="commonClick('MaterialRequest')" v-if="!buttonShow || buttonShow.MaterialRequestView === '1'">补料申请</u-button> <u-button type="primary" @click="commonClick('ViewPpicture')" v-if="!isWaiXie">查看图片</u-button>
<!-- <u-button type="primary" @click="commonClick('MaterialRequest')">补料申请</u-button> --> <u-button type="warning" @click="commonClick('abnormal')" v-if="!isWaiXie">异常报告</u-button>
<u-button type="primary" @click="commonClick('MaterialReturn')" v-if="!buttonShow || buttonShow.MaterialReturnView === '1'">退料申请</u-button>
<!-- <u-button type="primary" @click="commonClick('MaterialReturn')">退料申请</u-button> -->
<u-button type="primary" @click="commonClick('ViewPpicture')">查看图片</u-button>
<u-button type="warning" @click="commonClick('abnormal')">异常报告</u-button>
<!-- <u-button type="primary" @click="commonClick('StockIn')">完工入库申请</u-button> --> <!-- <u-button type="primary" @click="commonClick('StockIn')">完工入库申请</u-button> -->
</scroll-view> </scroll-view>
</view> </view>
...@@ -299,24 +295,21 @@ ...@@ -299,24 +295,21 @@
</view> </view>
<!-- SIZE列表 --> <!-- SIZE列表 -->
<view v-if="feedback.tableSizeData.length"> <view v-if="feedback.tableSizeData.length">
<zb-table :columns="feedback.tableSizeColumn" :stripe="true" :border="true" <zb-table :columns="feedback.tableSizeColumn" ref="feedSizeRef" :stripe="true" :border="true" highlight
:data="feedback.tableSizeData"> :data="feedback.tableSizeData" :isTrClassStyle="isSizeClassStyle" class="feedSize">
<template slot="reportQuantity" slot-scope="scope"> <template slot="reportQuantity" slot-scope="scope">
<!-- {{ scope.row }} --> <u-input v-model="scope.row.reportQuantity" type="number" v-if="!scope.row.highlight"></u-input>
<u-input v-model="scope.row.reportQuantity" type="number"></u-input>
</template> </template>
<template slot="netWeight" slot-scope="scope"> <template slot="netWeight" slot-scope="scope">
<!-- {{ scope.row }} --> <u-input v-model="scope.row.netWeight" type="number" v-if="!scope.row.highlight"></u-input>
<u-input v-model="scope.row.netWeight" type="number"></u-input>
</template> </template>
<template slot="grossWeight" slot-scope="scope"> <template slot="grossWeight" slot-scope="scope">
<!-- {{ scope.row }} --> <u-input v-model="scope.row.grossWeight" type="number" placeholder="" v-if="!scope.row.highlight"></u-input>
<u-input v-model="scope.row.grossWeight" type="number" placeholder=""></u-input>
</template> </template>
<template slot="packageStandard" slot-scope="scope"> <template slot="packageStandard" slot-scope="scope">
<!-- {{ scope.row }} --> <!-- {{ scope.row }} -->
<uni-easyinput type="text" suffixIcon="scan" v-model="scope.row.packageStandard" style="width: 100%" <uni-easyinput type="text" suffixIcon="scan" v-model="scope.row.packageStandard" style="width: 100%"
@iconClick="() => iconPackageStandard(scope.row)" placeholder="装箱规格" /> @iconClick="() => iconPackageStandard(scope.row)" placeholder="装箱规格" v-if="!scope.row.highlight" />
</template> </template>
<template slot="peration" slot-scope="scope"> <template slot="peration" slot-scope="scope">
<!-- {{ scope.row }} --> <!-- {{ scope.row }} -->
...@@ -326,7 +319,7 @@ ...@@ -326,7 +319,7 @@
style="margin-left: 0" class="successBtn"> style="margin-left: 0" class="successBtn">
补打印 补打印
</u-button> </u-button>
<u-button v-else @tap="handleSubmitPackageFeedback(feedback, scope.row, i)" <u-button v-else-if="!scope.row.highlight" @tap="handleSubmitPackageFeedback(feedback, scope.row, i)"
style="margin-left: 0" class="successBtn">打印/报工</u-button> style="margin-left: 0" class="successBtn">打印/报工</u-button>
</template> </template>
</zb-table> </zb-table>
...@@ -1608,6 +1601,10 @@ export default { ...@@ -1608,6 +1601,10 @@ export default {
uni.$off('taskStatusChanged'); uni.$off('taskStatusChanged');
}, },
computed: { computed: {
isWaiXie () {
if (this.vuex_workunit && this.vuex_workunit.workunitName === '广州宝绅委外工作单元') return true
return false
},
computedQuantity() { computedQuantity() {
return this.feedbackForm.quantityQualify + this.feedbackForm.quantityUnqualify; return this.feedbackForm.quantityQualify + this.feedbackForm.quantityUnqualify;
}, },
...@@ -1777,6 +1774,14 @@ export default { ...@@ -1777,6 +1774,14 @@ export default {
return ''; //第二个大 return ''; //第二个大
} }
}, },
// 判断是否显示蓝色
isSizeClassStyle(row, i) {
if (row.feedbackQuantity && row.feedbackQuantity > 0 && row.distributes && row.distributes.length > 0 ) {
return 'grablue'; //已报工
} else {
return ''; //第二个大
}
},
commonClick(oper) { commonClick(oper) {
if (['Refresh', 'MaterialUsageRecord', 'editProd'].indexOf(oper) === -1 && this.tableSelectData.length === 0) { if (['Refresh', 'MaterialUsageRecord', 'editProd'].indexOf(oper) === -1 && this.tableSelectData.length === 0) {
this.$u.toast('请选择工作任务!'); this.$u.toast('请选择工作任务!');
...@@ -2668,12 +2673,18 @@ export default { ...@@ -2668,12 +2673,18 @@ export default {
row.tableOrderData = []; row.tableOrderData = [];
} }
if (res.data.sizeList) { if (res.data.sizeList) {
row.tableSizeData = res.data.sizeList.map((item) => { const Sizelist = []
return { res.data.sizeList.forEach(item => {
let distributes = []
if (item.distributes) {
distributes = item.distributes.map(v => ({...v, highlight: true, qrcode: item.qrcode}))
}
Sizelist.push({
...item, ...item,
reportQuantity: (Number(item.packageNum) || 0) - (Number(item.feedbackQuantity) || 0) reportQuantity: (Number(item.packageNum) || 0) - (Number(item.feedbackQuantity) || 0)
}; }, ...distributes)
}); })
row.tableSizeData = Sizelist
row.listTabPro = [ row.listTabPro = [
{ {
name: 'SIZE列表' name: 'SIZE列表'
...@@ -2748,6 +2759,9 @@ export default { ...@@ -2748,6 +2759,9 @@ export default {
this.$u.toast('打印机连接失败'); this.$u.toast('打印机连接失败');
return; return;
} }
if (!item.printTemplate) {
return this.$u.toast('请选择打印模版')
}
if (!row.grossWeight || !row.packageStandard) { if (!row.grossWeight || !row.packageStandard) {
this.$u.toast('请录入毛重、装箱规格'); this.$u.toast('请录入毛重、装箱规格');
return; return;
...@@ -2788,6 +2802,12 @@ export default { ...@@ -2788,6 +2802,12 @@ export default {
this.$u.toast('打印机连接失败'); this.$u.toast('打印机连接失败');
return; return;
} }
if(row.distributes && row.distributes.length > 0){
const arr = this.$refs['feedSizeRef'][i].currentRow.filter(v=>v.qrcode === row.qrcode)
if (!arr || !arr.length || arr.length !== row.distributes.length) {
return this.$u.toast('请点击确认SIZE数量后再报工');
}
}
item.feedbackTime = this.parseTime(new Date()) item.feedbackTime = this.parseTime(new Date())
this.$u.api this.$u.api
.feedBackPackage({ .feedBackPackage({
...@@ -3594,6 +3614,15 @@ export default { ...@@ -3594,6 +3614,15 @@ export default {
color: #ffffff !important; color: #ffffff !important;
} }
} }
.feedSize {
/deep/ .grablue {
background: #ecf5ff !important;
}
/deep/ .grablue .even {
background: #ecf5ff !important;
}
}
</style> </style>
<style lang="scss"> <style lang="scss">
.mynotable { .mynotable {
......
...@@ -674,9 +674,9 @@ export default { ...@@ -674,9 +674,9 @@ export default {
isHighlight() { isHighlight() {
return (item, index) => { return (item, index) => {
if (this.rowKey) { if (this.rowKey) {
return item.key === this.currentRow['key']; return this.currentRow.findIndex(v => v[this.rowKey] === item[this.rowKey]) > -1;
} else { } else {
return index === this.currentRowIndex; return this.currentRowIndex.indexOf(index) > -1;
} }
}; };
}, },
...@@ -715,8 +715,8 @@ export default { ...@@ -715,8 +715,8 @@ export default {
currentDriver: null, currentDriver: null,
currentDriver1: null, currentDriver1: null,
bodyTime: null, bodyTime: null,
currentRowIndex: null, currentRowIndex: [],
currentRow: {}, currentRow: [],
bodyTime1: null, bodyTime1: null,
headerTime: null, headerTime: null,
debounceTime: null, debounceTime: null,
...@@ -818,8 +818,8 @@ export default { ...@@ -818,8 +818,8 @@ export default {
}); });
}, },
resetHighlight() { resetHighlight() {
this.currentRowIndex = null; this.currentRowIndex = [];
this.currentRow = {}; this.currentRow = [];
}, },
cellClick(row, index, column) { cellClick(row, index, column) {
// console.log(row, index, 'rows cellClick'); // console.log(row, index, 'rows cellClick');
...@@ -869,10 +869,26 @@ export default { ...@@ -869,10 +869,26 @@ export default {
this.$emit('toggleRowSelection', true, this.selectArr); this.$emit('toggleRowSelection', true, this.selectArr);
}, },
rowClick(row, index) { rowClick(row, index) {
if (this.highlight) { if (this.highlight && row.highlight) {
this.currentRowIndex = index; let itemindex = -1
this.currentRow = row; if (this.rowKey) {
this.$emit('currentChange', row, index); itemindex = this.currentRow.findIndex(v => v[this.rowKey] === item[this.rowKey])
if (itemindex > -1) {
this.currentRow.splice(itemindex, 1)
} else {
this.currentRow.push(row)
}
} else {
itemindex = this.currentRowIndex.indexOf(index)
if (itemindex > -1) {
this.currentRowIndex.splice(itemindex, 1)
this.currentRow.splice(itemindex, 1)
} else {
this.currentRowIndex.push(index);
this.currentRow.push(row)
}
}
this.$emit('currentChange', this.currentRow, this.currentRowIndex);
} }
this.$emit('rowClick', row, index); this.$emit('rowClick', row, index);
}, },
......
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