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

料单,料单确认

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