Commit 7be98c2e authored by 康振飞's avatar 康振飞

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product

parents 8574fad5 330b2550
...@@ -406,8 +406,7 @@ export default { ...@@ -406,8 +406,7 @@ export default {
var url = var url =
`${designUrl}/routingheader/GetListSmall?approvalstatus=1&product_id=` + `${designUrl}/routingheader/GetListSmall?approvalstatus=1&product_id=` +
productid + productid +
'&routingType=' + '&routingType=0';
this.formValidate.routingType
service.get(`${url}`).then((response) => { service.get(`${url}`).then((response) => {
this.RoutingList = response.result this.RoutingList = response.result
}) })
......
<template> <template>
<div> <div>
<Table stripe ref="table" :columns="columnTop" :data="dataTop" border class="tableCommon"></Table> <Table
v-if="false"
stripe
ref="table"
:columns="columnTop"
:data="dataTop"
border
class="tableCommon"
></Table>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="160" inline> <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="160" inline>
<!-- <Row> <!-- <Row>
...@@ -34,248 +42,6 @@ ...@@ -34,248 +42,6 @@
:disabled="isview" :disabled="isview"
/> />
</FormItem> </FormItem>
<FormItem label="板数">
<InputNumber
placeholder="请输入..."
:min="0"
v-model="formValidate.platesnum"
style="width:240px"
:disabled="isview"
></InputNumber>
</FormItem>
</Row>
<Row>
<FormItem label="每板定额" style="width:400px">
<!-- <Select style="width:240px;" v-model="formValidate.quota_per_board" placeholder="请选择...">
<Option
v-for="(item,index) in quotaperboardList"
:value="item.value"
:label="item.name"
:key="index"
></Option>
</Select>-->
<InputNumber
placeholder="请输入..."
:min="0"
v-model="formValidate.quota_per_board"
style="width:240px"
:disabled="isview"
></InputNumber>
</FormItem>
</Row>
<Divider orientation="left" style="color:#249e91">粉末信息</Divider>
<Row>
<FormItem label="粉末名称">
<Select
style="width:240px;"
:disabled="isview"
v-model="formValidate1[0].name"
placeholder="请选择..."
>
<Option
v-for="(item,index) in fmnameList"
:value="item.value"
:label="item.lable"
:key="index"
></Option>
</Select>
<!-- <materialDic v-model="formValidate1[0].name" :dic="fmnameList" ref="fmnameList"></materialDic> -->
</FormItem>
<FormItem label="粉末牌号">
<Select
style="width:240px;"
:disabled="isview"
v-model="formValidate1[0].pate_number"
placeholder="请选择..."
>
<Option
v-for="(item,index) in fmpatenumberList"
:value="item.value"
:label="item.lable"
:key="index"
></Option>
</Select>
<!-- <materialDic v-model="formValidate1[0].pate_number" :dic="fmpatenumberList" ref="fmpatenumberList"></materialDic> -->
</FormItem>
</Row>
<Row>
<FormItem label="粉末规格">
<Select
style="width:240px;"
:disabled="isview"
v-model="formValidate1[0].spec"
placeholder="请选择..."
>
<Option
v-for="(item,index) in fmspceList"
:value="item.value"
:label="item.lable"
:key="index"
></Option>
</Select>
<!-- <materialDic v-model="formValidate1[0].spec" :dic="fmspceList" ref="fmspceList"></materialDic> -->
</FormItem>
<FormItem label="粉末类别">
<!-- <Select style="width:240px;" v-model="formValidate1[0].categories" placeholder="请选择...">
<Option
v-for="(item,index) in fmcategoriesList"
:value="item.value"
:label="item.lable"
:key="index"
></Option>
</Select>-->
<Dictionary
code="mes_xingchi_resource.material.powderType"
style="width:240px"
v-model="formValidate1[0].categories"
:disabled="isview"
></Dictionary>
<!-- <materialDic v-model="formValidate1[0].categories" :dic="fmcategoriesList" ref="fmcategoriesList"></materialDic> -->
</FormItem>
</Row>
<Row>
<FormItem label="预估粉末总量" prop="fmquantity">
<InputNumber
placeholder="请输入..."
:min="0"
v-model="formValidate1[0].quantity"
style="width:240px"
:disabled="isview"
></InputNumber>
</FormItem>
<FormItem label="预估零件高度">
<InputNumber
placeholder="请输入..."
:min="0"
v-model="formValidate1[0].estimated_part_height"
style="width:240px"
:disabled="isview"
></InputNumber>
</FormItem>
</Row>
<Divider orientation="left" style="color:#249e91">基板信息</Divider>
<Row>
<FormItem label="基板名称">
<Select
style="width:240px;"
:disabled="isview"
v-model="formValidate1[1].name"
placeholder="请选择..."
>
<Option
v-for="(item,index) in jbnameList"
:value="item.value"
:label="item.lable"
:key="index"
></Option>
</Select>
<!-- <materialDic v-model="formValidate1[1].name" :dic="jbnameList" ref="jbnameList"></materialDic> -->
</FormItem>
<FormItem label="基板牌号">
<Select
style="width:240px;"
:disabled="isview"
v-model="formValidate1[1].pate_number"
placeholder="请选择..."
>
<Option
v-for="(item,index) in jbPateNumberList"
:value="item.value"
:label="item.lable"
:key="index"
></Option>
</Select>
<!-- <materialDic v-model="formValidate1[1].pate_number" :dic="jbPateNumberList" ref="jbPateNumberList"></materialDic> -->
</FormItem>
</Row>
<Row>
<FormItem label="基板规格">
<Select
style="width:240px;"
:disabled="isview"
v-model="formValidate1[1].spec"
placeholder="请选择..."
>
<Option
v-for="(item,index) in jbspecList"
:value="item.value"
:label="item.lable"
:key="index"
></Option>
</Select>
<!-- <materialDic v-model="formValidate1[1].spec" :dic="jbspecList" ref="jbspecList"></materialDic> -->
</FormItem>
<FormItem label="基板适用设备">
<Select
allow-create
@on-create="handleCreate1"
style="width:240px;"
v-model="formValidate1[1].use_equip"
placeholder="请选择..."
:disabled="isview"
>
<Option
v-for="(item,index) in EquipList"
:value="item.value"
:label="item.lable"
:key="index"
></Option>
</Select>
<!-- <materialDic v-model="formValidate1[1].use_equip" :dic="EquipList" ref="EquipList"></materialDic> -->
</FormItem>
</Row>
<Row>
<FormItem label="基板厚度下限">
<InputNumber
placeholder="请输入..."
:min="0"
v-model="formValidate1[1].lower_basal_plate"
style="width:240px"
:disabled="isview"
></InputNumber>
</FormItem>
<FormItem label="基板总量" prop="jbquantity">
<InputNumber
placeholder="请输入..."
:min="0"
v-model="formValidate1[1].quantity"
style="width:240px"
:disabled="isview"
></InputNumber>
</FormItem>
</Row>
<Divider orientation="left" style="color:#249e91">刮刀信息</Divider>
<Row>
<FormItem label="刮刀规格" prop="gdspec">
<Select
style="width:240px;"
:disabled="isview"
v-model="formValidate1[2].spec"
placeholder="请选择..."
>
<Option
v-for="(item,index) in gdspecList"
:value="item.value"
:label="item.lable"
:key="index"
></Option>
</Select>
<!-- <materialDic v-model="formValidate1[2].spec" :dic="gdspecList" ref="gdspec"></materialDic> -->
</FormItem>
<FormItem label="刮刀数量" prop="gdquantity">
<InputNumber
placeholder="请输入..."
:min="0"
v-model="formValidate1[2].quantity"
style="width:240px"
:disabled="isview"
></InputNumber>
</FormItem>
</Row> </Row>
</Form> </Form>
<!-- <div> <!-- <div>
...@@ -283,86 +49,160 @@ ...@@ -283,86 +49,160 @@
<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">
<template slot-scope="{ row,index }" slot="materialType">
<state
code="mes_xingchi_resource.material.materialReType"
type="text"
:value="row.materialType"
></state>
</template>
</Table>
<Modal
v-model="newModel"
title="新增物料项"
:mask-closable="false"
@on-ok="ok"
@on-cancel="cancel"
width="830px"
:footer-hide="isview"
>
<Form
ref="formprocessValidate"
:model="formprocessValidate"
:label-width="120"
inline
>
<Row>
<Col :span="12">
<FormItem :label="l('materialNumber')" prop="materialNumber">
<Input v-model="formprocessValidate.materialNumber"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('nameMaterial')" prop="nameMaterial">
<Input v-model="formprocessValidate.nameMaterial"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('quantity')" prop="quantity">
<InputNumber v-model="formprocessValidate.quantity"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('materialType')" prop="materialType">
<Dictionary
code="mes_xingchi_resource.material.materialReType"
v-model="formprocessValidate.materialType"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('brand')" prop="brand">
<Input v-model="formprocessValidate.brand"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('specifications')" prop="specifications">
<Input v-model="formprocessValidate.specifications"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('xhgg')" prop="xhgg">
<Input v-model="formprocessValidate.xhgg"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('texture')" prop="texture">
<Input v-model="formprocessValidate.texture"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('procurementStandards')" prop="procurementStandards">
<Input v-model="formprocessValidate.procurementStandards"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('qualityGrade')" prop="qualityGrade">
<Input v-model="formprocessValidate.qualityGrade"></Input>
</FormItem>
</Col>
</Row>
</Form>
</Modal>
</div> </div>
</template> </template>
<script> <script>
import service from '@/plugins/request' import service from "@/plugins/request";
import materialDic from '../components/materialDic' import materialDic from "../components/materialDic";
export default { export default {
name: 'orderMaterial', name: "orderMaterial",
components: { materialDic }, components: { materialDic },
data() { data() {
return { return {
order_comb_id: 0, order_comb_id: 0,
orderids: '', orderids: "",
productingPreparationPeople:'', productingPreparationPeople: "",
taskType: '', taskType: "",
Modeltitle: '料单', Modeltitle: "料单",
dataTop: [], dataTop: [],
isview: false, isview: false,
newModel:false,
columnTop: [ columnTop: [
{ {
title: '订单编号', title: "订单编号",
key: 'mesCode', key: "mesCode",
align: 'center' align: "center"
}, },
{ {
title: '产品名称', title: "产品名称",
key: 'productName', key: "productName",
align: 'center' align: "center"
}, },
{ {
title: '产品代号', title: "产品代号",
key: 'drawnNumber', key: "drawnNumber",
align: 'center' align: "center"
}, },
{ {
title: '数量', title: "数量",
key: 'quantity', key: "quantity",
align: 'center' align: "center"
}, },
{ {
title: '每板数量', title: "每板数量",
key: 'perboardnum', key: "perboardnum",
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
if (this.isview) { if (this.isview) {
return h('div', this.dataTop[params.index].perboardnum) return h("div", this.dataTop[params.index].perboardnum);
} else { } else {
return h('div', [ return h("div", [
h('InputNumber', { h("InputNumber", {
props: { props: {
value: this.dataTop[params.index].perboardnum, value: this.dataTop[params.index].perboardnum,
min: 1 min: 1
}, },
on: { on: {
'on-change': (event) => { "on-change": event => {
this.dataTop[params.index].perboardnum = event this.dataTop[params.index].perboardnum = event;
this.calcplatesnum() this.calcplatesnum();
} }
} }
}) })
]) ]);
} }
} }
} }
], ],
quotaperboardList: [], //每版定额
fileTemplateList: [], //文件模板
jbnameList: [], //基板名称
jbPateNumberList: [], //基板牌号
jbspecList: [], //基板规格
fmcategoriesList: [], //粉末种类
fmspceList: [], //粉末规格
fmpatenumberList: [], //粉末牌号
fmnameList: [], //粉末名称,
gdspecList: [], //刮刀规格,
EquipList: [],
ruleValidate: { ruleValidate: {
code: [{ required: true, message: '文件编号不能为空', trigger: 'blur' }] code: [{ required: true, message: "文件编号不能为空", trigger: "blur" }]
// name: [ // name: [
// { required: true, message: '文件名称不能为空', trigger: 'blur' } // { required: true, message: '文件名称不能为空', trigger: 'blur' }
...@@ -403,248 +243,273 @@ export default { ...@@ -403,248 +243,273 @@ export default {
formValidate: { formValidate: {
id: 0, id: 0,
code: '', code: "",
name: '', name: "",
platesnum: 0, platesnum: 0,
quota_per_board: 0, quota_per_board: 0,
file_template: '', file_template: "",
remarks: '', remarks: "",
extend: '', extend: "",
order_comb_id: 0, order_comb_id: 0,
orderids: '', orderids: "",
productingPreparationPeople:'', routingHeaderId: 0,
ordercodes: '', productingPreparationPeople: "",
ordercodes: "",
approvalStatus: 0 approvalStatus: 0
}, },
formValidate1: [ formValidate1: [],
formprocessValidate: {
routingHeaderId: 0,
routingDetailId: 0,
routingStepId: 0,
quantity: 0,
materialId: 0,
materialType: "",
materialNumber: "",
nameMaterial: "",
state: 0,
extend: "",
remark: "",
brand: "",
specifications: "",
xhgg: "",
texture: "",
procurementStandards: "",
qualityGrade: "",
id: 0
},
column1: [
{ title: "序号", type: "index", width: "70", align: "center" },
{
key: "materialNumber",
title: this.l("materialNumber"),
align: "left",
easy: true,
high: true
},
{
key: "nameMaterial",
title: this.l("nameMaterial"),
align: "left",
easy: true,
high: true
},
{
key: "quantity",
title: this.l("quantity"),
align: "left",
high: true
},
{
key: "materialType",
title: this.l("materialType"),
align: "left",
easy: true,
high: true
},
{ {
id: 0, key: "brand",
materialbillId: 0, title: this.l("brand"),
material_type: 1, align: "left",
name: '', easy: true,
pate_number: '', high: true
spec: '',
categories: '',
quantity: 0,
quantity_unit: '',
estimated_part_height: 0,
height_unit: '',
lower_basal_plate: 0,
plate_unit: '',
use_equip: '',
remarks: '',
extend: '',
actual_quantity: 0
}, },
{ {
id: 0, key: "specifications",
materialbillId: 0, title: this.l("specifications"),
material_type: 2, align: "left",
name: '', easy: true,
pate_number: '', high: true
spec: '',
categories: '',
quantity: 0,
quantity_unit: '',
estimated_part_height: 0,
height_unit: '',
lower_basal_plate: 0,
plate_unit: '',
use_equip: '',
remarks: '',
extend: '',
actual_quantity: 0
}, },
{ {
id: 0, key: "xhgg",
materialbillId: 0, title: this.l("xhgg"),
material_type: 3, align: "left",
name: '', easy: true,
pate_number: '', high: true
spec: 'sssss', },
categories: '', {
quantity: 0, key: "texture",
quantity_unit: '', title: this.l("texture"),
estimated_part_height: 0, align: "left",
height_unit: '', easy: true,
lower_basal_plate: 0, high: true
plate_unit: '', },
use_equip: '', {
remarks: '', key: "procurementStandards",
extend: '', title: this.l("procurementStandards"),
actual_quantity: 0 align: "left"
},
{
key: "qualityGrade",
title: this.l("qualityGrade"),
align: "left",
easy: true,
high: true
},
{
title: "操作",
key: "id",
align: "center",
render: (h, params) => {
let id = params.row.id;
if (!this.isview) {
return h(
"div",
{
class: "icon_box"
},
[
h("span", {
class: "edit_icon",
attrs: { title: "编辑" },
on: {
click: () => {
this.editFun(params);
}
}
}),
h("span", {
class: "del_icon",
attrs: { title: "删除" },
on: {
click: () => {
this.deleteFun(params);
}
}
})
]
);
} else {
return h(
"div",
{
class: "icon_box"
},
[
h("op", {
class: "view ",
attrs: { icon: "ios-eye", title: "查看", type: "icon" },
on: {
click: () => {
this.editFun(params);
}
}
})
]
);
}
}
} }
] ]
} };
}, },
mounted() { mounted() {},
;(this.quotaperboardList = [ created: function() {},
{ name: '10', value: 10 },
{ name: '20', value: 20 },
{ name: '30', value: 30 }
]), //每版定额
(this.fileTemplateList = [
{ name: '文件模板1', value: '文件模板1' },
{ name: '文件模板2', value: '文件模板2' }
]) //文件模板
},
created: function() {
this.getmaterialplacodedic()
this.GetMaterialScraperDic()
this.GetMaterialPowderDic()
},
methods: { methods: {
handleCreate1(val) { handleCreate1(val) {
this.EquipList.push({ this.EquipList.push({
value: val, value: val,
label: val label: val
}) });
}, },
l(key) {
key = "RoutingSupporting" + "." + key;
return this.$t(key)
}
,
loaddata() { loaddata() {
if (this.formValidate.id != 0) { if (this.formValidate.id != 0) {
var url = var url =
`${designUrl}/ordermaterial/getbyid?id=` + this.formValidate.id `${designUrl}/ordersupport/getbyid?id=` + this.formValidate.id;
service.get(`${url}`).then((response) => { service.get(`${url}`).then(response => {
this.formValidate = response.result.orderMaterial this.formValidate = response.result.orderMaterial;
if (this.formValidate.approvalStatus == 1||this.formValidate.approvalStatus == 2||this.formValidate.approvalStatus == 3) { if (
this.isview = true this.formValidate.approvalStatus == 1 ||
}else{ this.formValidate.approvalStatus == 2 ||
this.formValidate.approvalStatus == 3
this.isview = false ) {
this.isview = true;
} else {
this.isview = false;
} }
this.formValidate1 = response.result.orderMaterialList this.formValidate1 = response.result.orderMaterialList;
}) });
} else { } else {
this.cleardata() this.cleardata();
var url = `${designUrl}/ordermaterial/getordermateriacode`
service.get(`${url}`).then((response) => { var url =
this.formValidate.code = response.result `${designUrl}/ordersupport/getbyheaderid?headerID=` +
}) this.formValidate.routingHeaderId;
this.isview = false service.get(`${url}`).then(response => {
this.calcplatesnum(); this.formValidate = response.result.orderMaterial;
var url = `${designUrl}/ordersupport/getordermateriacode`;
service.get(`${url}`).then(response => {
this.formValidate.code = response.result;
});
this.isview = false;
this.formValidate1 = response.result.orderMaterialList;
});
// this.calcplatesnum();
} }
}, },
calcplatesnum() { calcplatesnum() {
//计算板数 //计算板数
let boardnum = 1 let boardnum = 1;
if (this.dataTop != null && this.dataTop.length > 0) { if (this.dataTop != null && this.dataTop.length > 0) {
for (let i = 0; i < this.dataTop.length; i++) { for (let i = 0; i < this.dataTop.length; i++) {
let remainder = this.dataTop[i].quantity % this.dataTop[i].perboardnum //余数 let remainder =
let count = this.dataTop[i].quantity / this.dataTop[i].perboardnum //得数 this.dataTop[i].quantity % this.dataTop[i].perboardnum; //余数
let boardnum1 = remainder > 0 ? parseInt(count) + 1 : parseInt(count) let count = this.dataTop[i].quantity / this.dataTop[i].perboardnum; //得数
let boardnum1 = remainder > 0 ? parseInt(count) + 1 : parseInt(count);
if (boardnum1 > boardnum) { if (boardnum1 > boardnum) {
boardnum = boardnum1 boardnum = boardnum1;
} }
} }
} }
this.formValidate.platesnum=boardnum; this.formValidate.platesnum = boardnum;
},
getmaterialplacodedic() {
//基板
let url = `${designUrl}/ordermateriallist/getmaterialplacodedic`,
that = this
service.get(`${url}`).then((res) => {
let selectdata = res.result
selectdata.forEach((item) => {
if (item.dictype == 1) {
this.jbnameList = item.dics
}
if (item.dictype == 2) {
this.jbspecList = item.dics
}
if (item.dictype == 3) {
this.jbPateNumberList = item.dics
}
if (item.dictype == 4) {
this.EquipList = item.dics
}
})
})
},
GetMaterialPowderDic() {
//粉末
let url = `${designUrl}/ordermateriallist/getmaterialpowderdic`,
that = this
service.get(`${url}`).then((res) => {
let selectdata = res.result
selectdata.forEach((item) => {
if (item.dictype == 1) {
this.fmnameList = item.dics
}
if (item.dictype == 3) {
this.fmpatenumberList = item.dics
}
if (item.dictype == 2) {
this.fmspceList = item.dics
}
// if (item.dictype == 4) {
// this.fmcategoriesList = item.dics
// }
})
})
}, },
GetMaterialScraperDic() {
//刮刀
let url = `${designUrl}/ordermateriallist/getmaterialscraperdic`,
that = this
service.get(`${url}`).then((res) => {
let selectdata = res.result
selectdata.forEach((item) => {
if (item.dictype == 1) {
this.gdspecList = item.dics
}
})
})
},
SaveLd() { SaveLd() {
let isvalidate = false let isvalidate = false;
this.$refs['formValidate'].validate((valid) => { this.$refs["formValidate"].validate(valid => {
if (valid) { if (valid) {
isvalidate = valid isvalidate = valid;
} else { } else {
} }
}) });
if (!isvalidate) { if (!isvalidate) {
return return;
} }
var url = `${designUrl}/ordermaterial/createorupdate` var url = `${designUrl}/ordersupport/createorupdate`;
this.formValidate.order_comb_id = this.order_comb_id this.formValidate.order_comb_id = this.order_comb_id;
this.formValidate.orderids = this.orderids this.formValidate.orderids = this.orderids;
this.formValidate.productingPreparationPeople=this.productingPreparationPeople; this.formValidate.productingPreparationPeople = this.productingPreparationPeople;
var pernums = new Array() var pernums = new Array();
for (let i = 0; i < this.dataTop.length; i++) { for (let i = 0; i < this.dataTop.length; i++) {
let obj = this.dataTop[i] let obj = this.dataTop[i];
pernums.push(obj.perboardnum) pernums.push(obj.perboardnum);
} }
this.formValidate.perboardnums = pernums.toString(',') this.formValidate.perboardnums = pernums.toString(",");
var mesCodes = new Array() var mesCodes = new Array();
for (let i = 0; i < this.dataTop.length; i++) { for (let i = 0; i < this.dataTop.length; i++) {
let obj = this.dataTop[i] let obj = this.dataTop[i];
mesCodes.push(obj.mesCode) mesCodes.push(obj.mesCode);
} }
this.formValidate.ordercodes = mesCodes.toString(',') this.formValidate.ordercodes = mesCodes.toString(",");
service service
.post( .post(
...@@ -653,104 +518,120 @@ this.formValidate.productingPreparationPeople=this.productingPreparationPeople; ...@@ -653,104 +518,120 @@ this.formValidate.productingPreparationPeople=this.productingPreparationPeople;
orderMaterialList: this.formValidate1 orderMaterialList: this.formValidate1
} }
) )
.then((response) => { .then(response => {
let itemId = response.result.orderMaterial.id let itemId = response.result.orderMaterial.id;
// let idIteme = this.$parent.$parent.dataListRetrunNew.idList // let idIteme = this.$parent.$parent.dataListRetrunNew.idList
// if(idIteme == []){ // if(idIteme == []){
// idIteme.push(itemId) // idIteme.push(itemId)
// }else{ // }else{
// } // }
this.$parent.$parent.dataListRetrunNew.idList.push(itemId) this.$parent.$parent.dataListRetrunNew.idList.push(itemId);
if (response.success) { if (response.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.cleardata() this.cleardata();
this.$parent.$parent.loaddata(this.$parent.$parent.orderSearchForm) this.$parent.$parent.loaddata(this.$parent.$parent.orderSearchForm);
this.$parent.$parent.modalliao = false this.$parent.$parent.modalliao = false;
} }
}) })
.catch((error) => { .catch(error => {
this.$Message.success('保存失败') this.$Message.success("保存失败");
});
},
ok() {
let isvalidate = false;
this.$refs["formprocessValidate"].validate(valid => {
if (valid) {
isvalidate = valid;
} else {
}
});
if (!isvalidate) {
setTimeout(() => {
this.newModel = false;
this.$nextTick(() => {
this.newModel = true;
});
}, 5);
return;
}
var url = `${designUrl}/ordermateriallist/createorupdate`;
service
.post(`${url}`, this.formprocessValidate)
.then(response => {
if (response.success) {
this.$Message.success("保存成功");
this.newModel = false;
this.cleardata();
this.loaddata();
}
}) })
.catch(error => {
this.$Message.error("保存失败");
});
},
editFun(params) {
this.formprocessValidate.id = params.row.id;
this.formprocessValidate.quantity = params.row.quantity;
this.formprocessValidate.materialId = params.row.materialId;
this.formprocessValidate.materialType = params.row.materialType;
this.formprocessValidate.materialNumber = params.row.materialNumber;
this.formprocessValidate.nameMaterial = params.row.nameMaterial;
this.formprocessValidate.brand = params.row.brand;
this.formprocessValidate.specifications = params.row.specifications;
this.formprocessValidate.xhgg = params.row.xhgg;
this.formprocessValidate.texture = params.row.texture;
this.formprocessValidate.procurementStandards =
params.row.procurementStandards;
this.formprocessValidate.qualityGrade = params.row.qualityGrade;
this.newModel = true;
},
deleteFun(params) {
this.$Modal.confirm({
title: "提示",
content: "确定要删除当前行?",
onOk: () => {
var url = `${designUrl}/ordermateriallist/delete?id=` + params.row.id;
service
.delete(`${url}`)
.then(response => {
if (response.success) {
this.$Message.success("删除成功");
this.loaddata();
} else {
this.$Message.error("删除失败");
}
})
.catch(error => {
this.$Message.error("删除失败");
});
},
onCancel: () => {}
});
}, },
saveCancelModel() { saveCancelModel() {
this.modalliao = false this.modalliao = false;
}, },
cancel() { cancel() {
this.cleardata() this.cleardata();
}, },
cleardata() { cleardata() {
let obj = { this.formValidate.id = 0;
id: 0, this.formValidate.code = "";
code: '', this.formValidate.name = "";
name: '', this.formValidate.platesnum = 0;
platesnum: 0, this.formValidate.quota_per_board = 0;
quota_per_board: 0, this.formValidate.file_template = "";
file_template: ''
} this.formValidate1 = null;
this.formValidate = obj
let obj1 = {
id: 0,
materialbillId: 0,
material_type: 1,
name: '',
pate_number: '',
spec: '',
categories: '',
quantity: 0,
quantity_unit: '',
estimated_part_height: 0,
height_unit: '',
lower_basal_plate: 0,
plate_unit: '',
use_equip: '',
remarks: '',
extend: '',
actual_quantity: 0
}
this.formValidate1[0] = obj1
let obj2 = {
id: 0,
materialbillId: 0,
material_type: 2,
name: '',
pate_number: '',
spec: '',
categories: '',
quantity: 0,
quantity_unit: '',
estimated_part_height: 0,
height_unit: '',
lower_basal_plate: 0,
plate_unit: '',
use_equip: '',
remarks: '',
extend: '',
actual_quantity: 0
}
this.formValidate1[1] = obj2
let obj3 = {
id: 0,
materialbillId: 0,
material_type: 3,
name: '',
pate_number: '',
spec: '',
categories: '',
quantity: 0,
quantity_unit: '',
estimated_part_height: 0,
height_unit: '',
lower_basal_plate: 0,
plate_unit: '',
use_equip: '',
remarks: '',
extend: '',
actual_quantity: 0
}
this.formValidate1[2] = obj3
} }
} }
} };
</script> </script>
\ No newline at end of file
...@@ -526,7 +526,7 @@ export default { ...@@ -526,7 +526,7 @@ export default {
{ {
title: '主工艺', title: '工艺规程',
key: 'mainRoutingID', key: 'mainRoutingID',
width: 120, width: 120,
render: (h, params) => { render: (h, params) => {
...@@ -610,7 +610,7 @@ export default { ...@@ -610,7 +610,7 @@ export default {
key: 'materialbillID', key: 'materialbillID',
width: 120, width: 120,
render: (h, params) => { render: (h, params) => {
if (this.tabstatus == '1') { if (params.row.mainRoutingID == 0) {
h('div', '') h('div', '')
} else { } else {
let id = params.row.id let id = params.row.id
...@@ -1660,6 +1660,8 @@ export default { ...@@ -1660,6 +1660,8 @@ export default {
ld.orderids = orderids.toString(',') ld.orderids = orderids.toString(',')
ld.formValidate.routingHeaderId = params.row.mainRoutingID
ld.formValidate.id = params.row.materialbillID ld.formValidate.id = params.row.materialbillID
ld.loaddata() ld.loaddata()
......
...@@ -540,8 +540,7 @@ export default { ...@@ -540,8 +540,7 @@ export default {
var url = var url =
`${designUrl}/routingheader/GetListSmall?approvalstatus=1&product_id=` + `${designUrl}/routingheader/GetListSmall?approvalstatus=1&product_id=` +
productid + productid +
"&routingType=" + "&routingType=0";
this.formValidate.routingType;
service.get(`${url}`).then(response => { service.get(`${url}`).then(response => {
this.RoutingList = response.result; this.RoutingList = response.result;
}); });
......
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