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

装箱报工修改和外协

parent fb4a6d50
...@@ -82,9 +82,9 @@ ...@@ -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="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="success" @click="commonClick('StartTask')" v-if="!isWaiXie">开始作业</u-button>
<u-button type="warning" @click="commonClick('StopTask')" 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="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('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('MaterialReturn')" v-if="!isWaiXie" v-show="!buttonShow || buttonShow.MaterialReturnView === '1'">退料申请</u-button>
<u-button type="primary" @click="commonClick('ViewPpicture')" v-if="!isWaiXie">查看图片</u-button> <u-button type="primary" @click="commonClick('ViewPpicture')" v-if="!isWaiXie">查看图片</u-button>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</scroll-view> </scroll-view>
</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" :show-confirm-button="feedbackForms[0] && feedbackForms[0].isPackage === '1' ? false : 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="proVisible" width="1800rpx"> v-model="proVisible" width="1800rpx">
...@@ -234,12 +234,12 @@ ...@@ -234,12 +234,12 @@
</template> </template>
<template slot="grossWeight" slot-scope="scope"> <template slot="grossWeight" slot-scope="scope">
<!-- {{ scope.row }} --> <!-- {{ 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>
<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.isEncase" />
</template> </template>
<template slot="peration" slot-scope="scope"> <template slot="peration" slot-scope="scope">
<!-- {{ scope.row }} --> <!-- {{ scope.row }} -->
...@@ -272,12 +272,12 @@ ...@@ -272,12 +272,12 @@
</template> </template>
<template slot="grossWeight" slot-scope="scope"> <template slot="grossWeight" slot-scope="scope">
<!-- {{ scope.row }} --> <!-- {{ 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>
<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.isEncase" />
</template> </template>
<template slot="peration" slot-scope="scope"> <template slot="peration" slot-scope="scope">
<!-- {{ scope.row }} --> <!-- {{ scope.row }} -->
...@@ -295,8 +295,8 @@ ...@@ -295,8 +295,8 @@
</view> </view>
<!-- SIZE列表 --> <!-- SIZE列表 -->
<view v-if="feedback.tableSizeData.length"> <view v-if="feedback.tableSizeData.length">
<zb-table :columns="feedback.tableSizeColumn" ref="feedSizeRef" :stripe="true" :border="true" highlight <zb-table :columns="feedback.tableSizeColumn" key="tableSizeData" ref="feedSizeRef" :stripe="true" :border="true" highlight
:data="feedback.tableSizeData" :isTrClassStyle="isSizeClassStyle" class="feedSize"> :data="feedback.tableSizeData" :isTrClassStyle="(row) => isSizeClassStyle(row, feedback.tableSizeData)" class="feedSize">
<template slot="reportQuantity" slot-scope="scope"> <template slot="reportQuantity" slot-scope="scope">
<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" v-if="!scope.row.highlight"></u-input>
</template> </template>
...@@ -304,23 +304,15 @@ ...@@ -304,23 +304,15 @@
<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" v-if="!scope.row.highlight"></u-input>
</template> </template>
<template slot="grossWeight" slot-scope="scope"> <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>
<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="装箱规格" v-if="!scope.row.highlight" /> @iconClick="() => iconPackageStandard(scope.row)" placeholder="装箱规格" v-if="!scope.row.highlight && scope.row.isEncase" />
</template> </template>
<template slot="peration" slot-scope="scope"> <template slot="peration" slot-scope="scope">
<!-- {{ scope.row }} --> <u-button @tap="sizeclick(feedback, scope.row, i)" v-if="!scope.row.highlight" class="successBtn" style="margin-left: 0">{{getfeedbackQuantity(scope.row)}}</u-button>
<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>
</template> </template>
</zb-table> </zb-table>
</view> </view>
...@@ -329,56 +321,93 @@ ...@@ -329,56 +321,93 @@
<view v-else> <view v-else>
<u-form label-width="100px" :model="feedback" :rules="rules" labelAlign="right"> <u-form label-width="100px" :model="feedback" :rules="rules" labelAlign="right">
<u-row> <template v-if="isWaiXie">
<u-col span="6"> <u-row>
<u-form-item label="任务单号:" prop="quantity"> <u-col span="4">
{{ feedback.taskCode }} <u-form-item label="生产工单:" prop="quantity">
</u-form-item> {{ feedback.workorderCode }}
</u-col> </u-form-item>
<u-col span="6"> </u-col>
<u-form-item label="工序:" prop="nickName"> <u-col span="4">
{{ feedback.processName }} <u-form-item label="采购单号:" prop="quantity">
</u-form-item> {{ feedback.assistProcessCode }}
</u-col> </u-form-item>
</u-row> </u-col>
<u-row> <u-col span="4">
<u-col :span="6"> <u-form-item label="工序:" prop="nickName">
<u-form-item :label="feedback.taskType&&feedback.taskType===3 ? '委外数量:' : '已报工数:'" prop="quantity"> {{ feedback.processName }}
<span v-if="feedback.taskType&&feedback.taskType===3">{{ feedback.quantityQualify }}</span> </u-form-item>
<span :style="{background: feedback.overFeedback ? '#f56c6c' : '#fff', padding: '0 5px'}" v-else>{{ feedback.workorderFeedbackSum }}</span> </u-col>
<!-- {{ computedQuantityV2 }} --> </u-row>
</u-form-item> <u-row>
</u-col> <u-col span="8">
<u-col :span="6" v-if="!feedback.taskType || feedback.taskType!==3"> <u-form-item label="已收货数:" prop="quantity">
<u-form-item label="未报工数:"> {{ feedback.quantityFeedback }}
{{ feedback.workorderUnfeedbackSum }} </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">
{{ feedback.taskCode }}
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="工序:" prop="nickName">
{{ feedback.processName }}
</u-form-item>
</u-col>
</u-row>
<u-row>
<u-col :span="6">
<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">
<u-form-item label="未报工数:">
{{ feedback.workorderUnfeedbackSum }}
<!-- {{ computedQuantityV2 }} --> <!-- {{ computedQuantityV2 }} -->
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col :span="6" v-else> </u-row>
<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> <u-row>
<u-col :span="6"> <u-col :span="6">
<u-form-item label="编排单号:" prop="quantity"> <u-form-item label="编排单号:" prop="quantity">
{{ feedback.arrangeCode }} {{ feedback.arrangeCode }}
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col :span="6"> <u-col :span="6">
<u-form-item label="生产工单:" prop="workorderId"> <u-form-item label="生产工单:" prop="workorderId">
<view v-if="feedback.taskType&&feedback.taskType===3">{{feedback.workorderCode}}</view> <uni-data-select v-model="feedback.workorderId" :localdata="feedback.workorderOption"
<uni-data-select v-model="feedback.workorderId" v-else :localdata="feedback.workorderOption" @change="workorderSelect($event, i)"></uni-data-select>
@change="workorderSelect($event, i)"></uni-data-select> </u-form-item>
</u-form-item> </u-col>
</u-col> </u-row>
</u-row> </template>
<u-row> <u-row>
<!-- <!--
<view> <view>
...@@ -410,13 +439,13 @@ ...@@ -410,13 +439,13 @@
v-model="feedback.quantityQualify" :long-press="false"></u-number-box> v-model="feedback.quantityQualify" :long-press="false"></u-number-box>
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="6" v-if="!feedback.taskType||feedback.taskType!==3"> <u-col span="6">
<u-form-item label="不良品数量:" prop="quantityUnqualify"> <u-form-item label="不良品数量:" prop="quantityUnqualify">
<u-number-box :min="0" @change="quantityChanged()" :max="99999999999999999999999999999999999999999" :input-width="190" <u-number-box :min="0" @change="quantityChanged()" :max="99999999999999999999999999999999999999999" :input-width="190"
v-model="feedback.quantityUnqualify" :long-press="false"></u-number-box> v-model="feedback.quantityUnqualify" :long-press="false"></u-number-box>
</u-form-item> </u-form-item>
</u-col> </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"> <u-form-item class="column-type" label-width="100px" label="合格数量(副):" prop="feedbackQuantityFu">
<view class="button-type2"> <view class="button-type2">
<u-number-box :min="0" key="numberBox1" :max="99999999999999999999999999999999999999999" :input-width="190" <u-number-box :min="0" key="numberBox1" :max="99999999999999999999999999999999999999999" :input-width="190"
...@@ -426,10 +455,10 @@ ...@@ -426,10 +455,10 @@
</u-form-item> </u-form-item>
</u-col> </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-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" <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> v-model="feedbackUnQuantityFu" :long-press="false"></u-number-box>
</u-form-item> </u-form-item>
</u-col> </u-col>
...@@ -439,23 +468,13 @@ ...@@ -439,23 +468,13 @@
v-model="feedback.feedbackTime" /> v-model="feedback.feedbackTime" />
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="6" v-if="feedback.taskType&&feedback.taskType===3"> <u-col :span="6" >
<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-form-item label="报工人:" prop="nickName"> <u-form-item label="报工人:" prop="nickName">
<u-input v-model="feedback.nickName"></u-input> <u-input v-model="feedback.nickName"></u-input>
<u-button @tap="getCode(feedback)" type="success" size="mini">报工人员</u-button> <u-button @tap="getCode(feedback)" type="success" size="mini">报工人员</u-button>
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="6" v-if="!feedback.taskType || feedback.taskType!==3"> <u-col span="6" >
<u-form-item label="打印:" prop="whether"> <u-form-item label="打印:" prop="whether">
<view class="uni-list-item__extra"> <view class="uni-list-item__extra">
<u-radio-group v-model="feedback.whether"> <u-radio-group v-model="feedback.whether">
...@@ -1583,6 +1602,153 @@ export default { ...@@ -1583,6 +1602,153 @@ export default {
uni.$on('switchWorkunit', (station) => { uni.$on('switchWorkunit', (station) => {
// this.reset(); // this.reset();
this.getTaskList(); 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', () => { uni.$on('taskStatusChanged', () => {
...@@ -1622,7 +1788,7 @@ export default { ...@@ -1622,7 +1788,7 @@ export default {
}, },
methods: { methods: {
cellStyle ({ row,column,rowIndex,columnIndex }) { cellStyle ({ row,column,rowIndex,columnIndex }) {
if(columnIndex === 1) { if(columnIndex === 1 && !this.isWaiXie) {
return {color: '#3578ff !important'} return {color: '#3578ff !important'}
} }
return '' return ''
...@@ -1714,6 +1880,24 @@ export default { ...@@ -1714,6 +1880,24 @@ export default {
urls: this.viewSop 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) { // cellClick(row, index, column) {
// if (column.name === 'arrangeCode') { // if (column.name === 'arrangeCode') {
// this.tableDataDetail = row.proWorkorderList; // this.tableDataDetail = row.proWorkorderList;
...@@ -1775,8 +1959,9 @@ export default { ...@@ -1775,8 +1959,9 @@ export default {
} }
}, },
// 判断是否显示蓝色 // 判断是否显示蓝色
isSizeClassStyle(row, i) { isSizeClassStyle(row, list) {
if (row.feedbackQuantity && row.feedbackQuantity > 0 && row.distributes && row.distributes.length > 0 ) { const item = list.find(v=>v.qrcode === row.qrcode && v.distributes && v.distributes.length > 0)
if (item && item.feedbackQuantity > 0 && row.highlight ) {
return 'grablue'; //已报工 return 'grablue'; //已报工
} else { } else {
return ''; //第二个大 return ''; //第二个大
...@@ -1844,7 +2029,11 @@ export default { ...@@ -1844,7 +2029,11 @@ export default {
this.$u.toast('工序未开工'); this.$u.toast('工序未开工');
return; return;
} }
this.doFeedback(); if(this.isWaiXie) {
this.assistFeed()
} else {
this.doFeedback();
}
break; break;
case 'editProd': case 'editProd':
this.doEditProd(); this.doEditProd();
...@@ -2254,69 +2443,78 @@ export default { ...@@ -2254,69 +2443,78 @@ export default {
const t = this; const t = this;
this.tableData = []; this.tableData = [];
this.tableSelectData = [] this.tableSelectData = []
this.$u.api let apires
.getTaskList({ if(this.isWaiXie) {
workunitId: t.vuex_workunit.workunitId, apires = this.$u.api
...this.tableParams, .getAssistProcesslist({
...params workorderCode: this.tableParams.arrangeCode,
}) allowProduce: this.tableParams.allowProduce
.then((res) => { })
if (res.code === 200) { } else {
let currentIndex = -1 apires = this.$u.api
this.$refs['zbtable'].bodyScrollTop = 0 .getTaskList({
// 过滤可加工数量为0的数据 workunitId: t.vuex_workunit.workunitId,
this.tableData = res.rows.map((item, index) => { ...this.tableParams,
if (item.location) { ...params
currentIndex = index })
item['checked'] = true }
this.tableSelectData.push(item) apires.then((res) => {
} if (res.code === 200) {
return { let currentIndex = -1
...item, this.$refs['zbtable'].bodyScrollTop = 0
scheduleStartDateStr: item.scheduleStartDate.substring(2, 16), // 过滤可加工数量为0的数据
scheduleEndDateStr: item.scheduleEndDate.substring(2, 16) this.tableData = res.rows.map((item, index) => {
}; if (item.location) {
}); currentIndex = index
if (this.tableData.length > 0) { item['checked'] = true
this.curTaskInfo = this.tableData[0]; this.tableSelectData.push(item)
this.getMaterialUsageRecordList(); }
if (currentIndex > -1) { return {
this.$nextTick(()=>{ ...item,
const query = uni.createSelectorQuery().in(this) scheduleStartDateStr: item.scheduleStartDate.substring(2, 16),
query scheduleEndDateStr: item.scheduleEndDate.substring(2, 16)
.select('#tableBody') };
.boundingClientRect() });
query.selectAll('#tableBody .item-tr') if (this.tableData.length > 0) {
.boundingClientRect() this.curTaskInfo = this.tableData[0];
query.exec(res => { this.getMaterialUsageRecordList();
const data1 = res[0] if (currentIndex > -1) {
let scrollTop = 0 this.$nextTick(()=>{
// const currentIndexPlus = currentIndex + 1 const query = uni.createSelectorQuery().in(this)
let sumheight = 0 query
if (res[1] && Array.isArray(res[1]) && res[1].length > 0) { .select('#tableBody')
res[1].forEach((item, index) => { .boundingClientRect()
if (index < currentIndex) { query.selectAll('#tableBody .item-tr')
sumheight += item.height .boundingClientRect()
} query.exec(res => {
}) const data1 = res[0]
// 当查找项高度不在当前窗口,需要滚动到指定高度 let scrollTop = 0
// 当查找项目在当前窗口,则不滚动 // const currentIndexPlus = currentIndex + 1
// 当查找项目只有一半部分在当前窗口,则滚动到当前项目之前叠加的高度 let sumheight = 0
scrollTop = (sumheight > data1.height) ? sumheight : (res[1][currentIndex].height + sumheight) > data1.height ? sumheight : 0 if (res[1] && Array.isArray(res[1]) && res[1].length > 0) {
} else { res[1].forEach((item, index) => {
const height = 80.8 if (index < currentIndex) {
scrollTop = ((height * currentIndex) > data1.height) ? (height * currentIndex) : 0 sumheight += item.height
} }
})
this.$refs['zbtable'].bodyScrollTop = scrollTop // 当查找项高度不在当前窗口,需要滚动到指定高度
}) // 当查找项目在当前窗口,则不滚动
}) // 当查找项目只有一半部分在当前窗口,则滚动到当前项目之前叠加的高度
} scrollTop = (sumheight > data1.height) ? sumheight : (res[1][currentIndex].height + sumheight) > data1.height ? sumheight : 0
} else {
const height = 80.8
scrollTop = ((height * currentIndex) > data1.height) ? (height * currentIndex) : 0
}
this.$refs['zbtable'].bodyScrollTop = scrollTop
})
})
} }
} }
}).catch(e=>{ }
console.log('eee', e) }).catch(e=>{
}) console.log('eee', e)
})
}, },
typeChange(index) { typeChange(index) {
this.currentType = index; this.currentType = index;
...@@ -2445,23 +2643,6 @@ export default { ...@@ -2445,23 +2643,6 @@ export default {
feedback.quantity = feedback.quantityUnqualify + feedback.quantityQualify; 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) { getPrintTemplate(row) {
this.printTemplateData = row; this.printTemplateData = row;
this.printTemplateVisible = true; this.printTemplateVisible = true;
...@@ -2474,6 +2655,25 @@ export default { ...@@ -2474,6 +2655,25 @@ export default {
this.printTemplateData.printTemplate = this.$refs.printTemplateRef.tableSelectData[0].name; this.printTemplateData.printTemplate = this.$refs.printTemplateRef.tableSelectData[0].name;
this.printTemplateVisible = false; 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() { async doFeedback() {
// this.reset(); // this.reset();
this.feedbackUnQuantityFu = 0; this.feedbackUnQuantityFu = 0;
...@@ -2677,14 +2877,15 @@ export default { ...@@ -2677,14 +2877,15 @@ export default {
res.data.sizeList.forEach(item => { res.data.sizeList.forEach(item => {
let distributes = [] let distributes = []
if (item.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({ Sizelist.push({
...item, ...item,
feedbackQuantity: item.feedbackQuantity,
reportQuantity: (Number(item.packageNum) || 0) - (Number(item.feedbackQuantity) || 0) reportQuantity: (Number(item.packageNum) || 0) - (Number(item.feedbackQuantity) || 0)
}, ...distributes) }, ...distributes)
}) })
row.tableSizeData = Sizelist row.tableSizeData = JSON.parse(JSON.stringify(Sizelist))
row.listTabPro = [ row.listTabPro = [
{ {
name: 'SIZE列表' name: 'SIZE列表'
...@@ -2940,6 +3141,7 @@ export default { ...@@ -2940,6 +3141,7 @@ export default {
this.proVisible = false; this.proVisible = false;
this.timeTest.isshow = false; this.timeTest.isshow = false;
this.feedbackForms.forEach((item) => { this.feedbackForms.forEach((item) => {
console.log('item.printTemplate', item.printTemplate)
if (item.quantity === 0 || item.quantity === null) { if (item.quantity === 0 || item.quantity === null) {
this.$u.toast('请填写合格/不合格产品数量!'); this.$u.toast('请填写合格/不合格产品数量!');
return; return;
...@@ -2951,7 +3153,17 @@ export default { ...@@ -2951,7 +3153,17 @@ export default {
this.$u.toast('打印机连接失败'); this.$u.toast('打印机连接失败');
return; return;
} }
const par = { 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, taskWorkunitId: item.taskWorkunitId,
taskId: item.taskId, taskId: item.taskId,
...@@ -2984,9 +3196,11 @@ export default { ...@@ -2984,9 +3196,11 @@ export default {
if (item.taskType === 3) { if (item.taskType === 3) {
par.closeType = item.closeType par.closeType = item.closeType
} }
this.$u.api apires = this.$u.api
.feedback(par) .feedback(par)
.then((res) => { }
apires.then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.proVisible = false; this.proVisible = false;
if (item.printTemplate) { if (item.printTemplate) {
...@@ -3621,6 +3835,9 @@ export default { ...@@ -3621,6 +3835,9 @@ export default {
/deep/ .grablue .even { /deep/ .grablue .even {
background: #ecf5ff !important; background: #ecf5ff !important;
} }
/deep/ .grablue .odd {
background: #ecf5ff !important;
}
} }
</style> </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