Commit 4518c49d authored by kangzhenfei's avatar kangzhenfei Committed by 佟礼

料单,料单确认

parent 6bf72999
...@@ -1148,6 +1148,8 @@ export default { ...@@ -1148,6 +1148,8 @@ export default {
routingDetailId: '工序ID', routingDetailId: '工序ID',
routingStepId: '工步ID', routingStepId: '工步ID',
quantity: '数量', quantity: '数量',
singlequantity: '总计数量',
materialId: '物料id', materialId: '物料id',
materialType: '物料类型', materialType: '物料类型',
materialNumber: '物料编号', materialNumber: '物料编号',
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
工序{{item.process_seq}}{{item.process_name}} 工序{{item.process_seq}}{{item.process_name}}
</p> </p>
<p>{{item.beginTime}}--{{item.endTime}}</p> <p>{{item.beginTime}}--{{item.endTime}}</p>
<p>设备 :{{item.EquipCode}}</p> <!-- <p>设备 :{{item.equipCode}}</p> -->
</div> </div>
</Card> </Card>
</Col> </Col>
......
<style lang="less">
@import "../../../processDesign/Process/menu.less";
</style>
<template> <template>
<div> <div class="new_box">
<Table <Table
v-if="false" v-if="false"
stripe stripe
...@@ -33,22 +35,27 @@ ...@@ -33,22 +35,27 @@
</FormItem> </FormItem>
</Row>--> </Row>-->
<Row> <Row>
<FormItem label="文档编号" prop="code"> <Col span="12">
<Input <FormItem label="文档编号" prop="code">
size="large" <Input
v-model.trim="formValidate.code" size="large"
placeholder="请输入..." v-model.trim="formValidate.code"
style="width:240px" placeholder="请输入..."
:disabled="isview" style="width:240px"
/> :disabled="codeisview"
</FormItem> />
</FormItem>
</Col>
<Col span="12">
<Button v-if="!isview" type="primary" @click="openNew">新增</Button>
</Col>
</Row> </Row>
</Form> </Form>
<!-- <div> <div>
<Button type="text" size="large" @click="saveCancelModel">取消</Button> <!-- <Button type="text" size="large" @click="saveCancelModel">取消</Button>
<Button type="primary" size="large" @click="Seveld" class="mr20">确定</Button> <Button type="primary" size="large" @click="Seveld" class="mr20">确定</Button>
<Checkbox v-model="checked" label="送审">送审</Checkbox> <Checkbox v-model="checked" label="送审">送审</Checkbox>-->
</div>--> </div>
<Table stripe ref="table" border :columns="column1" :data="formValidate1" class="tableCommon"> <Table stripe ref="table" border :columns="column1" :data="formValidate1" class="tableCommon">
<template slot-scope="{ row,index }" slot="materialType"> <template slot-scope="{ row,index }" slot="materialType">
<state <state
...@@ -144,6 +151,7 @@ export default { ...@@ -144,6 +151,7 @@ export default {
Modeltitle: "料单", Modeltitle: "料单",
dataTop: [], dataTop: [],
isview: false, isview: false,
codeisview: false,
newModel: false, newModel: false,
columnTop: [ columnTop: [
...@@ -234,7 +242,7 @@ export default { ...@@ -234,7 +242,7 @@ export default {
]*/ ]*/
}, },
approvalStatus: 0, approvalStatus: 0,
editindex: -1,
formValidate: { formValidate: {
id: 0, id: 0,
code: "", code: "",
...@@ -260,7 +268,7 @@ export default { ...@@ -260,7 +268,7 @@ export default {
pate_number: "", pate_number: "",
spec: "", spec: "",
categories: "", categories: "",
quantity: 0, quantity: 1,
singlequantity: 0, singlequantity: 0,
quantity_unit: "", quantity_unit: "",
estimated_part_height: 0, estimated_part_height: 0,
...@@ -299,11 +307,16 @@ export default { ...@@ -299,11 +307,16 @@ export default {
}, },
{ {
key: "quantity", key: "quantity",
title: this.l("singlequantity"),
align: "left",
high: true
},
{
key: "singlequantity",
title: this.l("quantity"), title: this.l("quantity"),
align: "left", align: "left",
high: true high: true
}, },
{ {
key: "material_type", key: "material_type",
title: this.l("materialType"), title: this.l("materialType"),
...@@ -358,6 +371,7 @@ export default { ...@@ -358,6 +371,7 @@ export default {
align: "center", align: "center",
render: (h, params) => { render: (h, params) => {
let id = params.row.id; let id = params.row.id;
if (!this.isview) { if (!this.isview) {
return h( return h(
"div", "div",
...@@ -423,6 +437,13 @@ export default { ...@@ -423,6 +437,13 @@ export default {
key = "RoutingSupporting" + "." + key; key = "RoutingSupporting" + "." + key;
return this.$t(key); return this.$t(key);
}, },
openNew() {
// this.$nextTick(()=>{
// this.$refs['formItem'].resetFields()
// }
this.cleardata1();
this.newModel = true;
},
loaddata() { loaddata() {
if (this.formValidate.id != 0) { if (this.formValidate.id != 0) {
var url = var url =
...@@ -432,14 +453,20 @@ export default { ...@@ -432,14 +453,20 @@ export default {
if ( if (
this.formValidate.approvalStatus == 1 || this.formValidate.approvalStatus == 1 ||
this.formValidate.approvalStatus == 2 || this.formValidate.approvalStatus == 2 ||
this.formValidate.approvalStatus == 3 this.formValidate.approvalStatus == 3 ||
this.formValidate.status == 2
) { ) {
this.isview = true; this.isview = true;
} else { } else {
this.isview = false; this.isview = false;
} }
this.codeisview = true;
this.formValidate1 = response.result.orderMaterialList; this.formValidate1 = response.result.orderMaterialList;
for (let i = 0; i < this.formValidate1.length; i++) {
let obj = this.formValidate1[i];
obj.quantity = obj.quantity * columnTop[0].quantity;
}
}); });
} else { } else {
this.cleardata(); this.cleardata();
...@@ -448,11 +475,8 @@ export default { ...@@ -448,11 +475,8 @@ export default {
`${designUrl}/ordersupport/getbyheaderid?headerID=` + `${designUrl}/ordersupport/getbyheaderid?headerID=` +
this.formValidate.routingHeaderId; this.formValidate.routingHeaderId;
service.get(`${url}`).then(response => { service.get(`${url}`).then(response => {
this.formValidate = response.result.orderMaterial; this.formValidate.code = response.result.orderMaterial.code;
var url = `${designUrl}/ordersupport/getordermateriacode`;
service.get(`${url}`).then(response => {
this.formValidate.code = response.result;
});
this.isview = false; this.isview = false;
this.formValidate1 = response.result.orderMaterialList; this.formValidate1 = response.result.orderMaterialList;
}); });
...@@ -559,17 +583,31 @@ export default { ...@@ -559,17 +583,31 @@ export default {
} }
if (this.formValidate.id == 0) { if (this.formValidate.id == 0) {
this.formValidate1.push(this.formprocessValidate);
if (this.editindex == -1) {
this.formprocessValidate.singlequantity=this.formprocessValidate / columnTop[0].quantity;
let curData = {};
curData = JSON.parse(JSON.stringify(this.formprocessValidate));
this.formValidate1.push(curData);
} else {
let curData = {};
curData = JSON.parse(JSON.stringify(this.formprocessValidate));
this.formValidate1[this.editindex] = curData;
}
} else { } else {
var url = `${designUrl}/ordermateriallist/createorupdate`; var url = `${designUrl}/ordermateriallist/createorupdate`;
this.formprocessValidate.materialbillId = this.formValidate.id;
service service
.post(`${url}`, this.formprocessValidate) .post(`${url}`, {
orderMaterialList: this.formprocessValidate
})
.then(response => { .then(response => {
if (response.success) { if (response.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.newModel = false; this.newModel = false;
this.cleardata();
this.loaddata(); this.loaddata();
} }
}) })
...@@ -577,8 +615,10 @@ export default { ...@@ -577,8 +615,10 @@ export default {
this.$Message.error("保存失败"); this.$Message.error("保存失败");
}); });
} }
this.editindex = -1;
}, },
editFun(params) { editFun(params) {
this.editindex = params.index;
this.formprocessValidate.id = params.row.id; this.formprocessValidate.id = params.row.id;
this.formprocessValidate.materialbillId = params.row.materialbillId; this.formprocessValidate.materialbillId = params.row.materialbillId;
this.formprocessValidate.material_type = params.row.material_type; this.formprocessValidate.material_type = params.row.material_type;
...@@ -623,10 +663,8 @@ export default { ...@@ -623,10 +663,8 @@ export default {
title: "提示", title: "提示",
content: "确定要删除当前行?", content: "确定要删除当前行?",
onOk: () => { onOk: () => {
if (this.formValidate.id == 0) { if (params.row.id == 0) {
this.formValidate1.splice(params.index, 1);
this.formValidate1.push(this.formprocessValidate);
} else { } else {
var url = var url =
`${designUrl}/ordermateriallist/delete?id=` + params.row.id; `${designUrl}/ordermateriallist/delete?id=` + params.row.id;
...@@ -635,7 +673,7 @@ export default { ...@@ -635,7 +673,7 @@ export default {
.then(response => { .then(response => {
if (response.success) { if (response.success) {
this.$Message.success("删除成功"); this.$Message.success("删除成功");
this.formValidate1.splice(params.index, 1);
} else { } else {
this.$Message.error("删除失败"); this.$Message.error("删除失败");
} }
...@@ -652,7 +690,8 @@ export default { ...@@ -652,7 +690,8 @@ export default {
this.modalliao = false; this.modalliao = false;
}, },
cancel() { cancel() {
this.cleardata(); this.cleardata1();
this.editindex = -1;
}, },
cleardata() { cleardata() {
this.formValidate.id = 0; this.formValidate.id = 0;
...@@ -661,8 +700,35 @@ export default { ...@@ -661,8 +700,35 @@ export default {
this.formValidate.platesnum = 0; this.formValidate.platesnum = 0;
this.formValidate.quota_per_board = 0; this.formValidate.quota_per_board = 0;
this.formValidate.file_template = ""; this.formValidate.file_template = "";
},
this.formValidate1 = null; cleardata1() {
this.editindex = -1;
(this.formprocessValidate.id = 0),
(this.formprocessValidate.material_type = 0),
(this.formprocessValidate.name = ""),
(this.formprocessValidate.pate_number = ""),
(this.formprocessValidate.spec = ""),
(this.formprocessValidate.categories = ""),
(this.formprocessValidate.quantity = 1),
(this.formprocessValidate.singlequantity = 0),
(this.formprocessValidate.quantity_unit = ""),
(this.formprocessValidate.estimated_part_height = 0),
(this.formprocessValidate.height_unit = ""),
(this.formprocessValidate.lower_basal_plate = 0),
(this.formprocessValidate.plate_unit = ""),
(this.formprocessValidate.use_equip = ""),
(this.formprocessValidate.remarks = ""),
(this.formprocessValidate.extend = ""),
(this.formprocessValidate.actual_quantity = 0),
(this.formprocessValidate.routingHeaderId = 0),
(this.formprocessValidate.routingDetailId = 0),
(this.formprocessValidate.routingStepId = 0),
(this.formprocessValidate.supportingID = 0),
(this.formprocessValidate.materialNumber = ""),
(this.formprocessValidate.xhgg = ""),
(this.formprocessValidate.exture = ""),
(this.formprocessValidate.procurementStandards = ""),
(this.formprocessValidate.qualityGrade = "");
} }
} }
}; };
......
This diff is collapsed.
This diff is collapsed.
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