修改单卷程序增加编辑数据功能

This commit is contained in:
彭枝刚 2024-11-05 16:09:39 +08:00
parent 021a0f1887
commit d268cade99
2 changed files with 279 additions and 133 deletions

View File

@ -554,31 +554,22 @@ const install = (Vue, vm) => {
nlvWms: {
cuttingInventory: {
getLabelDataByLabelNo: (param) => vm.$u.get(
'/nlv-wms/wmscuttinginventory/getLabelDataByLabelNo', param),
cutOffLineStagnantSubstanceCheckCreate: (param) => vm.$u.get(
'/nlv-wms/wmscuttinginventory/cutOffLineStagnantSubstanceCheckCreate', param),
getLabelDataByLabelNo: (param) => vm.$u.get('/nlv-wms/wmscuttinginventory/getLabelDataByLabelNo', param),
cutOffLineStagnantSubstanceCheckCreate: (param) => vm.$u.get('/nlv-wms/wmscuttinginventory/cutOffLineStagnantSubstanceCheckCreate', param),
getInventoryForFq: (param) => vm.$u.get('/nlv-wms/cuttinginventory/getInventoryForFq/' + param),
getInventoryForFqPlanB: (sapItem,stage) => vm.$u.get('/nlv-wms/cuttinginventory/getInventoryForFqPlanB/' + sapItem+'/'+stage),
generatePackageNumber: (param) => vm.$u.put('/nlv-wms/wmscuttingpackage/generatePackageNumber',
param),
generatePackageNumber: (param) => vm.$u.put('/nlv-wms/wmscuttingpackage/generatePackageNumber',param),
deletePackageNumber: (param) => vm.$u.delete('/nlv-wms/wmscuttingpackage/' + param),
generateColorPackageNumber: (param) => vm.$u.post(
'/nlv-wms/wmscuttingpackage/generateColorPackageNumber', param),
generateColorPackageNumber: (param) => vm.$u.post('/nlv-wms/wmscuttingpackage/generateColorPackageNumber', param),
fetchU8CodeList: (param) => vm.$u.get('/nlv-wms/tempUEightItem/page', param),
fetchCustomerList: (param) => vm.$u.get('/nlv-wms/wmscustomer/page', param),
batchNumberScan: (param) => vm.$u.post('/nlv-wms/wmscuttingpackage/batchNumberScan', param),
batchNumberScanWhiteCheck: (param) => vm.$u.post(
'/nlv-wms/wmscuttingpackage/batchNumberScanWhiteCheck', param),
batchNumberScanWhiteCheck: (param) => vm.$u.post('/nlv-wms/wmscuttingpackage/batchNumberScanWhiteCheck', param),
fetchPrinterList: (param) => vm.$u.get('/nlv-wms/print-pda-bind/getPrintList/' + param),
getTrayList: (param) => vm.$u.get('/nlv-wms/wmscuttingpackage/getTrayList/' + param),
getBatchNumberDetail: (param) => vm.$u.get('/nlv-wms/wmscuttingpackage/getBatchNumberDetail/' +
param),
getBatchNumberDetail: (param) => vm.$u.get('/nlv-wms/wmscuttingpackage/getBatchNumberDetail/' +param),
doBatchGeneratePackageNumber: (dtoList) => vm.$u.post('/nlv-wms/cuttinginventory/doBatchGeneratePackageNumber', dtoList),
doSaveForm: (wmsInventory) => vm.$u.post('/nlv-wms/wmscuttingpackage/doSaveForm',wmsInventory)
},
salesOutPlateform: {
selectUnSoldDataByStatusAndDeptId: () => vm.$u.get(

View File

@ -4,7 +4,7 @@
<view>
<u-select v-model="printerListShow" :list="printerList" @confirm="rePrintConfirm"></u-select>
</view>
<!-- 表单 -->
<view class="page-container">
<u-row class="row">
@ -15,38 +15,77 @@
</u-col>
<u-col span="10">
<u-input v-model="scanMaterialLot" ref="scanMaterialLotInput" :border="true"
@confirm="scanMaterialLotEvent" style="background-color: #FFFF99" :focus="focus.scanMaterialLotInput"/>
@confirm="scanMaterialLotEvent" style="background-color: #FFFF99"
:focus="focus.scanMaterialLotInput" />
</u-col>
</u-row>
<template>
<u-cell-group class="item-head">
<u-cell-item title="工厂" :value="formObj.site" :arrow="false"></u-cell-item>
<u-cell-item title="SAP料号" :value="formObj.sapNumber" :arrow="false"></u-cell-item>
<u-cell-item title="U8料号" :value="formObj.u8Code" :arrow="false"></u-cell-item>
<u-cell-item title="SAP批次号" :value="formObj.sapBatch" :arrow="false"></u-cell-item>
<u-cell-item title="生产日期" :value="formObj.productionDate" :arrow="false"></u-cell-item>
<u-cell-item title="重量" :value="formObj.weight" :arrow="false"></u-cell-item>
<u-cell-item title="长度" :value="formObj.length" :arrow="false"></u-cell-item>
<u-cell-item title="等级" :value="formObj.grade" :arrow="false" v-if="false"></u-cell-item>
<u-cell-item title="阶段" :value="formObj.stage" :arrow="false"></u-cell-item>
<u-cell-item title="类型" :value="formObj.type" :arrow="false"></u-cell-item>
<u-cell-item title="卷号" :value="formObj.batchNumber" :arrow="false"></u-cell-item>
<u-cell-item title="托盘号" :value="formObj.packageNumber" :arrow="false"></u-cell-item>
<u-cell-item title="客户编码" :value="formObj.customerCode" :arrow="false"></u-cell-item>
<u-cell-item title="创建日期" :value="formObj.dateCreate" :arrow="false"></u-cell-item>
<u-cell-item title="创建人员" :value="formObj.creator" :arrow="false"></u-cell-item>
<u-cell-item title="更新日期" :value="formObj.dateUpdate" :arrow="false"></u-cell-item>
<u-cell-item title="更新人员" :value="formObj.updater" :arrow="false"></u-cell-item>
</u-cell-group>
</template>
<u-cell-group class="item-head" v-if="!isEdit">
<u-cell-item title="工厂" :value="formObj.site" :arrow="false"></u-cell-item>
<u-cell-item title="U8料号" :value="formObj.u8Code" :arrow="false"></u-cell-item>
<u-cell-item title="U8描述" :value="formObj.ueightDesc" :arrow="false"></u-cell-item>
<u-cell-item title="SAP料号" :value="formObj.sapNumber" :arrow="false"></u-cell-item>
<u-cell-item title="SAP描述" :value="formObj.sapItemDesc" :arrow="false"></u-cell-item>
<u-cell-item title="SAP批次号" :value="formObj.sapBatch" :arrow="false"></u-cell-item>
<u-cell-item title="生产日期" :value="formObj.productionDate" :arrow="false"></u-cell-item>
<u-cell-item title="重量" :value="formObj.weight" :arrow="false"></u-cell-item>
<u-cell-item title="长度" :value="formObj.length" :arrow="false"></u-cell-item>
<u-cell-item title="等级" :value="formObj.grade" :arrow="false" v-if="false"></u-cell-item>
<u-cell-item title="阶段" :value="formObj.stage" :arrow="false"></u-cell-item>
<u-cell-item title="类型" :value="formObj.type" :arrow="false"></u-cell-item>
<u-cell-item title="卷号" :value="formObj.batchNumber" :arrow="false"></u-cell-item>
<u-cell-item title="托盘号" :value="formObj.packageNumber" :arrow="false"></u-cell-item>
<u-cell-item title="客户编码" :value="formObj.customerCode" :arrow="false"></u-cell-item>
<u-cell-item title="创建日期" :value="formObj.dateCreate" :arrow="false"></u-cell-item>
<u-cell-item title="创建人员" :value="formObj.creator" :arrow="false"></u-cell-item>
<u-cell-item title="更新日期" :value="formObj.dateUpdate" :arrow="false"></u-cell-item>
<u-cell-item title="更新人员" :value="formObj.updater" :arrow="false"></u-cell-item>
</u-cell-group>
<u-form :model="editForm" ref="editForm" label-width="150" v-if="isEdit">
<u-form-item label="工厂"><u-input v-model="editForm.site" :disabled='true'/></u-form-item>
<u-form-item label="U8料号">
<input-select-dialog :value.sync="editForm.u8Code"
:usePage="true"
style="width: 100%;"
:get-list-data="fetchU8CodeList" :maskCloseAble="true"
:allowSearch="true" ref="ueightCode"
@doSelected="rowSelected($event)">
<template #row="{ ueightCode, ueightDesc, sapItem, sapItemDesc }">
<u-cell-item :border-bottom="false" style="padding-top: 0px; padding-bottom: 0px;"
:arrow="false">
<text slot="title">U8编码:{{ ueightCode }}</text>
<text slot="title" style="margin-left: 10px">U8描述:{{ ueightDesc }}</text>
<text slot="label">SAP物料编码:{{ sapItem }}</text>
<text slot="label" style="margin-left: 10px">SAP物料描述:{{ sapItemDesc }}</text>
</u-cell-item>
</template>
</input-select-dialog>
</u-form-item>
<u-form-item label="U8描述"><u-input v-model="editForm.ueightDesc" :disabled='true'/></u-form-item>
<u-form-item label="SAP料号"><u-input v-model="editForm.sapNumber" :disabled='true'/></u-form-item>
<u-form-item label="SAP描述"><u-input v-model="editForm.sapItemDesc" :disabled='true'/></u-form-item>
<u-form-item label="SAP批次"><u-input v-model="editForm.sapBatch" :border='true'/></u-form-item>
<u-form-item label="生产日期"><u-input v-model="editForm.productionDate" :border='true'/></u-form-item>
<u-form-item label="重量"><u-input v-model="editForm.weight" :border='true'/></u-form-item>
<u-form-item label="长度"><u-input v-model="editForm.length" :border='true'/></u-form-item>
<u-form-item label="等级"><u-input v-model="editForm.grade" :border='true'/></u-form-item>
<u-form-item label="阶段"><u-input v-model="editForm.stage" :border='true'/></u-form-item>
<u-form-item label="类型"><u-input v-model="editForm.type" :border='true'/></u-form-item>
<u-form-item label="客户编码"><u-input v-model="editForm.customerCode" :border='true'/></u-form-item>
<u-form-item label="卷号"><u-input v-model="editForm.batchNumber" :disabled='true'/></u-form-item>
<u-form-item label="托盘号"><u-input v-model="editForm.packageNumber" :disabled='true'/></u-form-item>
</u-form>
</template>
</view>
<!-- 按钮 -->
<view class="form-footer stay-below">
<u-button type="primary" @click="doSubmit">解拖</u-button>
<u-button type="info" @click="doPrintShow">补打</u-button>
<u-button type="warning" @click="doClear">清除</u-button>
<u-button type="success" @click="doEdit" v-if="!isEdit">修改</u-button>
<u-button type="success" @click="doSaveFormAction" v-if="isEdit">保存</u-button>
<u-button type="primary" @click="doSubmit" v-if="!isEdit">解拖</u-button>
<u-button type="info" @click="doPrintShow" v-if="!isEdit">补打</u-button>
<u-button type="warning" @click="doClear" v-if="!isEdit">清除</u-button>
</view>
</view>
</template>
@ -59,20 +98,48 @@
import {
isBlank
} from "../../../utils/string";
import { debug } from 'util';
import {
debug
} from 'util';
export default {
data() {
return {
site: this.vuex_tenantId,
scanMaterialLot: '',
isEdit: false,
printerListShow: false,
printerList: [],
printName: '',
formObj: {
handle: '',
site: '',
sapNumber: '',
u8Code: '',
ueightDesc: '',
sapBatch: '',
sapItemDesc: '',
productionDate: '',
weight: '',
length: '',
grade: '',
stage: '',
type: '',
batchNumber: '',
packageNumber: '',
customerCode: '',
dateCreate: '',
creator: '',
dateUpdate: '',
updater: ''
},
editForm: {
handle: '',
site: '',
sapNumber: '',
u8Code: '',
ueightDesc: '',
sapItemDesc: '',
sapBatch: '',
productionDate: '',
weight: '',
@ -98,7 +165,9 @@ import { debug } from 'util';
getBatchNumberDetail: this.$u.api.nlvWms.cuttingInventory.getBatchNumberDetail,
unbindMaterialLot: this.$u.api.nlvWms.wmsInventory.unbindMaterialLot,
reprintPackageNum: this.$u.api.nlvWms.wmsInventory.reprintPackageNum,
fetchPrinterList: this.$u.api.nlvWms.cuttingInventory.fetchPrinterList
fetchPrinterList: this.$u.api.nlvWms.cuttingInventory.fetchPrinterList,
doSaveForm: this.$u.api.nlvWms.cuttingInventory.doSaveForm,
fetchU8CodeList: this.$u.api.nlvWms.cuttingInventory.fetchU8CodeList
};
},
@ -109,6 +178,29 @@ import { debug } from 'util';
},
methods: {
// 编辑
doEdit(){
let me = this;
me.isEdit = true;
Object.assign(me.editForm,me.formObj);
},
// 保存表单
doSaveFormAction(){
let me = this;
uni.showLoading();
me.doSaveForm(me.editForm).then(res => {
uni.hideLoading();
me.isEdit = false;
me.$u.toast('更新成功');
me.formObj = res.data;
}).catch(e => {
uni.hideLoading();
me.focusMaterialLotInput();
me.$u.toast('错误' + e);
});
},
// 光标定位到新托盘扫描的输入框事件
focusScanMaterialLotInputInput() {
@ -129,7 +221,10 @@ import { debug } from 'util';
}
let data = res.data;
data.forEach(item => {
me.printerList.push({label: item.printerName, value:item.printerName});
me.printerList.push({
label: item.printerName,
value: item.printerName
});
})
}).catch(e => {
me.$u.toast(e);
@ -149,12 +244,12 @@ import { debug } from 'util';
uni.showLoading();
me.getBatchNumberDetail(param).then(res => {
uni.hideLoading();
if(res.data == null){
if (res.data == null) {
me.$u.toast('未检索到数据');
}else{
} else {
me.formObj = res.data;
}
}).catch(e => {
}).catch(e => {
uni.hideLoading();
me.focusMaterialLotInput();
me.$u.toast('错误' + e);
@ -169,7 +264,9 @@ import { debug } from 'util';
site: '',
sapNumber: '',
u8Code: '',
ueightDesc: '',
sapBatch: '',
sapItemDesc: '',
productionDate: '',
weight: '',
length: '',
@ -185,7 +282,7 @@ import { debug } from 'util';
updater: ''
}
},
// 解拖事件
doSubmit() {
let me = this;
@ -205,7 +302,7 @@ import { debug } from 'util';
});
},
doPrintShow(){
doPrintShow() {
let me = this;
me.printerListShow = true;
},
@ -214,7 +311,7 @@ import { debug } from 'util';
this.printName = this.printerList[index].value;
},
rePrintConfirm(printer){
rePrintConfirm(printer) {
let me = this;
if (isBlank(printer[0].value)) {
me.$u.toast('打印机不能为空');
@ -226,7 +323,7 @@ import { debug } from 'util';
return;
}
uni.showLoading();
me.reprintPackageNum(printer[0].value,packageNumber).then(res => {
me.reprintPackageNum(printer[0].value, packageNumber).then(res => {
uni.hideLoading();
me.$u.toast("打印成功");
// 清除数据防止残留
@ -234,6 +331,15 @@ import { debug } from 'util';
}).catch(e => {
uni.hideLoading();
});
},
// 弹窗返回
rowSelected(row) {
let me = this;
me.editForm.sapNumber = row.sapItem;
me.editForm.u8Code = row.ueightCode;
me.editForm.ueightDesc = row.ueightDesc;
me.editForm.sapItemDesc = row.sapItemDesc;
}
}
@ -241,99 +347,148 @@ import { debug } from 'util';
</script>
<style lang="scss">
.page-container {
padding: 15rpx;
height: 100vh;
background-color: #f6f8fa;
position: relative;
display: flex;
flex-direction: column;
.page-container {
padding: 15rpx;
height: 100vh;
background-color: #f6f8fa;
position: relative;
display: flex;
flex-direction: column;
.item-title {
margin-top: 5pt;
margin-left: 2pt;
font-size: 18px;
font-family: "黑体", "SimHei", "Microsoft YaHei", Arial, sans-serif;
font-weight: bold;
}
.item-title {
margin-top: 5pt;
margin-left: 2pt;
font-size: 18px;
font-family: "黑体", "SimHei", "Microsoft YaHei", Arial, sans-serif;
font-weight: bold;
}
.item-boby {
background-color: #fff;
padding: 5rpx;
.item-boby {
background-color: #fff;
padding: 5rpx;
.title {
font-size: 16px;
font-family: "黑体", "SimHei", "Microsoft YaHei", Arial, sans-serif;
font-weight: bold;
color: #999;
}
.title {
font-size: 16px;
font-family: "黑体", "SimHei", "Microsoft YaHei", Arial, sans-serif;
font-weight: bold;
color: #999;
}
/deep/ .u-col {
padding: 0px 2rpx;
margin-left: 0%;
flex: 0 0 16.6667%;
align-items: center;
justify-content: flex-start;
text-align: left;
}
/deep/ .u-col {
padding: 0px 2rpx;
margin-left: 0%;
flex: 0 0 16.6667%;
align-items: center;
justify-content: flex-start;
text-align: left;
}
.bar {
display: flex;
margin: 10px;
justify-content: center;
align-items: center;
}
.bar {
display: flex;
margin: 10px;
justify-content: center;
align-items: center;
}
/deep/ .primary-icon .u-icon__icon {
background-color: #0f80ff;
color: white;
}
/deep/ .primary-icon .u-icon__icon {
background-color: #0f80ff;
color: white;
}
/deep/ .error-icon .u-icon__icon {
background-color: #c50004;
color: white;
}
}
}
/deep/ .error-icon .u-icon__icon {
background-color: #c50004;
color: white;
}
}
}
.item-head {
/deep/ .u-cell {
display: flex;
flex-direction: row;
align-items: center;
position: relative;
box-sizing: border-box;
width: 100%;
padding: 8px 11px;
line-height: 21px;
background-color: #fff;
color: #999;
}
.item-head {
/deep/ .u-cell {
display: flex;
flex-direction: row;
align-items: center;
position: relative;
box-sizing: border-box;
width: 100%;
padding: 8px 11px;
line-height: 18px;
background-color: #fff;
color: #999;
}
/deep/ .u-cell__title {
font-size: 10px;
font-weight: 300;
}
/deep/ .u-cell__title {
font-size: 9px;
font-weight: 280;
}
/deep/ .u-cell__value {
font-size: 16px;
font-weight: bold;
color: #000000;
}
}
/deep/ .u-cell__value {
font-size: 14px;
font-weight: bold;
color: #000000;
}
}
.u-td {
height: 43px; /* 根据需求设置行高的像素值 */
}
.u-td {
height: 42px;
/* 根据需求设置行高的像素值 */
}
.item-footer > > > text {
color: #0f80ff;
line-height: 18px;
font-size: 15px;
margin: 20rpx;
}
.item-footer>>>text {
color: #0f80ff;
line-height: 18px;
font-size: 15px;
margin: 20rpx;
}
.item-button > > > button {
color: #0f80ff;
}
.item-button>>>button {
color: #0f80ff;
}
/deep/ .disabled {
background-color: #EAECEF;
}
/deep/ .chen-scroll {
width: 100%;
background-color: #FFFFFF;
}
/deep/ .scan {
background-color: #21ff06;
}
.selectList {
text-align: center;
margin: 0 0 2px 0;
}
.uni-textarea-placeholder {
color: rgb(192, 196, 204);
overflow: hidden;
}
/deep/ ::-webkit-scrollbar {
/*滚动条整体样式*/
width: 4px !important;
height: 1px !important;
overflow: auto !important;
background: #ccc !important;
-webkit-appearance: auto !important;
display: block;
}
/deep/ ::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 10px !important;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2) !important;
background: #7b7979 !important;
}
/deep/ ::-webkit-scrollbar-track {
/*滚动条里面轨道*/
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2) !important;
// border-radius: 10px !important;
background: #FFFFFF !important;
}
</style>