Commit 1ee48538 authored by 张海景's avatar 张海景

update:修改生产报工加上size和指令页签

parent 82f117ad
......@@ -21,9 +21,10 @@ const config = {
}
// 设置后台接口服务的基础地址
// config.baseUrl = 'http://192.168.25.105:8080';
// config.baseUrl = 'http://192.168.3.91:8080';
config.baseUrl = 'http://192.168.3.91:8080';//测试环境
// config.baseUrl = 'http://192.168.3.91:8080';
//config.baseUrl = "http://101.43.244.58:8080/";
config.baseUrl = "/api";
//config.baseUrl = "http://101.200.162.168:8080";
export default config;
......@@ -109,9 +109,11 @@
@confirm="handleSubmitfeedback"
show-cancel-button
:title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '37px', 'padding-top': '0px' }"
v-model="open"
v-model="proVisible"
width="1800rpx"
>
<view>
<scroll-view style="max-height:600px;" scroll-y="true" class="scroll-Y">
<view class="feedback-card" v-for="(feedback,i) in feedbackForms" :key="i">
<u-form label-width="100px" :model="feedback" :rules="rules">
<u-row>
......@@ -220,6 +222,19 @@
</u-row>
</view>
</u-form>
<view>
<u-tabs :list="listTabPro" :is-scroll="false" :show-bar="false" :current="feedback.currentTabPro" @change="handleChangeTabPro($event, feedback)"></u-tabs>
<!-- 指令列表 -->
<view v-show="feedback.currentTabPro === 0" class="feedback-card">
<zb-table :columns="feedback.tableDirectiveColumn" :stripe="true" :border="true" :data="feedback.tableDirectiveData"></zb-table>
</view>
<!-- SIZE列表 -->
<view v-show="feedback.currentTabPro === 1" class="feedback-card">
<zb-table :columns="feedback.tableSizeColumn" :stripe="true" :border="true" :data="feedback.tableSizeData"></zb-table>
</view>
</view>
</view>
</scroll-view>
</view>
</u-modal>
<u-modal
......@@ -295,7 +310,7 @@
@confirm="newlyAddss()"
show-cancel-button
:title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '60px', 'padding-top': '0px' }"
v-model="aopen"
v-model="errorVisible"
width="1300rpx"
>
<view class="feedback-card">
......@@ -588,7 +603,7 @@
<zb-table :columns="tableDetailColumn" :stripe="true" :border="true" :data="tableDataDetail"></zb-table>
</view>
</u-modal>
//查询图片生产工单
<!-- //查询图片生产工单 -->
<u-modal
title="生产工单"
@confirm="materialReturnSave()"
......@@ -666,6 +681,13 @@ export default {
},
data() {
return {
listTabPro: [
{
name: '指令列表'
}, {
name: 'SIZE列表'
}
],
tableParams: {
allowProduce: 1,
workorderCode: '',
......@@ -688,8 +710,8 @@ export default {
screenHeight: 768,
usePersonData: {},
title: '生产报工',
open: false,
aopen: false,
proVisible: false,
errorVisible: false,
form: {},
feedbackForm: {},
tableData: [],
......@@ -1044,6 +1066,9 @@ export default {
uni.$off('taskStatusChanged');
},
methods: {
handleChangeTabPro(index, row) {
row.currentTabPro = index
},
onPreviewTap(url) {
uni.previewImage({
current: url,
......@@ -1290,7 +1315,13 @@ export default {
row.workorderSoSizeItemId = '';
row.printContents = row.arrangeCode
row.workorderSoDirectiveId = '';
row.tableDirectiveData = []
row.tableSizeColumn = []
row.tableSizeData = []
return;
} else {
this.getWorkorderDirectiveList(id, index)
this.getWorkorderSizeList(id, index)
}
row.workorderId = id;
const items = row.workorderList.find((item) => item.workorderId === id);
......@@ -1338,7 +1369,7 @@ export default {
});
});
},
getWorkorderWithSizeAndDirective(item) {
getWorkorderWithSizeAndDirective(item, index) {
this.$u.api
.getWorkorderWithSizeAndDirective({
pageNum: 1,
......@@ -1347,13 +1378,13 @@ export default {
})
.then((res) => {
item.workorderList = res.rows;
if(res.rows.length === 1) {
item.printContents = res.rows[0].workorderCode
}
//如果只关联一个订单,默认选中
if(res.rows.length==1){
item.printContents = res.rows[0].workorderCode
item.workorderId = res.rows[0].workorderId;
item.workorderCode = res.rows[0].workorderCode;
this.getWorkorderDirectiveList(res.rows[0].workorderId, index)
this.getWorkorderSizeList(res.rows[0].workorderId, index)
if(res.rows[0].sizeList2!=null){
item.sizeList = res.rows[0].sizeList2.map(temp2=>{
return {
......@@ -1545,7 +1576,7 @@ export default {
doFeedback() {
// this.reset();
this.feedbackForms = [];
this.tableSelectData.forEach((item) => {
this.tableSelectData.forEach((item, index) => {
let defQualify = item.quantity-item.quantityQualify-item.quantityUnqualify;
defQualify = defQualify<0?0:defQualify;
defQualify = defQualify>item.quantityWait?item.quantityWait:defQualify;
......@@ -1575,12 +1606,86 @@ export default {
sizeData: {},
printContents: item.arrangeCode,
whether: '',
printTemplate: ''
printTemplate: '',
tableDirectiveColumn: [
{
name: 'clientCmd',
label: '指令号',
width: 130
},
{
name: 'lossNum',
label: 'LOSS数',
width: 130
},
{
name: 'sizeGroup',
label: '尺码组',
width: 130
},
{
name: 'quantity',
label: '数量',
width: 130
},
{
name: 'quantityQualify',
label: '合格品数量',
width: 130
},
],
tableDirectiveData: [],
tableSizeColumn: [],
tableSizeData: [],
currentTabPro: 0
};
this.getWorkorderWithSizeAndDirective(feedback);
this.getWorkorderWithSizeAndDirective(feedback, index);
this.feedbackForms.push(feedback);
});
this.open = true;
this.proVisible = true;
},
// 获取指令列表
getWorkorderDirectiveList(id, index) {
let row = this.feedbackForms[index];
this.$u.api
.workOrderSoDirectiveApi({
workorderId: id
})
.then((res) => {
console.log(res, '88999res')
if (res.code === 200) {
row.tableDirectiveData = res.rows
}
// row.tableDirectiveData = []
// row.tableSizeColumn = []
// row.tableSizeData = []
})
},
// 获取SIZE列表
getWorkorderSizeList(id, index) {
let row = this.feedbackForms[index];
this.$u.api
.workOrderSoSizeItemApi({
workorderId: id
})
.then((res) => {
console.log(res, '88999resSize')
let columns = []
if (res.code === 200) {
for (const key in res.data.columns) {
if (res.data.columns.hasOwnProperty.call(res.data.columns, key)) {
const element = res.data.columns[key];
let obj = {
name: key,
label: element
}
columns.push(obj)
}
}
row.tableSizeColumn = columns
row.tableSizeData = res.data.sizeList
}
})
},
doException() {
......@@ -1602,7 +1707,7 @@ export default {
abnormalReason: '',
abnormalTime: ''
});
this.aopen = true;
this.errorVisible = true;
},
async newlyAddss() {
......@@ -1612,10 +1717,10 @@ export default {
},
cancel() {
this.open = false;
this.proVisible = false;
},
handleSubmitfeedback() {
this.open = true;
this.proVisible = true;
this.feedbackForms.forEach((item) => {
if (item.quantityQualify === 0 && item.quantityUnqualify === 0) {
this.$u.toast('请填写合格/不合格产品数量!');
......@@ -1668,7 +1773,9 @@ export default {
})
.then((res) => {
if (res.code === 200) {
this.open = false;
this.proVisible = false;
if (res.msg === '操作成功') {
this.$u.toast('上报成功');
if(item.printTemplate) {
let params = {}
res.data.forEach(datas => {
......@@ -1918,7 +2025,7 @@ export default {
const rst = [];
const t = this;
this.materialReturnList.forEach((s) => {
if (s.applyNum != null) {
if (s.applyNum) {
rst.push({
itemId: s.itemId,
taskId: taskInfo.taskId,
......@@ -1933,6 +2040,10 @@ export default {
});
}
});
if (rst.length === 0) {
this.$u.toast('数量不存在,无法保存')
return
}
this.$u.api.addMaterialReturn(rst).then((res) => {
t.materialReturnFormVisible = false;
if (res.code === 200) {
......
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