Commit aefed1f0 authored by 仇晓婷's avatar 仇晓婷

工艺设置页面ok

parent a18f1dc8
......@@ -17,4 +17,7 @@ export default {
createnew(params) {
return Api.post(`${technologyUrl}materiallist/createnew`, params);
},
list(params) {
return Api.post(`${technologyUrl}materiallist/list`, params); //查看料单
},
}
......@@ -61,8 +61,8 @@ export default {
productingPreparationPeople: 0,
orderIds: 0,
ids: [],
count:0
, },
count: 0,
},
detail: null,
modal: false,
easySearch: {
......@@ -124,11 +124,33 @@ export default {
);
},
},
// {
// title: "料单",
// key: "materialbillStatus",
// code: "process.RoutingStatus",
// },
{
title: "料单",
key: "materialbillStatus", //0生成料单,1查看
render: (h, params) => {
return h("a", [
h("state", {
props: {
code: "process.RoutingStatus",
type: "text",
value:
params.row.mainRoutingStatus == 1 &&
params.row.materialbillStatus == 0
? "生成料单"
: params.row.mainRoutingStatus == 1 &&
params.row.materialbillStatus == -1
? "查看"
: "",
},
nativeOn: {
click: () => {
this.material(params.row);
},
},
}),
]);
},
},
],
};
},
......@@ -136,6 +158,31 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
material(row) {
if (row.materialbillStatus == 0) {
this.saveBill(row.id, row.quantity);
} else if (row.materialbillStatus == 1) {
this.title = "查看料单";
this.detail = () => import("./materialDetails");
this.modal = true;
this.child.orderIds = row.id;
}
},
saveBill(orderId, orderCount) {
//生成料单
let params = {
orderId: orderId,
orderCount: orderCount,
};
Api.createnew(params).then((res) => {
if (res.success) {
this.$Message.success("已生成料单");
this.$refs.grid.reload(this.easySearch);
} else {
this.$Message.error("生成料单失败");
}
});
},
record(row) {
if (row.mainRoutingStatus == -1) {
//未设置-1
......@@ -143,7 +190,7 @@ export default {
this.child.productingPreparationPeople =
row.productingPreparationPeople;
this.child.orderIds = row.id;
this.child.count=row.quantity;
this.child.count = row.quantity;
this.title = "工艺列表";
this.detail = () => import("./set");
this.modal = true;
......
<template>
<div class="datails">
<Table border ref="selection" :columns="columns" :data="data1"></Table>
</div>
</template>
<script>
import Api from "./api";
export default {
props: {
eid: {
orderIds: Number,
},
},
data() {
return {
data1: [],
columns: [
{
key: "routingDetailNo",
title: this.l("routingDetailNo"),
align: "left",
width: 100,
},
{
key: "routingDetailName",
title: this.l("routingDetailName"),
align: "left",
},
{
key: "materialType",
title: this.l("materialType"),
align: "center",
code: "mes_xingchi_resource.material.materialReType",
width: 100,
},
{
key: "materialNumber",
title: this.l("materialNumber"),
align: "left",
},
{
key: "nameMaterial",
title: this.l("nameMaterial"),
align: "left",
},
{
key: "totalCount",
title: this.l("quantity"),
align: "right",
width: 80,
},
{
key: "brand",
title: this.l("brand"),
align: "left",
},
{
key: "specifications",
title: this.l("specifications"),
align: "left",
},
{
key: "xhgg",
title: this.l("xhgg"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "texture",
title: this.l("texture"),
align: "left",
},
{
key: "procurementStandards",
title: this.l("procurementStandards"),
align: "left",
},
{
key: "qualityGrade",
title: this.l("qualityGrade"),
align: "left",
},
{
key: "drawNum",
title: this.l("drawNum"),
align: "left",
},
],
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
this.getData();
},
methods: {
getData() {
let conditions = [
{
conditionalType: "In",
fieldName: "orderId",
fieldValue: this.eid.orderIds,
},
];
let data = {
conditions: conditions,
};
Api.list(data).then((r) => {
if (res.success) {
this.data1 = r.result;
}
});
},
l(key) {
key = "routingsupporting" + "." + key;
return this.$t(key);
},
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
......@@ -279,7 +279,7 @@ export default {
Api.routingset(data).then((r) => {
if (r.success) {
//this.$Message.success("工艺设置成功");
this.saveBill();
// this.saveBill();
} else {
this.$Message.error("工艺设置失败");
}
......@@ -290,27 +290,6 @@ export default {
},
});
},
saveBill() {
//生成料单
let temRouId = [];
this.routingList.forEach((el) => {
temRouId.push(el.routingHeaderId);
});
let params = {
routingHeaderId: temRouId,
orderId: this.eid.orderIds,
orderCount: this.eid.count,
};
Api.createnew(params).then((res) => {
if (res.success) {
this.$emit("on-ok");
//this.loaddata(this.orderId);
//this.materialBillSetStatus = 1;
} else {
this.$Message.error("生成料单失败");
}
});
},
l(key) {
let vkey = "routingHeader" + "." + key;
return this.$t(vkey) || key;
......
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