Commit 4251ae03 authored by 沈翠玲's avatar 沈翠玲

装箱报工修改和外协

parent fb4a6d50
......@@ -82,9 +82,9 @@
<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')" v-if="!isWaiXie">开始作业</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')">{{isWaiXie ? '外协收货' : '生产报工'}}</u-button>
<u-button type="success" @click="commonClick('editProd')" v-if="!isWaiXie">修改报工</u-button>
<u-button type="primary" @click="commonClick('FinshTask')" v-if="!isWaiXie">完成作业</u-button>
<u-button type="primary" @click="commonClick('FinshTask')">完成作业</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('MaterialReturn')" v-if="!isWaiXie" v-show="!buttonShow || buttonShow.MaterialReturnView === '1'">退料申请</u-button>
<u-button type="primary" @click="commonClick('ViewPpicture')" v-if="!isWaiXie">查看图片</u-button>
......@@ -93,7 +93,7 @@
</scroll-view>
</view>
<u-modal title="生产报工" @confirm="handleSubmitfeedback" show-cancel-button
<u-modal :title="isWaiXie ? '工序外协收货&报工':'生产报工'" @confirm="handleSubmitfeedback" show-cancel-button
:show-confirm-button="feedbackForms[0] && feedbackForms[0].isPackage === '1' ? false : true"
:title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '37px', 'padding-top': '0px' }"
v-model="proVisible" width="1800rpx">
......@@ -234,12 +234,12 @@
</template>
<template slot="grossWeight" slot-scope="scope">
<!-- {{ scope.row }} -->
<u-input v-model="scope.row.grossWeight" type="number" placeholder=""></u-input>
<u-input v-model="scope.row.grossWeight" type="number" placeholder="" v-if="scope.row.isEncase"></u-input>
</template>
<template slot="packageStandard" slot-scope="scope">
<!-- {{ scope.row }} -->
<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.isEncase" />
</template>
<template slot="peration" slot-scope="scope">
<!-- {{ scope.row }} -->
......@@ -272,12 +272,12 @@
</template>
<template slot="grossWeight" slot-scope="scope">
<!-- {{ scope.row }} -->
<u-input v-model="scope.row.grossWeight" type="number" placeholder=""></u-input>
<u-input v-model="scope.row.grossWeight" type="number" placeholder="" v-if="scope.row.isEncase"></u-input>
</template>
<template slot="packageStandard" slot-scope="scope">
<!-- {{ scope.row }} -->
<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.isEncase" />
</template>
<template slot="peration" slot-scope="scope">
<!-- {{ scope.row }} -->
......@@ -295,8 +295,8 @@
</view>
<!-- SIZE列表 -->
<view v-if="feedback.tableSizeData.length">
<zb-table :columns="feedback.tableSizeColumn" ref="feedSizeRef" :stripe="true" :border="true" highlight
:data="feedback.tableSizeData" :isTrClassStyle="isSizeClassStyle" class="feedSize">
<zb-table :columns="feedback.tableSizeColumn" key="tableSizeData" ref="feedSizeRef" :stripe="true" :border="true" highlight
:data="feedback.tableSizeData" :isTrClassStyle="(row) => isSizeClassStyle(row, feedback.tableSizeData)" class="feedSize">
<template slot="reportQuantity" slot-scope="scope">
<u-input v-model="scope.row.reportQuantity" type="number" v-if="!scope.row.highlight"></u-input>
</template>
......@@ -304,23 +304,15 @@
<u-input v-model="scope.row.netWeight" type="number" v-if="!scope.row.highlight"></u-input>
</template>
<template slot="grossWeight" slot-scope="scope">
<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="" v-if="!scope.row.highlight && scope.row.isEncase"></u-input>
</template>
<template slot="packageStandard" slot-scope="scope">
<!-- {{ scope.row }} -->
<uni-easyinput type="text" suffixIcon="scan" v-model="scope.row.packageStandard" style="width: 100%"
@iconClick="() => iconPackageStandard(scope.row)" placeholder="装箱规格" v-if="!scope.row.highlight" />
@iconClick="() => iconPackageStandard(scope.row)" placeholder="装箱规格" v-if="!scope.row.highlight && scope.row.isEncase" />
</template>
<template slot="peration" slot-scope="scope">
<!-- {{ scope.row }} -->
<u-button v-if="scope.row.isEncase" @tap="handleBlPackagePrintInfo(feedback, scope.row, i)" class="successBtn" style="margin-left: 0">打印</u-button>
<u-button v-else-if="scope.row.feedbackQuantity && Number(scope.row.feedbackQuantity) > 0"
@tap="rePackageInfoPrint(feedback, scope.row, i)"
style="margin-left: 0" class="successBtn">
补打印
</u-button>
<u-button v-else-if="!scope.row.highlight" @tap="handleSubmitPackageFeedback(feedback, scope.row, i)"
style="margin-left: 0" class="successBtn">打印/报工</u-button>
<u-button @tap="sizeclick(feedback, scope.row, i)" v-if="!scope.row.highlight" class="successBtn" style="margin-left: 0">{{getfeedbackQuantity(scope.row)}}</u-button>
</template>
</zb-table>
</view>
......@@ -329,6 +321,50 @@
<view v-else>
<u-form label-width="100px" :model="feedback" :rules="rules" labelAlign="right">
<template v-if="isWaiXie">
<u-row>
<u-col span="4">
<u-form-item label="生产工单:" prop="quantity">
{{ feedback.workorderCode }}
</u-form-item>
</u-col>
<u-col span="4">
<u-form-item label="采购单号:" prop="quantity">
{{ feedback.assistProcessCode }}
</u-form-item>
</u-col>
<u-col span="4">
<u-form-item label="工序:" prop="nickName">
{{ feedback.processName }}
</u-form-item>
</u-col>
</u-row>
<u-row>
<u-col span="8">
<u-form-item label="已收货数:" prop="quantity">
{{ feedback.quantityFeedback }}
</u-form-item>
</u-col>
<u-col span="4">
<u-form-item label="未收货数:" prop="nickName">
{{ feedback.unquantityFeedback }}
</u-form-item>
</u-col>
</u-row>
<u-row>
<u-col span="4">
<u-form-item label="产品料号:" prop="quantity">
{{ feedback.productCode }}
</u-form-item>
</u-col>
<u-col span="8">
<u-form-item label="产品名称:" prop="nickName">
{{ feedback.productName }}
</u-form-item>
</u-col>
</u-row>
</template>
<template v-else>
<u-row>
<u-col span="6">
<u-form-item label="任务单号:" prop="quantity">
......@@ -343,25 +379,18 @@
</u-row>
<u-row>
<u-col :span="6">
<u-form-item :label="feedback.taskType&&feedback.taskType===3 ? '委外数量:' : '已报工数:'" prop="quantity">
<span v-if="feedback.taskType&&feedback.taskType===3">{{ feedback.quantityQualify }}</span>
<span :style="{background: feedback.overFeedback ? '#f56c6c' : '#fff', padding: '0 5px'}" v-else>{{ feedback.workorderFeedbackSum }}</span>
<u-form-item label="已报工数:" prop="quantity">
<span :style="{background: feedback.overFeedback ? '#f56c6c' : '#fff', padding: '0 5px'}">{{ feedback.workorderFeedbackSum }}</span>
<!-- {{ computedQuantityV2 }} -->
</u-form-item>
</u-col>
<u-col :span="6" v-if="!feedback.taskType || feedback.taskType!==3">
<u-col :span="6">
<u-form-item label="未报工数:">
{{ feedback.workorderUnfeedbackSum }}
<!-- {{ computedQuantityV2 }} -->
</u-form-item>
</u-col>
<u-col :span="6" v-else>
<u-form-item label="报工人:" prop="nickName">
<u-input v-model="feedback.nickName"></u-input>
<u-button @tap="getCode(feedback)" type="success" size="mini">报工人员</u-button>
</u-form-item>
</u-col>
</u-row>
<u-row>
......@@ -373,12 +402,12 @@
<u-col :span="6">
<u-form-item label="生产工单:" prop="workorderId">
<view v-if="feedback.taskType&&feedback.taskType===3">{{feedback.workorderCode}}</view>
<uni-data-select v-model="feedback.workorderId" v-else :localdata="feedback.workorderOption"
<uni-data-select v-model="feedback.workorderId" :localdata="feedback.workorderOption"
@change="workorderSelect($event, i)"></uni-data-select>
</u-form-item>
</u-col>
</u-row>
</template>
<u-row>
<!--
<view>
......@@ -410,13 +439,13 @@
v-model="feedback.quantityQualify" :long-press="false"></u-number-box>
</u-form-item>
</u-col>
<u-col span="6" v-if="!feedback.taskType||feedback.taskType!==3">
<u-col span="6">
<u-form-item label="不良品数量:" prop="quantityUnqualify">
<u-number-box :min="0" @change="quantityChanged()" :max="99999999999999999999999999999999999999999" :input-width="190"
v-model="feedback.quantityUnqualify" :long-press="false"></u-number-box>
</u-form-item>
</u-col>
<u-col span="6" v-if="!feedback.taskType||feedback.taskType!==3">
<u-col span="6">
<u-form-item class="column-type" label-width="100px" label="合格数量(副):" prop="feedbackQuantityFu">
<view class="button-type2">
<u-number-box :min="0" key="numberBox1" :max="99999999999999999999999999999999999999999" :input-width="190"
......@@ -426,10 +455,10 @@
</u-form-item>
</u-col>
<u-col span="6" v-if="!feedback.taskType||feedback.taskType!==3">
<u-col span="6">
<u-form-item class="column-type" label-width="100px" label="不良品数量(副):" prop="feedbackUnQuantityFu">
<u-number-box :min="0" align="right" key="numberBox2" :max="99999999999999999999999999999999999999999" :input-width="190"
@change="()=>quantityChangedV3(feedback, feedbackQuantityFu, feedbackUnQuantityFu)"
@change="()=>quantityChangedV2(feedback, feedbackQuantityFu, feedbackUnQuantityFu)"
v-model="feedbackUnQuantityFu" :long-press="false"></u-number-box>
</u-form-item>
</u-col>
......@@ -439,23 +468,13 @@
v-model="feedback.feedbackTime" />
</u-form-item>
</u-col>
<u-col span="6" v-if="feedback.taskType&&feedback.taskType===3">
<u-form-item label="是否关单:" prop="closeType" >
<view class="uni-list-item__extra">
<u-radio-group v-model="feedback.closeType">
<u-radio :name="1"></u-radio>
<u-radio :name="0"></u-radio>
</u-radio-group>
</view>
</u-form-item>
</u-col>
<u-col :span="6" v-if="!feedback.taskType || feedback.taskType!==3">
<u-col :span="6" >
<u-form-item label="报工人:" prop="nickName">
<u-input v-model="feedback.nickName"></u-input>
<u-button @tap="getCode(feedback)" type="success" size="mini">报工人员</u-button>
</u-form-item>
</u-col>
<u-col span="6" v-if="!feedback.taskType || feedback.taskType!==3">
<u-col span="6" >
<u-form-item label="打印:" prop="whether">
<view class="uni-list-item__extra">
<u-radio-group v-model="feedback.whether">
......@@ -1583,6 +1602,153 @@ export default {
uni.$on('switchWorkunit', (station) => {
// this.reset();
this.getTaskList();
if (this.isWaiXie) {
this.tableColumn = [
{
type: 'selection',
width: 60
},
{
name: 'workorderCode',
label: '工单号',
align: 'center',
width: 85
},
{
name: 'scheduleStartDateStr',
label: '计划开始时间',
align: 'center',
width: 95
},
{
name: 'scheduleEndDateStr',
label: '计划结束时间',
align: 'center',
width: 95
},
{
name: 'productCode',
label: '产品编码',
align: 'center',
width: 70
},
{
name: 'quantity',
label: '外发数量',
align: 'center',
width: 80
},
{
name: 'quantityFeedback',
label: '已收货数量',
align: 'center',
width: 80
},
{
name: 'assistProcessCode',
label: '采购单号',
align: 'center',
width: 100
},
{
name: 'processName',
label: '工序',
align: 'center',
width: 80
},
{
name: 'quantityQualify',
label: '合格数量',
align: 'center',
width: 70
},
{
name: 'quantityUnqualify',
label: '不合格数量',
align: 'center',
width: 80
}
]
} else {
this.tableColumn = [
{
type: 'selection',
width: 60
},
{
name: 'arrangeCode',
label: '编排单号',
align: 'center',
width: 85,
cellFun: (row, index) => {
console.log(row, index);
this.tableDataDetail = row.proWorkorderList;
this.showRowDeatilFlag = true;
}
},
{
name: 'scheduleStartDateStr',
label: '计划开始时间',
align: 'center',
width: 95
},
{
name: 'scheduleEndDateStr',
label: '计划结束时间',
align: 'center',
width: 95
},
{
name: 'quantity',
label: '任务数量',
align: 'center',
width: 70
},
{
name: 'quantityWait',
label: '可加工数量',
align: 'center',
width: 80
},
{
name: 'status',
label: '状态',
align: 'center',
filters: {
PREPARE: '未开工',
BEGINNING: '已开工',
PAUSE: '暂停',
ERROR_STOP: '异常停工',
FINISH: '完工'
},
width: 65
},
{
name: 'taskCode',
label: '任务单号',
align: 'center',
width: 100
},
{
name: 'processName',
label: '工序',
align: 'center',
width: 80
},
{
name: 'quantityQualify',
label: '合格数量',
align: 'center',
width: 70
},
{
name: 'quantityUnqualify',
label: '不合格数量',
align: 'center',
width: 80
}
]
}
});
uni.$on('taskStatusChanged', () => {
......@@ -1622,7 +1788,7 @@ export default {
},
methods: {
cellStyle ({ row,column,rowIndex,columnIndex }) {
if(columnIndex === 1) {
if(columnIndex === 1 && !this.isWaiXie) {
return {color: '#3578ff !important'}
}
return ''
......@@ -1714,6 +1880,24 @@ export default {
urls: this.viewSop
});
},
getfeedbackQuantity(row, index){
if (row.isEncase) {
return '打印'
} else if (row.feedbackQuantity && Number(row.feedbackQuantity) > 0) {
return '补打印'
} else {
return '打印/报工'
}
},
sizeclick(feedback, row, i){
if (row.isEncase) {
this.handleBlPackagePrintInfo(feedback, row, i)
} else if (row.feedbackQuantity) {
this.rePackageInfoPrint(feedback, row, i)
} else {
this.handleSubmitPackageFeedback(feedback, row, i)
}
},
// cellClick(row, index, column) {
// if (column.name === 'arrangeCode') {
// this.tableDataDetail = row.proWorkorderList;
......@@ -1775,8 +1959,9 @@ export default {
}
},
// 判断是否显示蓝色
isSizeClassStyle(row, i) {
if (row.feedbackQuantity && row.feedbackQuantity > 0 && row.distributes && row.distributes.length > 0 ) {
isSizeClassStyle(row, list) {
const item = list.find(v=>v.qrcode === row.qrcode && v.distributes && v.distributes.length > 0)
if (item && item.feedbackQuantity > 0 && row.highlight ) {
return 'grablue'; //已报工
} else {
return ''; //第二个大
......@@ -1844,7 +2029,11 @@ export default {
this.$u.toast('工序未开工');
return;
}
if(this.isWaiXie) {
this.assistFeed()
} else {
this.doFeedback();
}
break;
case 'editProd':
this.doEditProd();
......@@ -2254,13 +2443,22 @@ export default {
const t = this;
this.tableData = [];
this.tableSelectData = []
this.$u.api
let apires
if(this.isWaiXie) {
apires = this.$u.api
.getAssistProcesslist({
workorderCode: this.tableParams.arrangeCode,
allowProduce: this.tableParams.allowProduce
})
} else {
apires = this.$u.api
.getTaskList({
workunitId: t.vuex_workunit.workunitId,
...this.tableParams,
...params
})
.then((res) => {
}
apires.then((res) => {
if (res.code === 200) {
let currentIndex = -1
this.$refs['zbtable'].bodyScrollTop = 0
......@@ -2445,23 +2643,6 @@ export default {
feedback.quantity = feedback.quantityUnqualify + feedback.quantityQualify;
},
quantityChangedV3(feedback, val1, val2) {
let qq = (val1 === 0 || val1 === null) ? 0 : val1;
let quq = (val2 === 0 || val2 === null) ? 0 : val2;
if (qq > 0) {
feedback.quantityQualify = qq / (feedback.unitOfConvert || 1);
}
if (quq > 0) {
feedback.quantityUnqualify = quq / (feedback.unitOfConvert || 1);
}
feedback.quantityUnqualify = isNaN(feedback.quantityUnqualify) || feedback.quantityUnqualify === null ? 0 : feedback.quantityUnqualify;
feedback.quantityQualify = isNaN(feedback.quantityQualify) || feedback.quantityQualify === null ? 0 : feedback.quantityQualify;
feedback.quantity = feedback.quantityUnqualify + feedback.quantityQualify;
},
getPrintTemplate(row) {
this.printTemplateData = row;
this.printTemplateVisible = true;
......@@ -2474,6 +2655,25 @@ export default {
this.printTemplateData.printTemplate = this.$refs.printTemplateRef.tableSelectData[0].name;
this.printTemplateVisible = false;
},
assistFeed () {
const taskInfo = this.tableSelectData[0];
this.feedbackForms = [];
this.feedbackUnQuantityFu = 0;
this.feedbackQuantityFu = 0;
this.$u.api.assistFeedback({
assistProcessCode: taskInfo.assistProcessCode,
assistProcessItemCode: taskInfo.assistProcessItemCode
}).then((res) => {
if (res.code === 200) {
// row.quantityQualify = res.data.workorderQualify
const feedback = res.data
feedback['unquantityFeedback'] = res.data.quantity - res.data.quantityFeedback
feedback['quantityUnqualify'] = 0
feedback['quantityQualify'] = 0
this.feedbackForms.push(feedback)
}
})
},
async doFeedback() {
// this.reset();
this.feedbackUnQuantityFu = 0;
......@@ -2677,14 +2877,15 @@ export default {
res.data.sizeList.forEach(item => {
let distributes = []
if (item.distributes) {
distributes = item.distributes.map(v => ({...v, highlight: true, qrcode: item.qrcode}))
distributes = item.distributes.map(v => ({...v, standardSizeIdx: ' ',feedbackQuantity:' ', highlight: true, qrcode: item.qrcode}))
}
Sizelist.push({
...item,
feedbackQuantity: item.feedbackQuantity,
reportQuantity: (Number(item.packageNum) || 0) - (Number(item.feedbackQuantity) || 0)
}, ...distributes)
})
row.tableSizeData = Sizelist
row.tableSizeData = JSON.parse(JSON.stringify(Sizelist))
row.listTabPro = [
{
name: 'SIZE列表'
......@@ -2940,6 +3141,7 @@ export default {
this.proVisible = false;
this.timeTest.isshow = false;
this.feedbackForms.forEach((item) => {
console.log('item.printTemplate', item.printTemplate)
if (item.quantity === 0 || item.quantity === null) {
this.$u.toast('请填写合格/不合格产品数量!');
return;
......@@ -2951,6 +3153,16 @@ export default {
this.$u.toast('打印机连接失败');
return;
}
let apires
if(this.isWaiXie) {
const par = {
...item,
userName: item.userName || this.vuex_user.userName,
printContents: item.whether == '1' ? item.printContents : null
}
apires = this.$u.api
.assistFeedback(par)
} else {
const par = {
//工单
taskWorkunitId: item.taskWorkunitId,
......@@ -2984,9 +3196,11 @@ export default {
if (item.taskType === 3) {
par.closeType = item.closeType
}
this.$u.api
apires = this.$u.api
.feedback(par)
.then((res) => {
}
apires.then((res) => {
if (res.code === 200) {
this.proVisible = false;
if (item.printTemplate) {
......@@ -3621,6 +3835,9 @@ export default {
/deep/ .grablue .even {
background: #ecf5ff !important;
}
/deep/ .grablue .odd {
background: #ecf5ff !important;
}
}
</style>
......
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