Commit 65d421b1 authored by chenzj's avatar chenzj

领料申请功能优化

parent eeb76cd9
......@@ -107,11 +107,15 @@ const install = (Vue, vm) => {
//领料申请
listMaterialRequest: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/listMaterialRequest', params),
addMaterialRequest: (params = {}) => vm.$u.postJson(config.adminPath + '/mobile/pro/proMaterial/addMaterialRequest', params),
//退料申请
getWproworkOrderProcessItem: (params = {}) => vm.$u.get(config.adminPath +'/pro/materialRequest/selectworkorder/' + params.workorderId),
//退料申请
listMaterialReturn: (params = {}) => vm.$u.post(config.adminPath + '/mobile/pro/proMaterial/listIssueLine', params),
addMaterialReturn: (params = {}) => vm.$u.postJson(config.adminPath + '/mobile/pro/proMaterial/addMaterialReturn', params),
//质量相关api
//获取当前产品、当前质检类型的质检模板行信息
......
......@@ -342,6 +342,20 @@
width="1300rpx"
>
<view class="list-bar">
<u-form label-width="100px" :model="curTaskInfo">
<u-row>
<u-col span="6">
<u-form-item label="编排单号">
{{ curTaskInfo.arrangeCode }}
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="生产工单" prop="workorderCode">
<uni-data-select @change="materialReturnWorkorderProcessItem" :localdata="curTaskInfo.workorderOption"></uni-data-select>
</u-form-item>
</u-col>
</u-row>
</u-form>
<scroll-view scroll-y="true" class="scroll-list" :style="{ height: this.screenHeight - 280 + 'px' }">
<uni-table ref="materialRequestTable" border stripe :loading="loading" emptyText="未查询到数据">
<uni-tr>
......@@ -350,7 +364,7 @@
<uni-th width="110px" align="center">产品物料名称</uni-th>
<uni-th width="80px" align="center">领取数量</uni-th>
</uni-tr>
<uni-tr v-for="(line, index) in materialRequestList" :key="index">
<uni-tr v-for="(line, index) in materialRequestArrays" :key="index">
<uni-td align="center">
<view class="uni-group">
<button class="uni-button" size="mini" type="primary" @click="materialRequestFormShow(line)">补料</button>
......@@ -835,6 +849,7 @@ export default {
feedingInspectionList: [],
recoilMaterialList: [],
materialRequestList: [],
materialRequestArrays: [],
materialReturnList: [],
materialRequestFormData: {
itemName: null,
......@@ -847,6 +862,12 @@ export default {
applyNum: null,
workorderCode: null
},
materialReturnProcessItemData: {
itemName: null,
itemCode: null,
applyNum: null,
workorderCode: null
},
materialReturnFormVisible: false,
materialReturnSelected: {},
tableDetailColumn: [
......@@ -1433,12 +1454,16 @@ export default {
});
},
materialRequestShow() {
const taskInfo = this.tableSelectData[0];
const t = this;
this.materialRequestVisible = true;
const taskInfo = this.tableSelectData[0];
this.curTaskInfo = this.tableSelectData[0];
this.curTaskInfo.workorderOption = this.curTaskInfo.proWorkorderList.map((s) => {
return { value: s.workorderId, text: s.workorderCode };
});
this.$u.api.listMaterialRequest({ taskId: taskInfo.taskId }).then((res) => {
if (res.code === 200) {
t.materialRequestList = res.data;
this.materialRequestList = res.data;
this.materialRequestArrays = this.materialRequestList.concat([])
}
});
},
......@@ -1455,10 +1480,12 @@ export default {
const rst = [];
const taskInfo = this.tableSelectData[0];
const t = this;
const items = this.curTaskInfo.workorderOption.find((item) => item.value === this.curTaskInfo.workorderCode );
this.materialRequestList.forEach((s) => {
if (s.applyNum != null) {
rst.push({
itemId: s.itemId,
workorderCode: s.workorderCode,
taskId: taskInfo.taskId,
applyNum: s.applyNum,
applyType: 1
......@@ -1505,6 +1532,14 @@ export default {
}
});
},
materialReturnWorkorderProcessItem(id) {
this.$u.api.getWproworkOrderProcessItem({ workorderId: Number(id)}).then((res) => {
if (res.code === 200) {
this.materialRequestArrays = this.materialRequestList.concat(res.rows)
}
});
},
materialReturnFormShow(line) {
this.materialReturnFormVisible = true;
this.materialReturnFormData = {
......
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