<template>
|
<view>
|
<view class="form-container">
|
<form :modelValue="formData">
|
<view class="form-group">
|
<label class="form-label">到货单号:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.billNo"/>
|
</view>
|
<view class="form-group">
|
<label class="form-label">送货单号:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.paperBillNo"/>
|
</view>
|
<view class="form-group">
|
<label class="form-label">录入人员:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.createBy"/>
|
</view>
|
<view class="form-group">
|
<label class="form-label">来料日期:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.insDate"/>
|
</view>
|
<view class="form-group">
|
<label class="form-label">提交日期:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.checkDate"/>
|
</view>
|
<view class="form-group">
|
<label class="form-label">收货仓库编码:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.depotsCode"/>
|
</view>
|
<view class="uni-title-sub uni-ellipsis-2">
|
<view class="form-group">
|
<label class="form-label">收货仓库名称:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.depotName"/>
|
</view>
|
</view>
|
<view class="form-group">
|
<label class="form-label">供应商编码:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.suppNo"/>
|
</view>
|
<view class="form-group">
|
<label class="form-label">供应商名称:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.suppName"/>
|
</view>
|
<view class="form-group">
|
<label class="form-label">备注:</label>
|
<input class="form-input" disabled="true" type="text" v-model="formData.remark"/>
|
</view>
|
</form>
|
</view>
|
|
<view class="text" v-if="Message">
|
<text v-text="Message"></text>
|
</view>
|
|
<view class="list-container">
|
<uni-table ref="table" type="selection" border stripe emptyText="暂无更多数据"
|
@selection-change="selectionChange">
|
<uni-tr>
|
<uni-th align="center" class="th">急料标识</uni-th>
|
<uni-th align="center" class="th">确认退货</uni-th>
|
<uni-th align="center" class="th">检验结果</uni-th>
|
<uni-th align="center" class="th">检验状态</uni-th>
|
<uni-th align="center" class="th">采购单号</uni-th>
|
<uni-th align="center" class="th">序号</uni-th>
|
<uni-th align="center" class="th">物料编码</uni-th>
|
<uni-th align="center" class="th">物料名称</uni-th>
|
<uni-th align="center" class="th">物料规格</uni-th>
|
<uni-th align="center" class="th">采购订单数</uni-th>
|
<uni-th align="center" class="th">本次应收数量</uni-th>
|
<uni-th align="center" class="th">本次实收数量</uni-th>
|
<uni-th align="center" class="th">已入库数</uni-th>
|
<uni-th align="center" class="th">采购单位</uni-th>
|
<uni-th align="center" class="th">备注</uni-th>
|
</uni-tr>
|
<uni-tr v-for="(item, index) in tableData" :key="index">
|
<uni-td align="center">
|
<checkbox-group style="background-color: white;border-bottom: 1px solid #c7c7c7;">
|
<checkbox value="F_TYPE" disabled="true" :checked="item.urgentFlag == 1"/>
|
</checkbox-group>
|
</uni-td>
|
<uni-td align="center">
|
<checkbox-group style="background-color: white;border-bottom: 1px solid #c7c7c7;">
|
<checkbox value="F_TYPE" disabled="true" :checked="item.isdepsIn == 1"/>
|
</checkbox-group>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.checkRes"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.checkStates"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.ebeln"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.workLine"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.itemNo"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.itemName"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.itemModel"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.ebelnQty"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.subQty"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.quantity"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.okRkqty"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.fname"/>
|
</uni-td>
|
<uni-td align="center">
|
<input class="form-input" disabled="true" type="text" v-model="item.memo"/>
|
</uni-td>
|
</uni-tr>
|
</uni-table>
|
</view>
|
|
<view class="plus-button">
|
<button type="warn" @click="ToErp">确认退货</button>
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
formData: {},
|
|
selectedIndexs: [],
|
|
tableData: [],
|
|
Message: ""
|
|
};
|
},
|
onLoad(options) {
|
//options中包含了url附带的参数
|
|
let params = options;
|
|
this.isUpdate = false;
|
this.formData.id = params["id"];
|
this.formData.billNo = params["billNo"];
|
//getQaItemXj02
|
this.init();
|
},
|
methods: {
|
|
// 多选处理
|
selectedItems() {
|
return this.selectedIndexs.map(i => this.tableData[i])
|
},
|
|
// 多选
|
selectionChange(e) {
|
this.selectedIndexs = [];
|
this.selectedIndexs = e.detail.index
|
},
|
|
init() {
|
this.$post({
|
url: "/MesInvItemArn/GetPageList",
|
data: {
|
id: this.formData.id,
|
pageIndex: 1,
|
limit: 1,
|
}
|
}).then(res => {
|
let data = res.data.tbBillList[0];
|
if (data) {
|
this.formData = data;
|
|
this.$post({
|
url: "/MesInvItemArnDetail/GetDetails",
|
data: {
|
id: this.formData.id
|
}
|
}).then(res1 => {
|
this.tableData = res1.data.tbBillList;
|
});
|
}
|
});
|
},
|
ToErp() {
|
this.Message = "";
|
let selectedItems = this.selectedItems();
|
if (selectedItems.length > 1) {
|
this.Message = "一次只允许推送一条数据!!!"
|
return;
|
}
|
let bigInt64Array = selectedItems.map(s => s.id);
|
if (bigInt64Array == null || bigInt64Array.length === 0) {
|
this.$showMessage("请选择需要退货的数据");
|
return;
|
}
|
|
if (selectedItems[0].checkRes != "不合格") {
|
this.Message = "只有检验不合格的数据才能推送ERP!!!"
|
return;
|
}
|
|
this.Message = "正在推送采购订单 [" + selectedItems[0].ebeln + "],序号为[" + selectedItems[0].workLine + "]到ERP.... 请稍后";
|
this.$post({url: "/MesInvItemArnDetail/GetMaterial", data: {ItemArnDetailIds: bigInt64Array}}).then(res => {
|
let s = res.data.tbBillList[0];
|
|
let fngDesc = s.fngDesc != null ? '"' + s.fngDesc + '"' : '""';
|
|
let data = {
|
taskname: 'CGTL',
|
mesid: s.fmesEntryId,
|
optype: "create",
|
datajson: '{"F_MES_ID": ' + s.fmesEntryId + ',' +
|
'"FDate":"' + this.$getDate("yyyy-mm-dd") +
|
'","FSRCBillTypeId": "收料通知单",' +
|
'"FDESCRIPTION": ' + fngDesc + ',' +
|
'"FMRMODE": "' + s.fmrMode + '",' +
|
'"cgtlentry": [{' +
|
' "FMATERIALID": "' + s.fmaterialId + '",' +
|
' "FUINT": "' + s.funit + '",' +
|
' "FRMREALQTY": ' + s.frmRealQty + ',' +
|
' "FSTOCKID": "' + s.fstockId + '",' +
|
' "FSRCENTRYID": ' + s.fsrcEntryId + ',' +
|
'"F_MES_ENTRYID": ' + s.fmesEntryId + '}]}'
|
}
|
|
uni.request({
|
url: 'http://192.168.11.120:8098/WebService1.asmx/mesToErpinfo',
|
method: 'POST',
|
header: {
|
'Accept': '*/*',
|
'Host': '192.168.11.120:8098',
|
'Connection': 'keep-alive',
|
'Content-Type': 'application/x-www-form-urlencoded'
|
},
|
data: data,
|
success: (res1) => {
|
if (res1.data.state == 200) {
|
this.Message += " 正在执行MES回调!请稍后"
|
this.SetMaterial(s);
|
} else {
|
this.Message += " ERP返回信息:" + res1.data.msg;
|
}
|
},
|
fail: (err) => {
|
console.log(err);
|
}
|
});
|
})
|
;
|
},
|
|
SetMaterial(s) {
|
|
s.userName = this.$loginInfo.account;
|
|
this.$post({
|
url: "/MesInvItemArnDetail/SetMaterial",
|
data: s
|
}).then(res => {
|
if (res.status == 0) {
|
this.Message += " 推送成功";
|
} else {
|
this.Message = res.message;
|
}
|
}).catch(err => {
|
this.Message = " 推送失败:" + err;
|
});
|
}
|
},
|
onShow() {
|
//每次进入页面都会执行的方法
|
if (this.formData.id) {
|
this.init();
|
}
|
}
|
,
|
};
|
</script>
|
|
<style>
|
.form-group {
|
display: flex;
|
align-items: center;
|
border-bottom: 1px solid #c9c9c9;
|
}
|
|
.form-label {
|
margin-bottom: 0;
|
padding: 5px;
|
}
|
|
.form-input {
|
flex: 1;
|
margin-bottom: 0;
|
padding: 5px;
|
}
|
|
/* 默认样式 */
|
.list-container {
|
height: 60vh;
|
/* 设置列表容器的高度为剩余空间,并减去表单容器的高度 */
|
overflow-y: auto;
|
/* 允许列表容器垂直滚动 */
|
padding: 10px;
|
/* 可选:添加一些内边距,使列表内容更美观 */
|
}
|
|
/* 在小屏幕设备上,重置高度为适应屏幕 */
|
@media (max-width: 768px) {
|
.list-container {
|
height: calc(100vh - 500px);
|
/* 适当调整高度 */
|
}
|
}
|
|
|
.form-container {
|
padding: 10px;
|
/* 可选:添加一些内边距,使表单内容更美观 */
|
}
|
|
.th {
|
background-color: lightskyblue;
|
color: #FFFFFF;
|
}
|
|
|
.plus-button {
|
line-height: 59px;
|
font-size: 24px;
|
cursor: pointer;
|
z-index: 1000;
|
margin-bottom: 10px;
|
}
|
|
.overlay {
|
position: fixed;
|
top: 0;
|
left: 0;
|
width: 100%;
|
height: 100%;
|
background-color: rgba(0, 0, 0, 0.5);
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
}
|
|
.popup {
|
background-color: #fff;
|
padding: 20px;
|
border: 1px solid #ccc;
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
width: 68vw;
|
/* 设置宽度为视口宽度的80% */
|
height: 25vh;
|
/* 设置高度为视口高度的80% */
|
}
|
|
|
.text {
|
background-color: #ffee6f;
|
}
|
|
uni-th {
|
color: #FFFFFF
|
}
|
</style>
|