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

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

parent 82f117ad
...@@ -21,9 +21,10 @@ const config = { ...@@ -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 = "http://101.43.244.58:8080/";
config.baseUrl = "/api";
//config.baseUrl = "http://101.200.162.168:8080"; //config.baseUrl = "http://101.200.162.168:8080";
export default config; export default config;
...@@ -109,117 +109,132 @@ ...@@ -109,117 +109,132 @@
@confirm="handleSubmitfeedback" @confirm="handleSubmitfeedback"
show-cancel-button show-cancel-button
: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="open" v-model="proVisible"
width="1800rpx" width="1800rpx"
> >
<view class="feedback-card" v-for="(feedback,i) in feedbackForms" :key="i"> <view>
<u-form label-width="100px" :model="feedback" :rules="rules"> <scroll-view style="max-height:600px;" scroll-y="true" class="scroll-Y">
<u-row> <view class="feedback-card" v-for="(feedback,i) in feedbackForms" :key="i">
<u-col span="6"> <u-form label-width="100px" :model="feedback" :rules="rules">
<u-form-item label="任务单号" prop="quantity"> <u-row>
{{ feedback.taskCode }} <u-col span="6">
</u-form-item> <u-form-item label="任务单号" prop="quantity">
</u-col> {{ feedback.taskCode }}
<u-col span="6"> </u-form-item>
<u-form-item label="工序" prop="nickName"> </u-col>
{{ feedback.processName }} <u-col span="6">
</u-form-item> <u-form-item label="工序" prop="nickName">
</u-col> {{ feedback.processName }}
</u-row> </u-form-item>
<u-row> </u-col>
<u-col span="6"> </u-row>
<u-form-item label="报工总数量" prop="quantity"> <u-row>
{{ feedback.quantityQualify + feedback.quantityUnqualify }} <u-col span="6">
</u-form-item> <u-form-item label="报工总数量" prop="quantity">
</u-col> {{ feedback.quantityQualify + feedback.quantityUnqualify }}
<u-col span="6"> </u-form-item>
<u-form-item label="报工人" prop="nickName"> </u-col>
<u-input v-model="feedback.nickName"></u-input> <u-col span="6">
<u-button <u-form-item label="报工人" prop="nickName">
@tap="getCode(feedback)" <u-input v-model="feedback.nickName"></u-input>
type="success" <u-button
size="mini" @tap="getCode(feedback)"
>报工人员</u-button> type="success"
</u-form-item> size="mini"
</u-col> >报工人员</u-button>
</u-row> </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">
<uni-data-select v-model="feedback.workorderId" <uni-data-select v-model="feedback.workorderId"
:localdata="feedback.workorderOption" @change="workorderSelect($event, i)"></uni-data-select> :localdata="feedback.workorderOption" @change="workorderSelect($event, i)"></uni-data-select>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
<u-form-item label="合格品数量" prop="quantityQualify"> <u-form-item label="合格品数量" prop="quantityQualify">
<u-number-box :min="0" @change="quantityChanged" v-model="feedback.quantityQualify"></u-number-box> <u-number-box :min="0" @change="quantityChanged" v-model="feedback.quantityQualify"></u-number-box>
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<u-form-item label="不良品数量" prop="quantityUnqualify"> <u-form-item label="不良品数量" prop="quantityUnqualify">
<u-number-box :min="0" @change="quantityChanged" v-model="feedback.quantityUnqualify"></u-number-box> <u-number-box :min="0" @change="quantityChanged" v-model="feedback.quantityUnqualify"></u-number-box>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
<u-form-item label="是否打印" prop="print"> <u-form-item label="是否打印" prop="print">
<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">
<u-radio :name="1"></u-radio> <u-radio :name="1"></u-radio>
<u-radio :name="0"></u-radio> <u-radio :name="0"></u-radio>
</u-radio-group> </u-radio-group>
</view> </view>
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<u-form-item v-if="feedback.whether=='1'" label="打印内容" prop="printContents"> <u-form-item v-if="feedback.whether=='1'" label="打印内容" prop="printContents">
{{feedback.printContents}} {{feedback.printContents}}
<!-- <u-input v-model="feedback."></u-input> --> <!-- <u-input v-model="feedback."></u-input> -->
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
<view v-if="feedback.isLastProcess"> <view v-if="feedback.isLastProcess">
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
<u-form-item label="工单指令" prop="workorderSoDirectiveId"> <u-form-item label="工单指令" prop="workorderSoDirectiveId">
<uni-data-select v-model="feedback.workorderSoDirectiveId" :localdata="feedback.directiveList"></uni-data-select> <uni-data-select v-model="feedback.workorderSoDirectiveId" :localdata="feedback.directiveList"></uni-data-select>
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<u-form-item label="工单SIZE" prop="workorderSoSizeItemId"> <u-form-item label="工单SIZE" prop="workorderSoSizeItemId">
<uni-data-select v-model="feedback.workorderSoSizeItemId" :localdata="feedback.sizeList"></uni-data-select> <uni-data-select v-model="feedback.workorderSoSizeItemId" :localdata="feedback.sizeList"></uni-data-select>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
<u-form-item label="净重(KG)" prop="netWeight"> <u-form-item label="净重(KG)" prop="netWeight">
<u-number-box :min="0" :positive-integer="false" :input-width="190" v-model="feedback.netWeight"></u-number-box> <u-number-box :min="0" :positive-integer="false" :input-width="190" v-model="feedback.netWeight"></u-number-box>
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<u-form-item label="打印模板" prop="printTemplate"> <u-form-item label="打印模板" prop="printTemplate">
<u-input v-model="feedback.printTemplate" placeholder="请选择打印模板"></u-input> <u-input v-model="feedback.printTemplate" placeholder="请选择打印模板"></u-input>
<u-button <u-button
@tap="getPrintTemplate(feedback)" @tap="getPrintTemplate(feedback)"
type="success" type="success"
style="margin-left:20rpx;" style="margin-left:20rpx;"
size="mini" size="mini"
>选择打印模板</u-button> >选择打印模板</u-button>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </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> </view>
</u-form> </scroll-view>
</view> </view>
</u-modal> </u-modal>
<u-modal <u-modal
...@@ -295,7 +310,7 @@ ...@@ -295,7 +310,7 @@
@confirm="newlyAddss()" @confirm="newlyAddss()"
show-cancel-button show-cancel-button
:title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '60px', 'padding-top': '0px' }" :title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '60px', 'padding-top': '0px' }"
v-model="aopen" v-model="errorVisible"
width="1300rpx" width="1300rpx"
> >
<view class="feedback-card"> <view class="feedback-card">
...@@ -588,7 +603,7 @@ ...@@ -588,7 +603,7 @@
<zb-table :columns="tableDetailColumn" :stripe="true" :border="true" :data="tableDataDetail"></zb-table> <zb-table :columns="tableDetailColumn" :stripe="true" :border="true" :data="tableDataDetail"></zb-table>
</view> </view>
</u-modal> </u-modal>
//查询图片生产工单 <!-- //查询图片生产工单 -->
<u-modal <u-modal
title="生产工单" title="生产工单"
@confirm="materialReturnSave()" @confirm="materialReturnSave()"
...@@ -666,6 +681,13 @@ export default { ...@@ -666,6 +681,13 @@ export default {
}, },
data() { data() {
return { return {
listTabPro: [
{
name: '指令列表'
}, {
name: 'SIZE列表'
}
],
tableParams: { tableParams: {
allowProduce: 1, allowProduce: 1,
workorderCode: '', workorderCode: '',
...@@ -688,8 +710,8 @@ export default { ...@@ -688,8 +710,8 @@ export default {
screenHeight: 768, screenHeight: 768,
usePersonData: {}, usePersonData: {},
title: '生产报工', title: '生产报工',
open: false, proVisible: false,
aopen: false, errorVisible: false,
form: {}, form: {},
feedbackForm: {}, feedbackForm: {},
tableData: [], tableData: [],
...@@ -1044,6 +1066,9 @@ export default { ...@@ -1044,6 +1066,9 @@ export default {
uni.$off('taskStatusChanged'); uni.$off('taskStatusChanged');
}, },
methods: { methods: {
handleChangeTabPro(index, row) {
row.currentTabPro = index
},
onPreviewTap(url) { onPreviewTap(url) {
uni.previewImage({ uni.previewImage({
current: url, current: url,
...@@ -1288,9 +1313,15 @@ export default { ...@@ -1288,9 +1313,15 @@ export default {
row.sizeList = []; row.sizeList = [];
row.directiveList = []; row.directiveList = [];
row.workorderSoSizeItemId = ''; row.workorderSoSizeItemId = '';
row.printContents = row.arrangeCode row.printContents = row.arrangeCode
row.workorderSoDirectiveId = ''; row.workorderSoDirectiveId = '';
row.tableDirectiveData = []
row.tableSizeColumn = []
row.tableSizeData = []
return; return;
} else {
this.getWorkorderDirectiveList(id, index)
this.getWorkorderSizeList(id, index)
} }
row.workorderId = id; row.workorderId = id;
const items = row.workorderList.find((item) => item.workorderId === id); const items = row.workorderList.find((item) => item.workorderId === id);
...@@ -1338,7 +1369,7 @@ export default { ...@@ -1338,7 +1369,7 @@ export default {
}); });
}); });
}, },
getWorkorderWithSizeAndDirective(item) { getWorkorderWithSizeAndDirective(item, index) {
this.$u.api this.$u.api
.getWorkorderWithSizeAndDirective({ .getWorkorderWithSizeAndDirective({
pageNum: 1, pageNum: 1,
...@@ -1347,13 +1378,13 @@ export default { ...@@ -1347,13 +1378,13 @@ export default {
}) })
.then((res) => { .then((res) => {
item.workorderList = res.rows; item.workorderList = res.rows;
if(res.rows.length === 1) {
item.printContents = res.rows[0].workorderCode
}
//如果只关联一个订单,默认选中 //如果只关联一个订单,默认选中
if(res.rows.length==1){ if(res.rows.length==1){
item.printContents = res.rows[0].workorderCode
item.workorderId = res.rows[0].workorderId; item.workorderId = res.rows[0].workorderId;
item.workorderCode = res.rows[0].workorderCode; 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){ if(res.rows[0].sizeList2!=null){
item.sizeList = res.rows[0].sizeList2.map(temp2=>{ item.sizeList = res.rows[0].sizeList2.map(temp2=>{
return { return {
...@@ -1545,7 +1576,7 @@ export default { ...@@ -1545,7 +1576,7 @@ export default {
doFeedback() { doFeedback() {
// this.reset(); // this.reset();
this.feedbackForms = []; this.feedbackForms = [];
this.tableSelectData.forEach((item) => { this.tableSelectData.forEach((item, index) => {
let defQualify = item.quantity-item.quantityQualify-item.quantityUnqualify; let defQualify = item.quantity-item.quantityQualify-item.quantityUnqualify;
defQualify = defQualify<0?0:defQualify; defQualify = defQualify<0?0:defQualify;
defQualify = defQualify>item.quantityWait?item.quantityWait:defQualify; defQualify = defQualify>item.quantityWait?item.quantityWait:defQualify;
...@@ -1575,12 +1606,86 @@ export default { ...@@ -1575,12 +1606,86 @@ export default {
sizeData: {}, sizeData: {},
printContents: item.arrangeCode, printContents: item.arrangeCode,
whether: '', 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.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() { doException() {
...@@ -1602,7 +1707,7 @@ export default { ...@@ -1602,7 +1707,7 @@ export default {
abnormalReason: '', abnormalReason: '',
abnormalTime: '' abnormalTime: ''
}); });
this.aopen = true; this.errorVisible = true;
}, },
async newlyAddss() { async newlyAddss() {
...@@ -1612,10 +1717,10 @@ export default { ...@@ -1612,10 +1717,10 @@ export default {
}, },
cancel() { cancel() {
this.open = false; this.proVisible = false;
}, },
handleSubmitfeedback() { handleSubmitfeedback() {
this.open = true; this.proVisible = true;
this.feedbackForms.forEach((item) => { this.feedbackForms.forEach((item) => {
if (item.quantityQualify === 0 && item.quantityUnqualify === 0) { if (item.quantityQualify === 0 && item.quantityUnqualify === 0) {
this.$u.toast('请填写合格/不合格产品数量!'); this.$u.toast('请填写合格/不合格产品数量!');
...@@ -1668,7 +1773,9 @@ export default { ...@@ -1668,7 +1773,9 @@ export default {
}) })
.then((res) => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.open = false; this.proVisible = false;
if (res.msg === '操作成功') {
this.$u.toast('上报成功');
if(item.printTemplate) { if(item.printTemplate) {
let params = {} let params = {}
res.data.forEach(datas => { res.data.forEach(datas => {
...@@ -1918,7 +2025,7 @@ export default { ...@@ -1918,7 +2025,7 @@ export default {
const rst = []; const rst = [];
const t = this; const t = this;
this.materialReturnList.forEach((s) => { this.materialReturnList.forEach((s) => {
if (s.applyNum != null) { if (s.applyNum) {
rst.push({ rst.push({
itemId: s.itemId, itemId: s.itemId,
taskId: taskInfo.taskId, taskId: taskInfo.taskId,
...@@ -1933,6 +2040,10 @@ export default { ...@@ -1933,6 +2040,10 @@ export default {
}); });
} }
}); });
if (rst.length === 0) {
this.$u.toast('数量不存在,无法保存')
return
}
this.$u.api.addMaterialReturn(rst).then((res) => { this.$u.api.addMaterialReturn(rst).then((res) => {
t.materialReturnFormVisible = false; t.materialReturnFormVisible = false;
if (res.code === 200) { 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