Commit 8ff52689 authored by 沈翠玲's avatar 沈翠玲

外协对接

parent e5974890
...@@ -65,6 +65,9 @@ const install = (Vue, vm) => { ...@@ -65,6 +65,9 @@ const install = (Vue, vm) => {
//获取当前工作中心的生产任务 //获取当前工作中心的生产任务
getTaskList: (params = {}) => getTaskList: (params = {}) =>
vm.$u.get(config.adminPath + '/mobile/pro/protask/getTaskList', params), vm.$u.get(config.adminPath + '/mobile/pro/protask/getTaskList', params),
//外协列表
getAssistProcesslist: (params = {}) =>
vm.$u.postJson(config.adminPath + '/md/assistprocess/getAssistProcesslist', params),
//根据任务ID获取任务详情 //根据任务ID获取任务详情
getTaskInfo: (params = {}) => getTaskInfo: (params = {}) =>
vm.$u.get(config.adminPath + '/mobile/pro/protask/' + params.taskId), vm.$u.get(config.adminPath + '/mobile/pro/protask/' + params.taskId),
...@@ -80,6 +83,12 @@ const install = (Vue, vm) => { ...@@ -80,6 +83,12 @@ const install = (Vue, vm) => {
//生产报工 //生产报工
feedback: (params = {}) => feedback: (params = {}) =>
vm.$u.post(config.adminPath + '/mobile/pro/protask/feedback', params), vm.$u.post(config.adminPath + '/mobile/pro/protask/feedback', params),
//外协报工
assistFeedback: (params = {}) =>
vm.$u.postJson(config.adminPath + '/mobile/pro/protask/assistFeedback', params),
//外协报工详情
feedbackinfo: (params = {}) =>
vm.$u.postJson(config.adminPath + '/md/assistprocess/feedbackinfo', params),
// 获取修改报工列表 // 获取修改报工列表
feedbacklist: (params = {}) => feedbacklist: (params = {}) =>
vm.$u.get(config.adminPath + '/mes/pro/feedback/list', params), vm.$u.get(config.adminPath + '/mes/pro/feedback/list', params),
......
...@@ -34,43 +34,6 @@ ...@@ -34,43 +34,6 @@
@toggleAllSelection="toggleAllSelection" :border="true" :data="tableData"></zb-table> @toggleAllSelection="toggleAllSelection" :border="true" :data="tableData"></zb-table>
</view> </view>
<view class="prod-body-left-num">可选订单数:{{ tableData.length }}</view> <view class="prod-body-left-num">可选订单数:{{ tableData.length }}</view>
<!-- <view class="prod-body-left-bom"> -->
<!-- <view class="prod-body-left-bom-type">-->
<!-- <u-subsection :list="typeList" :current="currentType" type="primary" font-size="28"-->
<!-- @change="typeChange"></u-subsection>-->
<!-- </view>-->
<!-- <view class="prod-body-left-bom-table">-->
<!-- <u-form>-->
<!-- <u-row gutter="16">-->
<!-- <u-col span="3">-->
<!-- <u-form-item label="任务单号" label-width="150">-->
<!-- {{ curTaskInfo.taskCode }}-->
<!-- </u-form-item>-->
<!-- </u-col>-->
<!-- <u-col span="4">-->
<!-- <u-form-item label="物料条码" label-width="150">-->
<!-- <SearchInput v-model="materialRecordInfo.materialBatchNumber" placeholder="请输入物料条码"-->
<!-- hassearchbtn="true"-->
<!-- @inputchange="(val)=>{materialRecordInfo.materialBatchNumber=val}"/>-->
<!-- </u-form-item>-->
<!-- </u-col>-->
<!-- <u-col span="2">-->
<!-- <u-form-item label="数量">-->
<!-- <uni-number-box :min="0" v-model="materialRecordInfo.quantity"></uni-number-box>-->
<!-- </u-form-item>-->
<!-- </u-col>-->
<!-- <u-col span="1">-->
<!-- <u-button type="primary" size="mini" @click="commonClick('MaterialUsageRecord')">添加</u-button>-->
<!-- </u-col>-->
<!-- <u-col span="1">-->
<!-- </u-col>-->
<!-- <u-col span="5">-->
<!-- </u-col>-->
<!-- </u-row>-->
<!-- </u-form>-->
<!-- <zb-table :columns="issusLineColumn" :stripe="true" :fit="true" :border="true" :data="issusLineList"></zb-table> -->
<!-- </view>-->
<!-- </view> -->
</view> </view>
<scroll-view class="prod-body-right" scroll-y > <scroll-view class="prod-body-right" scroll-y >
<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">
...@@ -1248,19 +1211,11 @@ export default { ...@@ -1248,19 +1211,11 @@ export default {
name: 'BOM外扣减' name: 'BOM外扣减'
} }
], ],
materialRecordInfo: {
taskCode: '',
materialBatchNumber: '',
quantity: 0,
operatorTime: '',
depletionMethod: 1
},
curTaskInfo: { curTaskInfo: {
pickingReason: null, pickingReason: null,
returnReason: null, returnReason: null,
}, },
buttonShow: null, buttonShow: null,
currentType: 0,
bomFeeData: [], bomFeeData: [],
bomFeeColumn: [ bomFeeColumn: [
{ {
...@@ -1418,7 +1373,6 @@ export default { ...@@ -1418,7 +1373,6 @@ export default {
reasonList: [], reasonList: [],
reasonReturnList: [], reasonReturnList: [],
workorderList: [], workorderList: [],
materialUsageRecordList: [],
materialusagerecordLoading: false, materialusagerecordLoading: false,
issusLineList: [], issusLineList: [],
issusLineColumn: [ issusLineColumn: [
...@@ -1612,7 +1566,7 @@ export default { ...@@ -1612,7 +1566,7 @@ export default {
name: 'workorderCode', name: 'workorderCode',
label: '工单号', label: '工单号',
align: 'center', align: 'center',
width: 85 width: 120
}, },
{ {
name: 'scheduleStartDateStr', name: 'scheduleStartDateStr',
...@@ -1648,25 +1602,13 @@ export default { ...@@ -1648,25 +1602,13 @@ export default {
name: 'assistProcessCode', name: 'assistProcessCode',
label: '采购单号', label: '采购单号',
align: 'center', align: 'center',
width: 100 width: 120
}, },
{ {
name: 'processName', name: 'processName',
label: '工序', label: '工序',
align: 'center', align: 'center',
width: 80 width: 80
},
{
name: 'quantityQualify',
label: '合格数量',
align: 'center',
width: 70
},
{
name: 'quantityUnqualify',
label: '不合格数量',
align: 'center',
width: 80
} }
] ]
} else { } else {
...@@ -1968,7 +1910,7 @@ export default { ...@@ -1968,7 +1910,7 @@ export default {
} }
}, },
commonClick(oper) { commonClick(oper) {
if (['Refresh', 'MaterialUsageRecord', 'editProd'].indexOf(oper) === -1 && this.tableSelectData.length === 0) { if (['Refresh', 'editProd'].indexOf(oper) === -1 && this.tableSelectData.length === 0) {
this.$u.toast('请选择工作任务!'); this.$u.toast('请选择工作任务!');
return; return;
} }
...@@ -2038,9 +1980,6 @@ export default { ...@@ -2038,9 +1980,6 @@ export default {
case 'editProd': case 'editProd':
this.doEditProd(); this.doEditProd();
break; break;
case 'MaterialUsageRecord':
this.addMaterialUsageRecord();
break;
case 'KnifeTemp': case 'KnifeTemp':
this.knifeTempShow(); this.knifeTempShow();
break; break;
...@@ -2189,7 +2128,6 @@ export default { ...@@ -2189,7 +2128,6 @@ export default {
rowClick(row, index) { rowClick(row, index) {
this.$refs.zbtable.toggleRowSelection(row); this.$refs.zbtable.toggleRowSelection(row);
this.curTaskInfo = row; this.curTaskInfo = row;
this.getMaterialUsageRecordList();
}, },
getCode(row) { getCode(row) {
this.usePersonData = row; this.usePersonData = row;
...@@ -2471,13 +2409,12 @@ export default { ...@@ -2471,13 +2409,12 @@ export default {
} }
return { return {
...item, ...item,
scheduleStartDateStr: item.scheduleStartDate.substring(2, 16), scheduleStartDateStr: item.scheduleStartDate?item.scheduleStartDate.substring(2, 16):'',
scheduleEndDateStr: item.scheduleEndDate.substring(2, 16) scheduleEndDateStr: item.scheduleEndDate ? item.scheduleEndDate.substring(2, 16) : ''
}; };
}); });
if (this.tableData.length > 0) { if (this.tableData.length > 0) {
this.curTaskInfo = this.tableData[0]; this.curTaskInfo = this.tableData[0];
this.getMaterialUsageRecordList();
if (currentIndex > -1) { if (currentIndex > -1) {
this.$nextTick(()=>{ this.$nextTick(()=>{
const query = uni.createSelectorQuery().in(this) const query = uni.createSelectorQuery().in(this)
...@@ -2515,56 +2452,12 @@ export default { ...@@ -2515,56 +2452,12 @@ export default {
}).catch(e=>{ }).catch(e=>{
console.log('eee', e) console.log('eee', e)
}) })
},
typeChange(index) {
this.currentType = index;
this.getMaterialUsageRecordList();
}, },
// px转rpx // px转rpx
pxToRpx(px) { pxToRpx(px) {
const screenWidth = uni.getSystemInfoSync().screenWidth const screenWidth = uni.getSystemInfoSync().screenWidth
return (750 * Number.parseInt(px)) / screenWidth return (750 * Number.parseInt(px)) / screenWidth
}, },
getMaterialUsageRecordList() {
this.materialusagerecordLoading = true;
this.$u.api
.materialusagerecordList({
workstationId: this.vuex_workstation?.workstationId,
depletionMethod: this.currentType + 1,
taskId: this.curTaskInfo.taskId
})
.then((res) => {
this.materialusagerecordLoading = false;
if (res.code === 200) {
this.materialUsageRecordList = res.rows;
}
});
},
addMaterialUsageRecord() {
if (this.materialRecordInfo.materialBatchNumber !== this.curTaskInfo.itemCode && this.currentType === 0) {
this.$u.toast('物料不在生产目录中!');
return;
}
if (this.materialRecordInfo.quantity === 0) {
this.$u.toast('请输入物料数量!');
return;
}
this.materialRecordInfo.operatorTime = new Date();
this.materialRecordInfo.operatorId = this.vuex_user.userId;
this.materialRecordInfo.operatorName = this.vuex_user.userName;
this.materialRecordInfo.taskId = this.curTaskInfo.taskId;
this.materialRecordInfo.depletionMethod = this.currentType + 1;
this.materialRecordInfo.workstationId = this.vuex_workstation.workstationId;
this.$u.api.addMaterialusagerecord(this.materialRecordInfo).then((res) => {
if (res.code === 200) {
this.materialRecordInfo.quantity = 0;
this.materialRecordInfo.materialBatchNumber = '';
this.$u.toast('上报成功');
this.getMaterialUsageRecordList();
}
});
},
shiftTask(tid) { shiftTask(tid) {
this.$u.api this.$u.api
.getTaskInfo({ .getTaskInfo({
...@@ -2660,17 +2553,23 @@ export default { ...@@ -2660,17 +2553,23 @@ export default {
this.feedbackForms = []; this.feedbackForms = [];
this.feedbackUnQuantityFu = 0; this.feedbackUnQuantityFu = 0;
this.feedbackQuantityFu = 0; this.feedbackQuantityFu = 0;
this.$u.api.assistFeedback({ this.$u.api.feedbackinfo({
assistProcessCode: taskInfo.assistProcessCode, assistProcessCode: taskInfo.assistProcessCode,
assistProcessItemCode: taskInfo.assistProcessItemCode assistProcessItemCode: taskInfo.assistProcessItemCode
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
// row.quantityQualify = res.data.workorderQualify // row.quantityQualify = res.data.workorderQualify
const feedback = res.data const feedback = res.rows[0]
feedback['unquantityFeedback'] = res.data.quantity - res.data.quantityFeedback feedback['unquantityFeedback'] = feedback.quantity - feedback.quantityFeedback
feedback['quantityUnqualify'] = 0 feedback['quantityUnqualify'] = 0
feedback['quantityQualify'] = 0 feedback['quantityQualify'] = 0
feedback['printContents'] = feedback.workorderCode
feedback['userName'] = this.vuex_user.userName
feedback['nickName'] = this.vuex_user.nickName
feedback['feedbackChannel'] = 'PAD'
feedback['feedbackTime'] = this.parseTime(new Date())
this.feedbackForms.push(feedback) this.feedbackForms.push(feedback)
this.proVisible = true;
} }
}) })
}, },
......
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