Commit c188f9dd authored by renjintao's avatar renjintao

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

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