Commit c188f9dd authored by renjintao's avatar renjintao

出库--》配套 /已出库信息...

parent acbbd1ff
......@@ -1627,8 +1627,8 @@ export default {
outCount:'出库数',
},
support_item:{
creationTime:'创建时间',
creatorUserId:'创建人',
creationTime:'出库时间',
creatorUserId:'出库人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
......@@ -1640,7 +1640,7 @@ export default {
routingDetailName:'工序',
routingDetailSeq:'工序号',
routingDetailNo:'工序号',
count:'申请数量',
count:'出库数',
status:'状态',
materialId:'物料id',
materialName:'物料名称',
......@@ -1651,5 +1651,7 @@ export default {
outStockNumber:'出库数量',
orderId:'',
remark:'备注',
storeId: '库位id',
storeTitle: '库位名称',
}
}
......@@ -23,7 +23,7 @@
></Table>
</div>
<div slot="bottom" class="demo-split-pane" style="background:#fff;height:100%">
<p class="mt10 mb10">
<p class="mt10 mb10" v-show="showBottom">
<Button type="primary" @click="getMetaiAll">出库</Button>
</p>
<Table
......@@ -32,19 +32,23 @@
class="tableCommon"
border
highlight-row
@on-current-change="curChange"
:height="tableHeight2-40"
v-show="showBottom"
>
<template slot-scope="{ row, index }" slot="counts">
<InputNumber
:max="row.total"
:min="0"
v-model="row.count"
@on-blur="inputChange(row,index)"
/>
</template>
</Table>
</div>
</Split>
<Modal v-model="ModalAccList" title="出库记录" width="1000" footer-hide>
<DataGrid :action="action" :columns="colsList" ref="grid" :conditions="easySearch" height="400" :tool="false"></DataGrid>
</Modal>
</div>
</template>
<script>
......@@ -53,12 +57,19 @@ export default {
name: "Edit",
data() {
return {
action: Api.indexAcc,
easySearch: {
supportItemId: { op: "In", value: "" },
},
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
statuList: this.$store.getters.dictionaryByKey("accessory.status") || [],
statuList1: this.$store.getters.dictionaryByKey("outstore.status") || [],
split: 0.5,
showBottom: false,
cols: [
{
key: "materialName",
......@@ -79,11 +90,43 @@ export default {
key: "outCount",
title: "出库数",
align: "right",
render: (h, params) => {
return h(
"op",
{
attrs: {
oprate: "detail",
title: "查看明细",
},
style: {
color: "blue",
},
on: {
click: () => this.openAccessoryList(params.row),
},
},
params.row.outCount
);
},
},
{
key: "",
key: "status",
title: "状态",
align: "center",
render: (h, params) => {
return h(
"op",
{
attrs: {
oprate: "detail",
},
style: {
color: this.setName(this.statuList1, params.row.status).color,
},
},
this.setName(this.statuList1, params.row.status).name
);
},
},
{
key: "remark",
......@@ -119,7 +162,7 @@ export default {
{
key: "creationTime",
title: this.l1("creationTime1"),
align: "right",
align: "center",
},
{
key: "creator",
......@@ -139,6 +182,41 @@ export default {
},
],
datasOut: [],
tempOut: null,
ModalAccList: false,
colsList: [
{
key: "materialName",
title: this.l2("materialName"),
align: "left",
},
{
key: "materialNumber",
title: this.l2("materialNumber"),
align: "left",
},
{
key: "storeTitle",
title: this.l2("storeTitle"),
align: "left",
},
{
key: "creationTime",
title: this.l2("creationTime"),
align: "center",
},
{
key: "creatorUserId",
title: this.l2("creatorUserId"),
type: "user",
},
{
key: "count",
title: this.l2("count"),
align: "right",
},
],
};
},
props: {
......@@ -202,31 +280,109 @@ export default {
handleClose() {
this.$emit("on-close");
},
//配套申请
setName(list, v) {
let outPar = {
name: "",
color: "",
};
if ((v + "").indexOf(",") == -1) {
var item;
list.map((u) => {
if (u.code == v) {
item = u;
}
});
if (item) {
//this.items = item;
outPar = {
name: item.name,
color: item.color,
};
}
}
return outPar;
},
curChange(curRow, oldRow) {
//点击物料行
//alert(JSON.stringify(curRow));
Api.supportmateriallistone({ id: curRow.materialId }).then((r) => {
if (r.success) {
this.tempOut = curRow;
if (curRow.status != 2) {
Api.supportmateriallistone({ id: curRow.materialId }).then((r) => {
if (r.success) {
r.result.forEach((el) => {
el.count = 0;
});
this.datasOut = r.result;
}
});
el.count = 0;
});
this.datasOut = r.result;
this.showBottom = true;
}
});
} else {
this.$Message.error("已出库完成!");
}
},
getMetaiAll() {
//点击物料行
//alert(JSON.stringify(curRow));
Api.supportmateriallist({ id: 31 }).then((r) => {
if (r.success) {
// this.datasOut = r.result;
//alert(JSON.stringify(this.datas));
// alert(JSON.stringify(this.tempOut));
let temItems = this.$u.clone(this.datasOut);
let temArray = [];
var total = 0;
temItems.forEach((el) => {
if (el.count > 0) {
let temObj = {
count: el.count,
storeId: el.storeId,
storeTitle: el.storeTitle,
status: 0,
materialId: this.tempOut.materialId,
materialName: this.tempOut.materialName,
materialNumber: this.tempOut.materialNumber,
orderId: this.row.orderId,
supportItemId: this.tempOut.id,
};
total = total + el.count;
temArray.push(temObj);
}
});
let surplus =
Number(this.tempOut.count) -
Number(this.tempOut.outCount ? this.tempOut.outCount : 0);
if (total <= surplus) {
let parms = {
main: {
creator: this.$store.state.userInfo.userName,
orderId: this.row.orderId,
orderCode: this.row.orderCode,
supportMainId: this.tempOut.supportMainId,
},
item: temArray,
};
// alert(JSON.stringify(parms));
Api.outmainCreate(parms).then((r) => {
if (r.success) {
this.$Message.success("出库成功");
this.load(this.eid);
this.datasOut = [];
this.showBottom = false;
}
});
} else {
this.$Message.error("输入的出库数量大于申请数量");
}
},
moveEnd() {
this.tableHeight1 = this.splitHeight * this.split;
this.tableHeight2 = this.splitHeight * (1 - this.split);
},
inputChange(row, index) {
//输入数量
this.$set(this.datasOut, index, row);
},
openAccessoryList(row) {
this.ModalAccList = true;
this.easySearch.supportItemId.value = row.id;
this.$refs.grid.reload(this.easySearch);
},
l(key) {
key = "support_main" + "." + key;
return this.$t(key);
......@@ -235,6 +391,10 @@ export default {
key = "stock" + "." + key;
return this.$t(key);
},
l2(key) {
key = "support_item" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
......
......@@ -38,4 +38,5 @@ export default {
outmainBatchdel(params) {//批量撤销出库
return Api.post(`${resourceUrl}/outmain/batchdelete`, params);
},
indexAcc: `${resourceUrl}/outitem/paged`,
}
......@@ -33,11 +33,13 @@ export default {
easySearch: {
keys: { op: "orderCode,code", value: null },
},
statuList: this.$store.getters.dictionaryByKey("accessory.status") || [],
statuList1: this.$store.getters.dictionaryByKey("outstore.status") || [],
modal: false,
title: "新增",
detail: null,
curId: 0,
entity:{},
entity: {},
columns: [
{
key: "code",
......@@ -114,8 +116,8 @@ export default {
getAccessory(row) {
this.curId = row.id;
this.title = "配套";
this.entity=row
this.detail = () => import("./accessory");
this.entity = row;
this.detail = () => import("./accessory");
this.modal = true;
},
getOutBound(row) {
......@@ -124,7 +126,29 @@ export default {
this.detail = () => import("./outbound");
this.modal = true;
},
//配套申请
setName(list, v) {
let outPar = {
name: "",
color: "",
};
if ((v + "").indexOf(",") == -1) {
var item;
list.map((u) => {
if (u.code == v) {
item = u;
}
});
if (item) {
//this.items = item;
outPar = {
name: item.name,
color: item.color,
};
}
}
return outPar;
},
cancel() {
this.curId = 0;
this.modal = false;
......
......@@ -309,7 +309,7 @@ export default {
methods: {
split(row, index) {
//工单分卡
this.getProduct(row.id);
this.getProduct(row);
this.initeId = {
routingDetailId: row.detailId,
dispatchId: row.id
......@@ -322,9 +322,13 @@ export default {
this.entity.scheduleType = null;
}
},
getProduct(id) {
getProduct(row) {
let params = {
entryID: id
dispatch_id:row.id,
execute_id:row.executeId,
order_id:row.orderId,
RoutingHeaderId:row.routingHeaderId,
RoutingDetailId:row.detailId,
};
Api.getentryproductcode(params).then(res => {
if (res.success) {
......
......@@ -69,6 +69,7 @@
height="120"
:title="row.productUrl"
style="border:#cacbd0 dashed 1px"
onerror="this.src='/imgicon/noPic_product.png';"
/>
</Col>
<Col span="16" class="row">
......
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