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>
<Col span="12">
<FormItem label="文档编号" prop="code"> <FormItem label="文档编号" prop="code">
<Input <Input
size="large" size="large"
v-model.trim="formValidate.code" v-model.trim="formValidate.code"
placeholder="请输入..." placeholder="请输入..."
style="width:240px" style="width:240px"
:disabled="isview" :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 { } else {
var url = `${designUrl}/ordermateriallist/createorupdate`; 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 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 = "");
} }
} }
}; };
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
</div> </div>
<!-- 右侧内容 --> <!-- 右侧内容 -->
<div class="content-right"> <div class="content-right">
<div class="title_box"> <div class="title_box">
<div class="table_title"> <div class="table_title">
<div style="width:100px; float:left"> <div style="width:100px; float:left">
...@@ -30,7 +29,7 @@ ...@@ -30,7 +29,7 @@
<Input <Input
search search
enter-button enter-button
class=" mr10 fl" class="mr10 fl"
style="width:240px" style="width:240px"
v-model="searchIterms" v-model="searchIterms"
placeholder="请输入订单编号" placeholder="请输入订单编号"
...@@ -40,7 +39,6 @@ ...@@ -40,7 +39,6 @@
<Button type="primary" class="title_btn" @click="searchModel">高级查询</Button> <Button type="primary" class="title_btn" @click="searchModel">高级查询</Button>
</div> </div>
</div> </div>
</div> </div>
<!-- 高级搜索弹框 draggable --> <!-- 高级搜索弹框 draggable -->
...@@ -294,7 +292,7 @@ ...@@ -294,7 +292,7 @@
<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>
<!-- <Button type="primary" size="large" @click="nextStep">送审</Button> footer-hide--> <!-- <Button type="primary" size="large" @click="nextStep">送审</Button> footer-hide-->
<Checkbox v-model="checked" label="送审">送审</Checkbox> <!-- <Checkbox v-model="checked" label="送审">送审</Checkbox> -->
</div> </div>
<div v-else slot="footer" v-model="greateArtmodel"> <div v-else slot="footer" v-model="greateArtmodel">
<Button type="text" size="large" @click="saveCancelModel">取消</Button> <Button type="text" size="large" @click="saveCancelModel">取消</Button>
...@@ -316,7 +314,6 @@ ...@@ -316,7 +314,6 @@
</div> </div>
</Modal> </Modal>
<Modal <Modal
v-model="documentShow" v-model="documentShow"
title="文档送审" title="文档送审"
...@@ -345,19 +342,19 @@ ...@@ -345,19 +342,19 @@
</template> </template>
<script> <script>
import DrawerSet from './components/drawerSet.vue' //抽屉列表 import DrawerSet from "./components/drawerSet.vue"; //抽屉列表
import TreeType from './components/treeType.vue' //左侧树列表 import TreeType from "./components/treeType.vue"; //左侧树列表
import orderMaterial from './components/orderMaterial.vue' //料单 import orderMaterial from "./components/orderMaterial.vue"; //料单
import processMain from './processMain.vue' import processMain from "./processMain.vue";
import processNew from '../Process/processNew.vue' import processNew from "../Process/processNew.vue";
import service from '@/plugins/request' import service from "@/plugins/request";
import OrderSendReview from './components/orderSendReview' //送审页面 import OrderSendReview from "./components/orderSendReview"; //送审页面
import processview from '../Process/processview.vue' import processview from "../Process/processview.vue";
import sendAudit from '../Process/sendAudit.vue' import sendAudit from "../Process/sendAudit.vue";
import QS from 'querystring' import QS from "querystring";
export default { export default {
components: { components: {
DrawerSet, DrawerSet,
...@@ -368,7 +365,6 @@ export default { ...@@ -368,7 +365,6 @@ export default {
OrderSendReview, OrderSendReview,
processview, processview,
sendAudit sendAudit
}, },
data() { data() {
return { return {
...@@ -377,19 +373,19 @@ export default { ...@@ -377,19 +373,19 @@ export default {
ismview: false, ismview: false,
issendAudit: false, issendAudit: false,
createtype: 1, createtype: 1,
treeHeight: '', treeHeight: "",
treeInputSearch: '', treeInputSearch: "",
tableHeight: '', tableHeight: "",
datatotal: 0, datatotal: 0,
pageSize: 10, pageSize: 10,
page: 1, //当前页 整形 选填 默认1 page: 1, //当前页 整形 选填 默认1
searchIterms: '', //搜索内容 searchIterms: "", //搜索内容
showModel: false, //高级搜索弹框 showModel: false, //高级搜索弹框
treeData: [], treeData: [],
list: [], list: [],
data2: [], data2: [],
tabstatus: '1', //暂存tab状态()主工艺||专业工艺 tabstatus: "1", //暂存tab状态()主工艺||专业工艺
gymodaltitle: '创建工艺', gymodaltitle: "创建工艺",
selectdata: [], selectdata: [],
value1: false, value1: false,
drawerShow: false, drawerShow: false,
...@@ -402,177 +398,175 @@ export default { ...@@ -402,177 +398,175 @@ export default {
modalliao: false, modalliao: false,
ProductingPreparationPeople: 0, ProductingPreparationPeople: 0,
checked: true, //送审选择框 checked: false, //送审选择框
modalInfo: false, //校验送审弹框 modalInfo: false, //校验送审弹框
formExamine: {}, formExamine: {},
rules: { rules: {
approveUser: [{ required: true, message: '必填', trigger: 'blur' }] approveUser: [{ required: true, message: "必填", trigger: "blur" }]
}, },
formdata: { data01: [], data02: [] }, //暂存送审料单信息 formdata: { data01: [], data02: [] }, //暂存送审料单信息
dataListRetrunNew: { dataListRetrunNew: {
schemaId: '0c7f3e21-0cf1-4fb0-8986-95c6fbda406e', //料单送审的schemaId schemaId: "0c7f3e21-0cf1-4fb0-8986-95c6fbda406e", //料单送审的schemaId
idList: [], //料单id List idList: [], //料单id List
code: '', //料单编号List code: "", //料单编号List
operatorIdList: [] //操作员id operatorIdList: [] //操作员id
}, //确定保存后返回数据 }, //确定保存后返回数据
orderSearchForm: { orderSearchForm: {
productId: null, //产品id productId: null, //产品id
productName: '', //产品名称 productName: "", //产品名称
taskType: '', //任务类型 taskType: "", //任务类型
stage: '', //阶段 stage: "", //阶段
materialId: '', //材料 materialId: "", //材料
quantity: 0, //数量 quantity: 0, //数量
guestName: '', //甲方客户 guestName: "", //甲方客户
printSupply: '', //3D打印承制单位 printSupply: "", //3D打印承制单位
functionaryOffice: '', //厂内责任机关 functionaryOffice: "", //厂内责任机关
mainDepartmentId: '', //厂内责任主体部门ID mainDepartmentId: "", //厂内责任主体部门ID
taskRequire: '', //任务接点要求 taskRequire: "", //任务接点要求
putintDocmentCode: '', //甲方投产输入文件编号 putintDocmentCode: "", //甲方投产输入文件编号
technologyDocmentCode: '', //甲方技术输入文件编号 technologyDocmentCode: "", //甲方技术输入文件编号
outerDrawnNumber: '', //外部图号/模型号 outerDrawnNumber: "", //外部图号/模型号
modelVersion: '', //模型版本 modelVersion: "", //模型版本
taskCode: '', //甲方任务号 taskCode: "", //甲方任务号
designer: '', //甲方设计人员 designer: "", //甲方设计人员
officeFunctionary: '', //厂内机关负责人 officeFunctionary: "", //厂内机关负责人
mainRoutingPeople: '', //厂内主工艺人员 mainRoutingPeople: "", //厂内主工艺人员
routing_Method: '', //工艺方法 routing_Method: "", //工艺方法
outer_Envelope_Size: '', //包装尺寸 outer_Envelope_Size: "", //包装尺寸
demandStartDate: '', //开始时间 demandStartDate: "", //开始时间
demandFinishDate: '', //完成时间 demandFinishDate: "", //完成时间
remark: '', //备注 remark: "", //备注
MaxResultCount: 10, MaxResultCount: 10,
SkipCount: 0, SkipCount: 0,
RoutingSetStatus: '' RoutingSetStatus: ""
}, },
formValidate: { formValidate: {
id: '', id: "",
documentTemplate: '', documentTemplate: "",
documentName: '', documentName: "",
documentNumber: '', documentNumber: "",
plateNum: 0, plateNum: 0,
plateQuota: '', plateQuota: "",
powderName: '', powderName: "",
powderBrand: '', powderBrand: "",
powderSpecifi: '', powderSpecifi: "",
powderSort: '', powderSort: "",
forecastPowderTotal: '', forecastPowderTotal: "",
forecastPartsTHeight: '', forecastPartsTHeight: "",
basePlateName: '', basePlateName: "",
basePlateBrand: '', basePlateBrand: "",
basePlateSpecifi: '', basePlateSpecifi: "",
basePlateApplicableEQ: '', basePlateApplicableEQ: "",
basePlateThicknessFloor: '', basePlateThicknessFloor: "",
basePlateTotal: 0, basePlateTotal: 0,
scraperSpecifi: '', scraperSpecifi: "",
scraperTotal: 0, scraperTotal: 0,
remark: '' remark: ""
}, },
openModel: { openModel: {
id: 0, id: 0,
name: '', name: "",
upLevel: 0, upLevel: 0,
upLevelDept: '', upLevelDept: "",
organizType: 0, organizType: 0,
organizName: '' organizName: ""
}, },
newColumn: [], newColumn: [],
value: '', value: "",
column: [], column: [],
historycolumn: [ historycolumn: [
{ type: 'selection', width: 70, align: 'center', fixed: 'left' }, { type: "selection", width: 70, align: "center", fixed: "left" },
{ {
title: '序号', title: "序号",
key: 'id', key: "id",
width: 80, width: 80,
align: 'center', align: "center",
fixed: 'left' fixed: "left"
}, },
{ {
title: '订单编号', title: "订单编号",
key: 'mesCode', key: "mesCode",
width: 180, width: 180,
align: 'center', align: "center",
fixed: 'left' fixed: "left"
}, },
{ {
title: '任务类型', title: "任务类型",
key: 'taskTypeName', key: "taskTypeName",
width: 120, width: 120,
align: 'center', align: "center",
fixed: 'left', fixed: "left",
render: (h, params) => { render: (h, params) => {
return h('state', { return h("state", {
props: { props: {
code: 'plan.order.taskType', code: "plan.order.taskType",
type: 'text', type: "text",
value: params.row.taskType + '' value: params.row.taskType + ""
} }
}) });
} }
}, },
{ {
title: '产品名称', title: "产品名称",
key: 'productName', key: "productName",
width: 120, width: 120,
align: 'center', align: "center",
fixed: 'left' fixed: "left"
}, },
{ title: '图号', key: 'drawnNumber', width: 120 }, { title: "图号", key: "drawnNumber", width: 120 },
{ title: '数量', key: 'quantity', width: 80, align: 'center' },
{ title: "数量", key: "quantity", width: 80, align: "center" },
{ {
title: '工艺规程', title: "工艺规程",
key: 'mainRoutingID', key: "mainRoutingID",
width: 120, width: 120,
render: (h, params) => { render: (h, params) => {
let id = params.row.id let id = params.row.id;
let statusarr = this.$store.getters.dictionaryByKey( let statusarr = this.$store.getters.dictionaryByKey(
'process.RoutingStatus' "process.RoutingStatus"
) );
let editColor = '' let editColor = "";
let content = '' let content = "";
let gh let gh;
if (params.row.mainRoutingID == 0) { if (params.row.mainRoutingID == 0) {
gh = statusarr.filter(function(obj) { gh = statusarr.filter(function(obj) {
return obj.code == -1 return obj.code == -1;
}) });
} else { } else {
gh = statusarr.filter(function(obj) { gh = statusarr.filter(function(obj) {
return obj.code == params.row.mainRoutingStatus return obj.code == params.row.mainRoutingStatus;
}) });
if (gh == null) { if (gh == null) {
gh = statusarr.filter(function(obj) { gh = statusarr.filter(function(obj) {
return obj.code == -1 return obj.code == -1;
}) });
} }
} }
if (gh != null && gh.length > 0) { if (gh != null && gh.length > 0) {
content = gh[0].name content = gh[0].name;
editColor = gh[0].color editColor = gh[0].color;
} }
return h('div', [ return h("div", [
h( h(
'span', "span",
{ {
props: { props: {
type: 'text', type: "text",
ghost: true ghost: true
}, },
style: { style: {
color: editColor, color: editColor,
cursor: 'pointer' cursor: "pointer"
}, },
on: { on: {
click: (e) => { click: e => {
e.stopPropagation() e.stopPropagation();
if (params.row.mainRoutingID != 0) { if (params.row.mainRoutingID != 0) {
if ( if (
params.row.mainRoutingStatus == 4 || params.row.mainRoutingStatus == 4 ||
...@@ -584,88 +578,86 @@ export default { ...@@ -584,88 +578,86 @@ export default {
params, params,
params.row.mainRoutingID, params.row.mainRoutingID,
1 1
) );
} else { } else {
this.viewProcessRow( this.viewProcessRow(
params, params,
params.row.mainRoutingID, params.row.mainRoutingID,
1 1
) );
} }
} else { } else {
this.addProcessRow(params, 1) this.addProcessRow(params, 1);
} }
} }
} }
}, },
content content
) )
]) ]);
} }
}, },
{ {
title: '料单', title: "料单",
key: 'materialbillID', key: "materialbillID",
width: 120, width: 120,
render: (h, params) => { render: (h, params) => {
if (params.row.mainRoutingID == 0) { if (params.row.mainRoutingID == 0) {
h('div', '') h("div", "");
} else { } else {
let id = params.row.id let id = params.row.id;
let editColor1 = '' let editColor1 = "";
let content1 = '' let content1 = "";
let gh let gh;
let statusarr = this.$store.getters.dictionaryByKey( let statusarr = this.$store.getters.dictionaryByKey(
'process.RoutingStatus' "process.RoutingStatus"
) );
if (params.row.materialbillID == 0) { if (params.row.materialbillID == 0) {
gh = statusarr.filter(function(obj) { gh = statusarr.filter(function(obj) {
return obj.code == -1 return obj.code == -1;
}) });
} else { } else {
gh = statusarr.filter(function(obj) { gh = statusarr.filter(function(obj) {
return obj.code == params.row.materialbillStatus return obj.code == params.row.materialbillStatus;
}) });
if (gh == null) { if (gh == null) {
gh = statusarr.filter(function(obj) { gh = statusarr.filter(function(obj) {
return obj.code == -1 return obj.code == -1;
}) });
} }
} }
if (gh != null && gh.length > 0) { if (gh != null && gh.length > 0) {
content1 = gh[0].name content1 = gh[0].name;
editColor1 = gh[0].color editColor1 = gh[0].color;
} }
return h('div', [ return h("div", [
h( h(
'span', "span",
{ {
props: { props: {
type: 'text', type: "text",
ghost: true ghost: true
}, },
style: { style: {
color: editColor1, color: editColor1,
cursor: 'pointer' cursor: "pointer"
}, },
on: { on: {
click: (e) => { click: e => {
e.stopPropagation() e.stopPropagation();
this.savematerialbill(params) this.savematerialbill(params);
} }
} }
}, },
content1 content1
) )
]) ]);
} }
} }
} }
], ],
data1: [], data1: [],
...@@ -673,114 +665,113 @@ export default { ...@@ -673,114 +665,113 @@ export default {
orderselected: null, orderselected: null,
addpdefm: null, addpdefm: null,
detailInfo: {} //送审所需信息 detailInfo: {} //送审所需信息
} };
}, },
created() { created() {
this.treeHeight = window.innerHeight - 140 this.treeHeight = window.innerHeight - 140;
this.tableHeight = window.innerHeight - 230 this.tableHeight = window.innerHeight - 230;
this.newColumn = this.historycolumn this.newColumn = this.historycolumn;
this.column = this.newColumn this.column = this.newColumn;
this.loaddata('') this.loaddata("");
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
mounted() { mounted() {
this.initTree() this.initTree();
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
window.screenHeight = window.innerHeight window.screenHeight = window.innerHeight;
this.treeHeight = window.screenHeight - 140 this.treeHeight = window.screenHeight - 140;
this.tableHeight = window.screenHeight - 230 this.tableHeight = window.screenHeight - 230;
})() })();
} };
}, },
computed: { computed: {
searchList() { searchList() {
let nodeList = this.treeData let nodeList = this.treeData;
var text = this.treeInputSearch var text = this.treeInputSearch;
var newNodeList = [] var newNodeList = [];
function searchTree(nodeLists, value) { function searchTree(nodeLists, value) {
for (let i = 0; i < nodeLists.length; i++) { for (let i = 0; i < nodeLists.length; i++) {
if (nodeLists[i].title.indexOf(value) != -1) { if (nodeLists[i].title.indexOf(value) != -1) {
newNodeList.push(nodeLists[i]) newNodeList.push(nodeLists[i]);
} else if (nodeLists[i].children.length > 0) { } else if (nodeLists[i].children.length > 0) {
searchTree(nodeLists[i].children, value) searchTree(nodeLists[i].children, value);
} }
} }
} }
if (text != '') { if (text != "") {
searchTree(nodeList, text) searchTree(nodeList, text);
} else { } else {
return nodeList return nodeList;
} }
return newNodeList return newNodeList;
} }
}, },
methods: { methods: {
// tab切换 // tab切换
tabChange(name) { tabChange(name) {
this.tabstatus = name this.tabstatus = name;
this.page = 1 this.page = 1;
this.orderSearchForm.SkipCount = 0 this.orderSearchForm.SkipCount = 0;
this.newColumn = this.historycolumn this.newColumn = this.historycolumn;
this.column = this.newColumn this.column = this.newColumn;
this.loaddata(this.orderSearchForm) this.loaddata(this.orderSearchForm);
}, },
updateColumn(checkShowColumn) { updateColumn(checkShowColumn) {
this.newColumn = checkShowColumn this.newColumn = checkShowColumn;
}, },
//高级搜索 //高级搜索
searchModel() { searchModel() {
this.showModel = true this.showModel = true;
}, },
close() { close() {
this.showModel = false this.showModel = false;
}, },
//过滤车间 //过滤车间
changeWorkShop() { changeWorkShop() {
this.orderSearchForm.SkipCount = 0 this.orderSearchForm.SkipCount = 0;
this.loaddata({}) this.loaddata({});
}, },
search() search() {
{ this.easySearch(this.orderSearchForm);
this.easySearch(this.orderSearchForm)
}, },
//搜索查询 //搜索查询
easySearch(params) { easySearch(params) {
this.page = 1 this.page = 1;
this.orderSearchForm.SkipCount = 0 this.orderSearchForm.SkipCount = 0;
this.loaddata(params) this.loaddata(params);
}, },
complexSearch(params) { complexSearch(params) {
this.page = 1 this.page = 1;
this.orderSearchForm.SkipCount = 0 this.orderSearchForm.SkipCount = 0;
this.loaddata(params) this.loaddata(params);
}, },
// 删除 // 删除
deleted() {}, deleted() {},
// 分页 // 分页
pageChange(num) { pageChange(num) {
//console.log(num); //console.log(num);
this.page = num this.page = num;
this.orderSearchForm.SkipCount = this.orderSearchForm.SkipCount =
(num - 1) * this.orderSearchForm.MaxResultCount (num - 1) * this.orderSearchForm.MaxResultCount;
this.loaddata(this.orderSearchForm) this.loaddata(this.orderSearchForm);
}, },
pageSizeChange(limit) { pageSizeChange(limit) {
//console.log(limit) //console.log(limit)
this.orderSearchForm.SkipCount = 0 this.orderSearchForm.SkipCount = 0;
this.orderSearchForm.MaxResultCount = limit this.orderSearchForm.MaxResultCount = limit;
this.loaddata(this.orderSearchForm) this.loaddata(this.orderSearchForm);
}, },
loaddata(params) { loaddata(params) {
var url = '' var url = "";
// if(params==1||params==2){ // if(params==1||params==2){
// url = // url =
// `${PlanUrl}/mesorder/getpagedmesordersforpdefm?ProcessUserType=` + params // `${PlanUrl}/mesorder/getpagedmesordersforpdefm?ProcessUserType=` + params
...@@ -802,51 +793,51 @@ export default { ...@@ -802,51 +793,51 @@ export default {
modelVersion: params.modelVersion, //模型版本 modelVersion: params.modelVersion, //模型版本
taskCode: params.taskCode, //甲方任务号 taskCode: params.taskCode, //甲方任务号
status: params.status, //订单状态 status: params.status, //订单状态
simpleSearch: typeof params == 'string' ? params : params.simpleSearch, //快速搜索 simpleSearch: typeof params == "string" ? params : params.simpleSearch, //快速搜索
SkipCount: this.orderSearchForm.SkipCount, SkipCount: this.orderSearchForm.SkipCount,
MaxResultCount: this.orderSearchForm.MaxResultCount, MaxResultCount: this.orderSearchForm.MaxResultCount,
ProcessUserType: this.tabstatus, ProcessUserType: this.tabstatus,
ProductingPreparation: this.ProductingPreparationPeople, ProductingPreparation: this.ProductingPreparationPeople,
RoutingSetStatus: this.orderSearchForm.RoutingSetStatus RoutingSetStatus: this.orderSearchForm.RoutingSetStatus
} };
url = url =
`${PlanUrl}/mesorder/getpagedmesordersforpdefm?` + `${PlanUrl}/mesorder/getpagedmesordersforpdefm?` +
QS.stringify(this.orderSearchForm) QS.stringify(this.orderSearchForm);
// } // }
service.get(`${url}`).then((response) => { service.get(`${url}`).then(response => {
// console.log(response) // console.log(response)
this.datatotal = response.result.totalCount this.datatotal = response.result.totalCount;
this.data1 = response.result.items this.data1 = response.result.items;
let count = 1 let count = 1;
for (let i = 0; i < this.data1.length; i++) { for (let i = 0; i < this.data1.length; i++) {
let order = this.data1[i] let order = this.data1[i];
this.data1[i].orderrowspan = 1 this.data1[i].orderrowspan = 1;
if (i == this.data1.length - 1) { if (i == this.data1.length - 1) {
break break;
} }
///统计合并订单 ///统计合并订单
if ( if (
order.specialtyOrderCombID != 0 && order.specialtyOrderCombID != 0 &&
order.specialtyOrderCombID == this.data1[i + 1].specialtyOrderCombID order.specialtyOrderCombID == this.data1[i + 1].specialtyOrderCombID
) { ) {
count++ count++;
} else { } else {
if (count > 1) { if (count > 1) {
for (let j = 0; j < count; j++) { for (let j = 0; j < count; j++) {
let index = i - j let index = i - j;
this.data1[index].orderrowspan = 0 this.data1[index].orderrowspan = 0;
} }
this.data1[i - count + 1].orderrowspan = count this.data1[i - count + 1].orderrowspan = count;
} }
count = 1 count = 1;
} }
} }
}) });
}, },
MergesRow({ row, column, rowIndex, columnIndex }) { MergesRow({ row, column, rowIndex, columnIndex }) {
//合并行 //合并行
...@@ -855,344 +846,337 @@ export default { ...@@ -855,344 +846,337 @@ export default {
return { return {
rowspan: row.orderrowspan, rowspan: row.orderrowspan,
colspan: 1 colspan: 1
} };
} else if (row.orderrowspan == 0) { } else if (row.orderrowspan == 0) {
return { return {
rowspan: 0, rowspan: 0,
colspan: 0 colspan: 0
} };
} }
} }
}, },
initTree() { initTree() {
var sumData = [] var sumData = [];
this.$http.order.getallselecttree().then((res) => { this.$http.order.getallselecttree().then(res => {
if (res.result) { if (res.result) {
for (var i = 0; i < res.result.length; i++) { for (var i = 0; i < res.result.length; i++) {
sumData = sumData.concat(res.result[i]) sumData = sumData.concat(res.result[i]);
} }
this.treeData = sumData this.treeData = sumData;
this.data2 = JSON.parse(JSON.stringify(sumData)) this.data2 = JSON.parse(JSON.stringify(sumData));
} else { } else {
this.$Message.error('加载产品树失败!') this.$Message.error("加载产品树失败!");
} }
}) });
}, },
selectTreeNode(value) { selectTreeNode(value) {
if (value.length > 0) { if (value.length > 0) {
this.ids = [] this.ids = [];
this.getAllIds(value) this.getAllIds(value);
if (this.ids.length > 0) { if (this.ids.length > 0) {
this.orderSearchForm.productId = this.ids.join(',') this.orderSearchForm.productId = this.ids.join(",");
} else { } else {
this.orderSearchForm.productId = '-1' this.orderSearchForm.productId = "-1";
this.orderSearchForm.productName = '' this.orderSearchForm.productName = "";
} }
this.easySearch(this.orderSearchForm) this.easySearch(this.orderSearchForm);
} }
}, },
getAllIds(trees) { getAllIds(trees) {
trees.forEach((data, index) => { trees.forEach((data, index) => {
var that = this var that = this;
if (data.isProduct) { if (data.isProduct) {
this.ids.push(data.productId) this.ids.push(data.productId);
} }
if (data.children.length > 0) { if (data.children.length > 0) {
this.getAllIds(data.children) this.getAllIds(data.children);
} }
}) });
}, },
selectedrow(selection) { selectedrow(selection) {
this.orderselected = selection this.orderselected = selection;
}, },
specialtyProcess() { specialtyProcess() {
if (this.orderselected == null || this.orderselected.length == 0) { if (this.orderselected == null || this.orderselected.length == 0) {
this.$Message.error('请选择订单!') this.$Message.error("请选择订单!");
} }
this.isview = false this.isview = false;
let mainids = new Array() let mainids = new Array();
let orderids = new Array() let orderids = new Array();
let productNames = new Array() let productNames = new Array();
var productids1 = new Array() var productids1 = new Array();
var productCodes = new Array() var productCodes = new Array();
let ids = '' let ids = "";
for (let i = 0; i < this.orderselected.length; i++) { for (let i = 0; i < this.orderselected.length; i++) {
let obj = this.orderselected[i] let obj = this.orderselected[i];
if (productids1.indexOf(obj.productId) < 0) { if (productids1.indexOf(obj.productId) < 0) {
productNames.push(obj.productName) productNames.push(obj.productName);
productCodes.push(obj.drawnNumber) productCodes.push(obj.drawnNumber);
productids1.push(obj.productId) productids1.push(obj.productId);
} }
orderids.push(obj.id) orderids.push(obj.id);
if (obj.mainRoutingID != 0) { if (obj.mainRoutingID != 0) {
mainids.push(obj.mainRoutingID) mainids.push(obj.mainRoutingID);
ids += 'ids=' + obj.mainRoutingID + '&' ids += "ids=" + obj.mainRoutingID + "&";
} }
} }
if (mainids == null || mainids.length == 0) { if (mainids == null || mainids.length == 0) {
this.$Message.error('请先设置主工艺!') this.$Message.error("请先设置主工艺!");
return return;
} }
this.gymodaltitle = '设置专业工艺规程' this.gymodaltitle = "设置专业工艺规程";
this.createtype = 1 this.createtype = 1;
this.modal1 = true this.modal1 = true;
this.addpdefm = this.$refs.processMain this.addpdefm = this.$refs.processMain;
this.addpdefm.clearModal() this.addpdefm.clearModal();
this.$refs.processMain.isview = false this.$refs.processMain.isview = false;
this.addpdefm.issetProcess = true this.addpdefm.issetProcess = true;
this.addpdefm.dataTop = this.orderselected this.addpdefm.dataTop = this.orderselected;
for (let i = 0; i < this.addpdefm.dataTop.length; i++) { for (let i = 0; i < this.addpdefm.dataTop.length; i++) {
this.addpdefm.dataTop[i].perboardnum = 1 this.addpdefm.dataTop[i].perboardnum = 1;
} }
this.addpdefm.formValidate.productingPreparationPeople = this.orderselected[0].productingPreparationPeople this.addpdefm.formValidate.productingPreparationPeople = this.orderselected[0].productingPreparationPeople;
this.addpdefm.formValidate.id = 0 this.addpdefm.formValidate.id = 0;
this.addpdefm.issetProcess = true this.addpdefm.issetProcess = true;
this.addpdefm.formValidate.routingType = 2 this.addpdefm.formValidate.routingType = 2;
let that = this let that = this;
var url = `${designUrl}/routingheader/GetCodeByType?code=ZY` var url = `${designUrl}/routingheader/GetCodeByType?code=ZY`;
service.get(`${url}`).then((response) => { service.get(`${url}`).then(response => {
that.addpdefm.formValidate.code = response.result that.addpdefm.formValidate.code = response.result;
that.addpdefm.gycode = response.result that.addpdefm.gycode = response.result;
}) });
this.addpdefm.Mianids = ids.substring(0, ids.length - 1) this.addpdefm.Mianids = ids.substring(0, ids.length - 1);
this.addpdefm.ProductName = productNames.toString(',') this.addpdefm.ProductName = productNames.toString(",");
this.addpdefm.ProductCode = productCodes.toString(',') this.addpdefm.ProductCode = productCodes.toString(",");
this.addpdefm.formValidate.productids = productids1.toString(',') this.addpdefm.formValidate.productids = productids1.toString(",");
this.addpdefm.formValidate.orderids = orderids.toString(',') this.addpdefm.formValidate.orderids = orderids.toString(",");
this.addpdefm.setshow() this.addpdefm.setshow();
}, },
clearModal() { clearModal() {
this.addpdefm.id = 0 this.addpdefm.id = 0;
this.addpdefm.formValidate.name = '' this.addpdefm.formValidate.name = "";
this.addpdefm.formValidate.version = '1' this.addpdefm.formValidate.version = "1";
this.addpdefm.formValidate.versioncode = 1 this.addpdefm.formValidate.versioncode = 1;
this.addpdefm.formValidate.task_type_str = '1' this.addpdefm.formValidate.task_type_str = "1";
this.addpdefm.formValidate.print_data_name = '' this.addpdefm.formValidate.print_data_name = "";
this.addpdefm.formValidate.print_data_version = '1' this.addpdefm.formValidate.print_data_version = "1";
this.addpdefm.formValidate.print_data_versioncode = 1 this.addpdefm.formValidate.print_data_versioncode = 1;
this.addpdefm.formValidate.production_batch = '' this.addpdefm.formValidate.production_batch = "";
this.addpdefm.formValidate.remark = '' this.addpdefm.formValidate.remark = "";
this.addpdefm.Mianids = '' this.addpdefm.Mianids = "";
this.addpdefm.MianCode = '' this.addpdefm.MianCode = "";
this.addpdefm.MianVer = '' this.addpdefm.MianVer = "";
this.addpdefm.ProductCode = '' this.addpdefm.ProductCode = "";
this.addpdefm.formValidate.change_order_code = '' this.addpdefm.formValidate.change_order_code = "";
this.addpdefm.formValidate.change_order_date = '' this.addpdefm.formValidate.change_order_date = "";
this.addpdefm.formValidate.change_method = '' this.addpdefm.formValidate.change_method = "";
this.addpdefm.formValidate.change_order_id = 0 this.addpdefm.formValidate.change_order_id = 0;
}, },
saveCancelModel() { saveCancelModel() {
this.modal1 = false this.modal1 = false;
this.modalliao = false this.modalliao = false;
// this.$refs.orderMaterial.cleardata() // this.$refs.orderMaterial.cleardata()
this.dataListRetrunNew.idList = [] this.dataListRetrunNew.idList = [];
}, },
modalOk() { modalOk() {
if (this.createtype == 2 && this.headerid == 0) { if (this.createtype == 2 && this.headerid == 0) {
this.$Message.error('请选择要克隆的工艺规程') this.$Message.error("请选择要克隆的工艺规程");
return return;
} else { } else {
this.addpdefm = this.$refs.processMain this.addpdefm = this.$refs.processMain;
var pernums = new Array() var pernums = new Array();
for (let i = 0; i < this.addpdefm.dataTop.length; i++) { for (let i = 0; i < this.addpdefm.dataTop.length; i++) {
let obj = this.addpdefm.dataTop[i] let obj = this.addpdefm.dataTop[i];
pernums.push(obj.perboardnum) pernums.push(obj.perboardnum);
} }
this.addpdefm.formValidate.perboardnums = pernums.toString(',') this.addpdefm.formValidate.perboardnums = pernums.toString(",");
if (this.addpdefm.createtype == 3) { if (this.addpdefm.createtype == 3) {
this.SetHeader(false) this.SetHeader(false);
} else { } else {
this.saveHeader(false) this.saveHeader(false);
} }
} }
}, },
nextStepandSave() { nextStepandSave() {
this.addpdefm = this.$refs.processMain this.addpdefm = this.$refs.processMain;
var pernums = new Array() var pernums = new Array();
for (let i = 0; i < this.addpdefm.dataTop.length; i++) { for (let i = 0; i < this.addpdefm.dataTop.length; i++) {
let obj = this.addpdefm.dataTop[i] let obj = this.addpdefm.dataTop[i];
pernums.push(obj.perboardnum) pernums.push(obj.perboardnum);
} }
this.addpdefm.formValidate.perboardnums = pernums.toString(',') this.addpdefm.formValidate.perboardnums = pernums.toString(",");
if (this.addpdefm.createtype == 3) { if (this.addpdefm.createtype == 3) {
this.SetHeader(true) this.SetHeader(true);
} else { } else {
this.saveHeader(true) this.saveHeader(true);
} }
}, },
nextStep() { nextStep() {
this.addpdefm = this.$refs.processMain this.addpdefm = this.$refs.processMain;
var pernums = new Array() var pernums = new Array();
for (let i = 0; i < this.addpdefm.dataTop.length; i++) { for (let i = 0; i < this.addpdefm.dataTop.length; i++) {
let obj = this.addpdefm.dataTop[i] let obj = this.addpdefm.dataTop[i];
pernums.push(obj.perboardnum) pernums.push(obj.perboardnum);
} }
this.addpdefm.formValidate.perboardnums = pernums.toString(',') this.addpdefm.formValidate.perboardnums = pernums.toString(",");
this.modalShow = true this.modalShow = true;
this.$refs.processNew.formprocessValidate.routing_header_id = this.headerid this.$refs.processNew.formprocessValidate.routing_header_id = this.headerid;
this.$refs.processNew.isview = true this.$refs.processNew.isview = true;
this.$refs.processNew.loaddata() this.$refs.processNew.loaddata();
}, },
//保存增加修改 //保存增加修改
saveHeader(next) { saveHeader(next) {
var a = this.$refs.processMain var a = this.$refs.processMain;
var filelist = a.getfile();
let isvalidate = false;
var filelist = a.getfile() a.$refs["formValidate"].validate(valid => {
let isvalidate = false
a.$refs['formValidate'].validate((valid) => {
if (valid) { if (valid) {
isvalidate = valid isvalidate = valid;
} else { } else {
} }
}) });
if (!isvalidate) { if (!isvalidate) {
return return;
} }
var ar = this.data1.find((val) => { var ar = this.data1.find(val => {
return val.code == a.formValidate.code return val.code == a.formValidate.code;
}) });
if (ar && a.formValidate.id == 0) { if (ar && a.formValidate.id == 0) {
this.$Message.error('产品文件编号已存在') this.$Message.error("产品文件编号已存在");
return return;
} }
if (a.formValidate.code != null) { if (a.formValidate.code != null) {
let orders = a.dataTop let orders = a.dataTop;
var url = `${designUrl}/routingheader/createorupdate` var url = `${designUrl}/routingheader/createorupdate`;
service service
.post( .post(`${url}`, {
`${url}`,
{
routingHeaderEntity: a.formValidate, routingHeaderEntity: a.formValidate,
FileList: filelist FileList: filelist
} })
) .then(response => {
.then((response) => {
if (response.success) { if (response.success) {
if (!next) { if (!next) {
if (this.createtype == 1 || this.createtype == 3) { if (this.createtype == 1 || this.createtype == 3) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
} }
} }
this.loaddata(this.orderSearchForm) this.loaddata(this.orderSearchForm);
this.headeroldid = a.selectpdefmid this.headeroldid = a.selectpdefmid;
this.headerInfo = a.formValidate this.headerInfo = a.formValidate;
let versioncode = this.headerInfo.versioncode let versioncode = this.headerInfo.versioncode;
let task_type = this.headerInfo.task_type let task_type = this.headerInfo.task_type;
let development_mode = this.headerInfo.development_mode let development_mode = this.headerInfo.development_mode;
let print_data_versioncode = this.headerInfo let print_data_versioncode = this.headerInfo
.print_data_versioncode .print_data_versioncode;
a.formValidate = response.result a.formValidate = response.result;
a.formValidate.versioncode = versioncode a.formValidate.versioncode = versioncode;
a.formValidate.task_type = task_type a.formValidate.task_type = task_type;
a.formValidate.development_mode = development_mode a.formValidate.development_mode = development_mode;
a.formValidate.print_data_versioncode = print_data_versioncode a.formValidate.print_data_versioncode = print_data_versioncode;
this.headerInfo.id = response.result.id this.headerInfo.id = response.result.id;
// this.modal1 = false // this.modal1 = false
this.headerid = response.result.id this.headerid = response.result.id;
this.detailInfo = response.result this.detailInfo = response.result;
this.detailInfo.productName = this.headerInfo.productName this.detailInfo.productName = this.headerInfo.productName;
this.detailInfo.routingTypeDesc = this.headerInfo.routingTypeDesc this.detailInfo.routingTypeDesc = this.headerInfo.routingTypeDesc;
let ordercombid = a.formValidate.ordercombid let ordercombid = a.formValidate.ordercombid;
let routingType = a.formValidate.routingType let routingType = a.formValidate.routingType;
// alert(JSON.stringify(this.detailInfo)) // alert(JSON.stringify(this.detailInfo))
if (this.headeroldid != 0) { if (this.headeroldid != 0) {
var url = var url =
`${designUrl}/routingdetail/copybyheader?headerID=` + `${designUrl}/routingdetail/copybyheader?headerID=` +
this.headeroldid + this.headeroldid +
'&headerNewID=' + "&headerNewID=" +
this.headerid this.headerid;
service.post(`${url}`).then((response) => { service.post(`${url}`).then(response => {
if (response.success) { if (response.success) {
if (next) { if (next) {
this.headeroldid = 0 this.headeroldid = 0;
a.selectpdefmid = 0 a.selectpdefmid = 0;
this.modalShow = true this.modalShow = true;
this.$refs.processNew.formprocessValidate.routing_header_id = this.headerid this.$refs.processNew.formprocessValidate.routing_header_id = this.headerid;
this.$refs.processNew.isview = false this.$refs.processNew.isview = false;
this.$refs.processNew.loaddata() this.$refs.processNew.loaddata();
} else { } else {
this.$Message.success('克隆成功') this.$Message.success("克隆成功");
this.headeroldid = 0 this.headeroldid = 0;
a.selectpdefmid = 0 a.selectpdefmid = 0;
this.editProcess( this.editProcess(
ordercombid, ordercombid,
this.headerid, this.headerid,
routingType, routingType,
orders orders
) );
} }
} }
}) });
} else { } else {
if (next) { if (next) {
this.modalShow = true this.modalShow = true;
this.$refs.processNew.formprocessValidate.routing_header_id = this.headerid this.$refs.processNew.formprocessValidate.routing_header_id = this.headerid;
this.$refs.processNew.isview = false this.$refs.processNew.isview = false;
this.$refs.processNew.loaddata() this.$refs.processNew.loaddata();
} else { } else {
if (this.issendAudit) { if (this.issendAudit) {
this.saveDocument() this.saveDocument();
} }
} }
} }
} }
}) })
.catch((error) => { .catch(error => {
this.$Message.error('保存失败') this.$Message.error("保存失败");
}) });
} else { } else {
this.$Message.error('请输入工艺文件编号') this.$Message.error("请输入工艺文件编号");
} }
}, },
SetHeader(next) { SetHeader(next) {
if (this.addpdefm.formValidate.id == 0) { if (this.addpdefm.formValidate.id == 0) {
this.$Message.error('请选择要绑定的工艺规程') this.$Message.error("请选择要绑定的工艺规程");
return return;
} else { } else {
if (next && this.addpdefm.formValidate.ordercombid != 0) { if (next && this.addpdefm.formValidate.ordercombid != 0) {
this.modal1 = false this.modal1 = false;
this.modalShow = true this.modalShow = true;
this.$refs.processNew.formprocessValidate.routing_header_id = this.headerid this.$refs.processNew.formprocessValidate.routing_header_id = this.headerid;
this.$refs.processNew.loaddata() this.$refs.processNew.loaddata();
} else { } else {
var a = this.addpdefm;
this.headerid = this.addpdefm.formValidate.id;
var a = this.addpdefm
this.headerid = this.addpdefm.formValidate.id
var orderRoutingobj = { var orderRoutingobj = {
order_comb_id: 0, order_comb_id: 0,
orderids: this.addpdefm.formValidate.orderids, orderids: this.addpdefm.formValidate.orderids,
...@@ -1202,36 +1186,33 @@ export default { ...@@ -1202,36 +1186,33 @@ export default {
productingPreparationPeople: this.addpdefm.formValidate productingPreparationPeople: this.addpdefm.formValidate
.productingPreparationPeople, .productingPreparationPeople,
platesnum: this.addpdefm.formValidate.platesnum platesnum: this.addpdefm.formValidate.platesnum
} };
var url = `${designUrl}/orderrouting/createorupdate` var url = `${designUrl}/orderrouting/createorupdate`;
service service
.post( .post(`${url}`, {
`${url}`,
{
orderRouting: orderRoutingobj orderRouting: orderRoutingobj
} })
) .then(response => {
.then((response) => {
if (response.success) { if (response.success) {
if (!next) { if (!next) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
} }
this.loaddata(this.orderSearchForm) this.loaddata(this.orderSearchForm);
this.modal1 = false this.modal1 = false;
if (next) { if (next) {
this.modalShow = true this.modalShow = true;
this.$refs.processNew.formprocessValidate.routing_header_id = this.headerid this.$refs.processNew.formprocessValidate.routing_header_id = this.headerid;
this.$refs.processNew.loaddata() this.$refs.processNew.loaddata();
} }
} }
}) })
.catch((error) => { .catch(error => {
this.$Message.error('保存失败') this.$Message.error("保存失败");
}) });
} }
} }
}, },
...@@ -1239,492 +1220,483 @@ export default { ...@@ -1239,492 +1220,483 @@ export default {
renderContent(h, { root, node, data }) { renderContent(h, { root, node, data }) {
//渲染树的样式 //渲染树的样式
return h( return h(
'span', "span",
{ {
style: { style: {
color: data.isProduct != '1' ? '#249E91' : '#333', //根据选中状态设置样式 color: data.isProduct != "1" ? "#249E91" : "#333", //根据选中状态设置样式
cursor: 'pointer' cursor: "pointer"
}, },
on: { on: {
click: () => { click: () => {
let arrTree = [] let arrTree = [];
arrTree.push(data) arrTree.push(data);
this.handleSelect(arrTree) //手动选择树节点 this.handleSelect(arrTree); //手动选择树节点
} }
} }
}, },
data.title data.title
) );
}, },
handleSelect(data) { handleSelect(data) {
if (data.length > 0) { if (data.length > 0) {
this.selectdata = [] this.selectdata = [];
this.selectdata = data this.selectdata = data;
this.list = [] this.list = [];
this.list.push({ label: data[0].title, value: data[0].id }) this.list.push({ label: data[0].title, value: data[0].id });
if (data[0].isProduct == '1') { if (data[0].isProduct == "1") {
this.orderSearchForm.productName = data[0].id this.orderSearchForm.productName = data[0].id;
this.orderSearchForm.productId = data[0].productId this.orderSearchForm.productId = data[0].productId;
} else { } else {
this.$Message.error('此节点不是产品,请选择产品节点!') this.$Message.error("此节点不是产品,请选择产品节点!");
} }
} }
}, },
modalShowCancel() { modalShowCancel() {
this.modalShow = false this.modalShow = false;
}, },
saveOK() { saveOK() {
var url = `${PlanUrl}/OrderMaterial/createorupdate` var url = `${PlanUrl}/OrderMaterial/createorupdate`;
service service
.post(`${url}`, { orderMaterial: this.formValidate }) .post(`${url}`, { orderMaterial: this.formValidate })
.then((response) => { .then(response => {
if (response.success) { if (response.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.modal1 = false this.modal1 = false;
this.$refs.quotationBox1.formValidate = [] this.$refs.quotationBox1.formValidate = [];
this.loaddata('') this.loaddata("");
} }
}) })
.catch((error) => { .catch(error => {
this.$Message.error('保存失败') this.$Message.error("保存失败");
}) });
}, },
//添加工艺规程 //添加工艺规程
addProcessRow(params, routingType) { addProcessRow(params, routingType) {
this.modal1 = true this.modal1 = true;
this.isview = false this.isview = false;
this.addpdefm = this.$refs.processMain this.addpdefm = this.$refs.processMain;
this.addpdefm.clearModal() this.addpdefm.clearModal();
this.$refs.processMain.isview = this.isview this.$refs.processMain.isview = this.isview;
this.clearModal() this.clearModal();
this.addpdefm.issetProcess = true this.addpdefm.issetProcess = true;
let orderlist = new Array() let orderlist = new Array();
let orderids = new Array() let orderids = new Array();
let ordercombid = 0 let ordercombid = 0;
this.createtype = 1 this.createtype = 1;
if (routingType == 1) { if (routingType == 1) {
this.gymodaltitle = '设置工艺规程' this.gymodaltitle = "设置工艺规程";
for (let i = 0; i < this.data1.length; i++) { for (let i = 0; i < this.data1.length; i++) {
let obj1 = this.data1[i] let obj1 = this.data1[i];
if (obj1.id == params.row.id) { if (obj1.id == params.row.id) {
// obj.perboardnum = 1 // obj.perboardnum = 1
orderlist.push(obj1) orderlist.push(obj1);
orderids.push(obj1.id) orderids.push(obj1.id);
} }
} }
} else { } else {
this.gymodaltitle = "设置专业工艺规程";
this.gymodaltitle = '设置专业工艺规程' ordercombid = params.row.specialtyOrderCombID;
ordercombid = params.row.specialtyOrderCombID
if (ordercombid != 0) { if (ordercombid != 0) {
this.addpdefm.formValidate.ordercombid = ordercombid;
this.addpdefm.formValidate.ordercombid = ordercombid
for (let i = 0; i < this.data1.length; i++) { for (let i = 0; i < this.data1.length; i++) {
let obj = this.data1[i] let obj = this.data1[i];
if (obj.specialtyOrderCombID == ordercombid) { if (obj.specialtyOrderCombID == ordercombid) {
orderlist.push(obj) orderlist.push(obj);
orderids.push(obj.id) orderids.push(obj.id);
} }
} }
} else { } else {
for (let i = 0; i < this.data1.length; i++) { for (let i = 0; i < this.data1.length; i++) {
let obj1 = this.data1[i] let obj1 = this.data1[i];
if (obj1.id == params.row.id) { if (obj1.id == params.row.id) {
// obj.perboardnum = 1 // obj.perboardnum = 1
orderlist.push(obj1) orderlist.push(obj1);
orderids.push(obj1.id) orderids.push(obj1.id);
} }
} }
} }
} }
this.addpdefm.dataTop = orderlist this.addpdefm.dataTop = orderlist;
for (let i = 0; i < this.addpdefm.dataTop.length; i++) { for (let i = 0; i < this.addpdefm.dataTop.length; i++) {
if (ordercombid == 0) { if (ordercombid == 0) {
this.addpdefm.dataTop[i].perboardnum = 1 this.addpdefm.dataTop[i].perboardnum = 1;
} }
} }
this.addpdefm.formValidate.id = 0 this.addpdefm.formValidate.id = 0;
this.addpdefm.formValidate.routingType = routingType this.addpdefm.formValidate.routingType = routingType;
let that = this let that = this;
var url = var url =
`${designUrl}/routingheader/GetCodeByType?code=` + `${designUrl}/routingheader/GetCodeByType?code=` +
(routingType == 1 ? 'ZGY' : 'ZY') (routingType == 1 ? "ZGY" : "ZY");
service.get(`${url}`).then((response) => { service.get(`${url}`).then(response => {
that.addpdefm.formValidate.code = response.result that.addpdefm.formValidate.code = response.result;
that.addpdefm.gycode = response.result that.addpdefm.gycode = response.result;
}) });
let obj = params.row let obj = params.row;
this.addpdefm.ProductName = obj.productName this.addpdefm.ProductName = obj.productName;
this.addpdefm.ProductCode = obj.drawnNumber this.addpdefm.ProductCode = obj.drawnNumber;
this.addpdefm.formValidate.productids = obj.productId this.addpdefm.formValidate.productids = obj.productId;
this.addpdefm.formValidate.orderids = orderids.toString(',') this.addpdefm.formValidate.orderids = orderids.toString(",");
if (routingType == 2) { if (routingType == 2) {
var url = `${designUrl}/routingheader/getbyid?id=` + obj.mainRoutingID var url = `${designUrl}/routingheader/getbyid?id=` + obj.mainRoutingID;
service.get(`${url}`).then((response) => { service.get(`${url}`).then(response => {
this.addpdefm.formValidate.up_id = obj.mainRoutingID this.addpdefm.formValidate.up_id = obj.mainRoutingID;
this.addpdefm.Mianids = '' this.addpdefm.Mianids = "";
this.addpdefm.MianVer = response.result.version this.addpdefm.MianVer = response.result.version;
this.addpdefm.MianCode = response.result.code this.addpdefm.MianCode = response.result.code;
}) });
} }
this.addpdefm.formValidate.productingPreparationPeople = this.addpdefm.formValidate.productingPreparationPeople =
params.row.productingPreparationPeople params.row.productingPreparationPeople;
this.addpdefm.setshow() this.addpdefm.setshow();
}, },
editProcessRow(params, RoutingID, routingType) { editProcessRow(params, RoutingID, routingType) {
let ordercombid = 0;
let ordercombid = 0 ordercombid = params.row.orderCombID;
ordercombid = params.row.orderCombID this.editProcess(ordercombid, RoutingID, routingType, null);
this.editProcess(ordercombid, RoutingID, routingType, null)
}, },
editProcess(ordercombid, RoutingID, routingType, orders) { editProcess(ordercombid, RoutingID, routingType, orders) {
this.isview = false this.isview = false;
this.modal1 = true this.modal1 = true;
this.addpdefm = this.$refs.processMain this.addpdefm = this.$refs.processMain;
this.addpdefm.clearModal() this.addpdefm.clearModal();
this.createtype = 1 this.createtype = 1;
this.$refs.processMain.issetProcess = true this.$refs.processMain.issetProcess = true;
this.$refs.processMain.isview = this.isview this.$refs.processMain.isview = this.isview;
let orderids = new Array() let orderids = new Array();
let orderlist = new Array() let orderlist = new Array();
this.addpdefm.formValidate.ordercombid = ordercombid;
this.addpdefm.formValidate.ordercombid = ordercombid
if (orders == null) { if (orders == null) {
for (let i = 0; i < this.data1.length; i++) { for (let i = 0; i < this.data1.length; i++) {
let obj = this.data1[i] let obj = this.data1[i];
if (routingType == 1) { if (routingType == 1) {
if (obj.orderCombID == ordercombid) { if (obj.orderCombID == ordercombid) {
// obj.perboardnum = 1 // obj.perboardnum = 1
orderlist.push(obj) orderlist.push(obj);
orderids.push(obj.id) orderids.push(obj.id);
} }
} else if (routingType == 2) { } else if (routingType == 2) {
if (obj.specialtyOrderCombID == ordercombid) { if (obj.specialtyOrderCombID == ordercombid) {
// obj.perboardnum = 1 // obj.perboardnum = 1
orderlist.push(obj) orderlist.push(obj);
orderids.push(obj.id) orderids.push(obj.id);
} }
} }
} }
} else { } else {
orderlist = orders orderlist = orders;
for (let i = 0; i < orders.length; i++) { for (let i = 0; i < orders.length; i++) {
let obj = orders[i] let obj = orders[i];
orderids.push(obj.id) orderids.push(obj.id);
} }
} }
this.addpdefm.dataTop = orderlist this.addpdefm.dataTop = orderlist;
if (routingType == 1) { if (routingType == 1) {
this.gymodaltitle = '设置工艺规程' this.gymodaltitle = "设置工艺规程";
} else { } else {
this.gymodaltitle = '设置工艺规程' this.gymodaltitle = "设置工艺规程";
} }
var url = `${designUrl}/routingheader/getbyid?id=` + RoutingID var url = `${designUrl}/routingheader/getbyid?id=` + RoutingID;
service.get(`${url}`).then((response) => { service.get(`${url}`).then(response => {
this.addpdefm.formValidate = response.result this.addpdefm.formValidate = response.result;
this.addpdefm.ProductName = response.result.productName this.addpdefm.ProductName = response.result.productName;
this.addpdefm.ProductCode = response.result.productCode this.addpdefm.ProductCode = response.result.productCode;
this.addpdefm.MianVer = response.result.mianVer this.addpdefm.MianVer = response.result.mianVer;
this.addpdefm.MianCode = response.result.mianCode this.addpdefm.MianCode = response.result.mianCode;
this.addpdefm.formValidate.orderids = orderids.toString(',') this.addpdefm.formValidate.orderids = orderids.toString(",");
this.addpdefm.formValidate.ordercombid = ordercombid this.addpdefm.formValidate.ordercombid = ordercombid;
this.addpdefm.formValidate.platesnum = 1 this.addpdefm.formValidate.platesnum = 1;
var url = `${designUrl}/orderrouting/getbycombid?id=` + ordercombid var url = `${designUrl}/orderrouting/getbycombid?id=` + ordercombid;
service.get(`${url}`).then((response) => { service.get(`${url}`).then(response => {
this.addpdefm.formValidate.platesnum = response.result.platesnum this.addpdefm.formValidate.platesnum = response.result.platesnum;
}) });
this.addpdefm.setshow() this.addpdefm.setshow();
}) });
}, },
viewProcessRow(params, RoutingID, routingType) { viewProcessRow(params, RoutingID, routingType) {
this.isview = true this.isview = true;
this.modal1 = true this.modal1 = true;
this.addpdefm = this.$refs.processMain this.addpdefm = this.$refs.processMain;
this.addpdefm.clearModal() this.addpdefm.clearModal();
this.$refs.processMain.issetProcess = true this.$refs.processMain.issetProcess = true;
this.$refs.processMain.isview = this.isview this.$refs.processMain.isview = this.isview;
let orderids = new Array() let orderids = new Array();
let orderlist = new Array() let orderlist = new Array();
let ordercombid = 0 let ordercombid = 0;
ordercombid = params.row.orderCombID ordercombid = params.row.orderCombID;
this.addpdefm.formValidate.ordercombid = ordercombid this.addpdefm.formValidate.ordercombid = ordercombid;
for (let i = 0; i < this.data1.length; i++) { for (let i = 0; i < this.data1.length; i++) {
let obj = this.data1[i] let obj = this.data1[i];
if (routingType == 1) { if (routingType == 1) {
if (obj.orderCombID == ordercombid) { if (obj.orderCombID == ordercombid) {
// obj.perboardnum = 1 // obj.perboardnum = 1
orderlist.push(obj) orderlist.push(obj);
orderids.push(obj.id) orderids.push(obj.id);
} }
} else if (routingType == 2) { } else if (routingType == 2) {
if (obj.specialtyOrderCombID == ordercombid) { if (obj.specialtyOrderCombID == ordercombid) {
// obj.perboardnum = 1 // obj.perboardnum = 1
orderlist.push(obj) orderlist.push(obj);
orderids.push(obj.id) orderids.push(obj.id);
} }
} }
} }
this.addpdefm.dataTop = orderlist this.addpdefm.dataTop = orderlist;
this.gymodaltitle = "查看工艺规程";
var url = `${designUrl}/routingheader/getbyid?id=` + RoutingID;
service.get(`${url}`).then(response => {
this.addpdefm.formValidate = response.result;
this.headerInfo = response.result;
this.headerid = response.result.id;
this.addpdefm.ProductName = response.result.productName;
this.addpdefm.ProductCode = response.result.productCode;
this.gymodaltitle = '查看工艺规程' this.addpdefm.MianVer = response.result.mianVer;
this.addpdefm.MianCode = response.result.mianCode;
var url = `${designUrl}/orderrouting/getbycombid?id=` + ordercombid;
service.get(`${url}`).then(response => {
this.addpdefm.formValidate.platesnum = response.result.platesnum;
});
this.addpdefm.formValidate.orderids = orderids.toString(",");
var url = `${designUrl}/routingheader/getbyid?id=` + RoutingID this.addpdefm.setshow();
service.get(`${url}`).then((response) => { });
this.addpdefm.formValidate = response.result
this.headerInfo = response.result
this.headerid = response.result.id
this.addpdefm.ProductName = response.result.productName
this.addpdefm.ProductCode = response.result.productCode
this.addpdefm.MianVer = response.result.mianVer
this.addpdefm.MianCode = response.result.mianCode
var url = `${designUrl}/orderrouting/getbycombid?id=` + ordercombid
service.get(`${url}`).then((response) => {
this.addpdefm.formValidate.platesnum = response.result.platesnum
})
this.addpdefm.formValidate.orderids = orderids.toString(',')
this.addpdefm.setshow()
})
}, },
laststep() { laststep() {
this.modalShow = false this.modalShow = false;
this.modal1 = true this.modal1 = true;
this.addpdefm = this.$refs.processMain this.addpdefm = this.$refs.processMain;
this.addpdefm.formValidate = this.headerInfo this.addpdefm.formValidate = this.headerInfo;
this.addpdefm.isview = this.isview this.addpdefm.isview = this.isview;
this.addpdefm.ProductName = this.headerInfo.productName this.addpdefm.ProductName = this.headerInfo.productName;
this.addpdefm.ProductCode = this.headerInfo.productCode this.addpdefm.ProductCode = this.headerInfo.productCode;
this.addpdefm.MianVer = this.headerInfo.mianVer this.addpdefm.MianVer = this.headerInfo.mianVer;
this.addpdefm.MianCode = this.headerInfo.mianCode this.addpdefm.MianCode = this.headerInfo.mianCode;
this.addpdefm.Loadfile(this.addpdefm.formValidate.id) this.addpdefm.Loadfile(this.addpdefm.formValidate.id);
this.addpdefm.setshow() this.addpdefm.setshow();
}, },
saveProcessView() { saveProcessView() {
this.processviewModal = true this.processviewModal = true;
this.$refs.processview.loaddata(this.headerid) this.$refs.processview.loaddata(this.headerid);
}, },
saveDocument() { saveDocument() {
this.documentShow = true this.documentShow = true;
this.$refs.sendAudit.intData(this.detailInfo) this.$refs.sendAudit.intData(this.detailInfo);
}, },
saveCancel1() { saveCancel1() {
this.show = false this.show = false;
}, },
saveCancel() { saveCancel() {
this.show = false this.show = false;
}, },
openld() { openld() {
this.modalliao = true this.modalliao = true;
}, },
Seveld() { Seveld() {
this.$refs.orderMaterial.SaveLd() // 创建料单保存 this.$refs.orderMaterial.SaveLd(); // 创建料单保存
this.formdata.data01 = this.$refs.orderMaterial.formValidate this.formdata.data01 = this.$refs.orderMaterial.formValidate;
this.formdata.data02 = this.$refs.orderMaterial.formValidate1 this.formdata.data02 = this.$refs.orderMaterial.formValidate1;
// console.log(this.formdata) // console.log(this.formdata)
if (this.checked == true) { if (this.checked == true) {
this.$refs.orderSendReview.intData(this.formdata) this.$refs.orderSendReview.intData(this.formdata);
this.modalliao = false this.modalliao = false;
this.modalInfo = true this.modalInfo = true;
} }
}, },
upSave() { upSave() {
let operatorIdList = this.$refs.orderSendReview.returnDataList() let operatorIdList = this.$refs.orderSendReview.returnDataList();
let itemCode = this.formdata.data01.code let itemCode = this.formdata.data01.code;
// this.dataListRetrunNew.codeList.push(itemCode) // this.dataListRetrunNew.codeList.push(itemCode)
this.dataListRetrunNew.code = itemCode this.dataListRetrunNew.code = itemCode;
this.dataListRetrunNew.operatorIdList = operatorIdList this.dataListRetrunNew.operatorIdList = operatorIdList;
this.$http.order this.$http.order
.batchOrderStart(this.dataListRetrunNew) .batchOrderStart(this.dataListRetrunNew)
.then((response) => { .then(response => {
// console.log(response) // console.log(response)
if (response.success) { if (response.success) {
this.$Message.info('材料消耗单送审成功!') this.$Message.info("材料消耗单送审成功!");
this.dataListRetrunNew.idList = [] this.dataListRetrunNew.idList = [];
} else if (response.success == false) { } else if (response.success == false) {
console.log(response.error.message) console.log(response.error.message);
// this.$Message.error(response.error.message) // this.$Message.error(response.error.message)
} else { } else {
this.$Message.error(response.error.message) this.$Message.error(response.error.message);
} }
this.modalInfo = false this.modalInfo = false;
})
.catch((err) => {
console.log(err)
}) })
.catch(err => {
console.log(err);
});
}, },
savematerialbill(params) { savematerialbill(params) {
this.modalliao = true this.modalliao = true;
let ld = this.$refs.orderMaterial let ld = this.$refs.orderMaterial;
if ( if (
params.row.materialbillStatus == 1 || params.row.materialbillStatus == 1 ||
params.row.materialbillStatus == 2 || params.row.materialbillStatus == 2 ||
params.row.materialbillStatus == 3 params.row.materialbillStatus == 3
) { ) {
this.ismview = true this.ismview = true;
} else { } else {
this.ismview = false this.ismview = false;
} }
let orderids = new Array() let orderids = new Array();
let orderlist = new Array() let orderlist = new Array();
if (params.row.specialtyOrderCombID == 0) { if (params.row.specialtyOrderCombID == 0) {
for (let i = 0; i < this.data1.length; i++) { for (let i = 0; i < this.data1.length; i++) {
let obj1 = this.data1[i] let obj1 = this.data1[i];
if (obj1.id == params.row.id) { if (obj1.id == params.row.id) {
// obj.perboardnum = 1 // obj.perboardnum = 1
orderlist.push(obj1) orderlist.push(obj1);
orderids.push(obj1.id) orderids.push(obj1.id);
} }
} }
} else { } else {
for (let i = 0; i < this.data1.length; i++) { for (let i = 0; i < this.data1.length; i++) {
let obj = this.data1[i] let obj = this.data1[i];
if (obj.specialtyOrderCombID == params.row.specialtyOrderCombID) { if (obj.specialtyOrderCombID == params.row.specialtyOrderCombID) {
orderlist.push(obj) orderlist.push(obj);
orderids.push(obj.id) orderids.push(obj.id);
} }
} }
} }
ld.order_comb_id = params.row.specialtyOrderCombID ld.order_comb_id = params.row.specialtyOrderCombID;
ld.dataTop = orderlist ld.dataTop = orderlist;
for (let i = 0; i < this.$refs.orderMaterial.dataTop.length; i++) { for (let i = 0; i < this.$refs.orderMaterial.dataTop.length; i++) {
if (this.$refs.orderMaterial.dataTop[i].perboardnum == 0) { if (this.$refs.orderMaterial.dataTop[i].perboardnum == 0) {
this.$refs.orderMaterial.dataTop[i].perboardnum = 1 this.$refs.orderMaterial.dataTop[i].perboardnum = 1;
} }
} }
ld.productingPreparationPeople = params.row.productingPreparationPeople ld.productingPreparationPeople = params.row.productingPreparationPeople;
ld.orderids = orderids.toString(',') ld.orderids = orderids.toString(",");
ld.formValidate.routingHeaderId = params.row.mainRoutingID ld.formValidate.routingHeaderId = params.row.mainRoutingID;
ld.formValidate.id = params.row.materialbillID ld.formValidate.id = params.row.materialbillID;
if (ld.formValidate.id == 0) {
ld.loaddata() this.ismview = false;
} else {
this.ismview = this;
}
ld.loaddata();
}, },
creatematerialbill() { creatematerialbill() {
if (this.orderselected == null || this.orderselected.length == 0) { if (this.orderselected == null || this.orderselected.length == 0) {
this.$Message.error('请选择订单!') this.$Message.error("请选择订单!");
return return;
} }
this.modalliao = true this.modalliao = true;
this.ismview = false this.ismview = false;
let mainids = new Array() let mainids = new Array();
let orderids = new Array() let orderids = new Array();
for (let i = 0; i < this.orderselected.length; i++) { for (let i = 0; i < this.orderselected.length; i++) {
let obj = this.orderselected[i] let obj = this.orderselected[i];
orderids.push(obj.id) orderids.push(obj.id);
} }
// if (mainids == null || mainids.length == 0) { // if (mainids == null || mainids.length == 0) {
// this.$Message.error('请先设置主工艺!') // this.$Message.error('请先设置主工艺!')
// return // return
// } // }
let ld = this.$refs.orderMaterial let ld = this.$refs.orderMaterial;
ld.order_comb_id = 0 ld.order_comb_id = 0;
ld.dataTop = this.orderselected ld.dataTop = this.orderselected;
for (let i = 0; i < this.$refs.orderMaterial.dataTop.length; i++) { for (let i = 0; i < this.$refs.orderMaterial.dataTop.length; i++) {
this.$refs.orderMaterial.dataTop[i].perboardnum = 1 this.$refs.orderMaterial.dataTop[i].perboardnum = 1;
} }
ld.orderids = orderids.toString(',') ld.orderids = orderids.toString(",");
ld.formValidate.id = 0 ld.formValidate.id = 0;
ld.loaddata() ld.loaddata();
}, },
// 取消送审 // 取消送审
canCelFn() { canCelFn() {
this.modalInfo = false this.modalInfo = false;
this.dataListRetrunNew.idList = [] this.dataListRetrunNew.idList = [];
}, },
passDocument() { passDocument() {
this.dataListRetrun = [] this.dataListRetrun = [];
this.dataListRetrun = this.$refs.sendAudit.returnDataList() this.dataListRetrun = this.$refs.sendAudit.returnDataList();
this.$http.order.batchstart(this.dataListRetrun).then((res) => { this.$http.order.batchstart(this.dataListRetrun).then(res => {
if (res.success) { if (res.success) {
this.$Message.success('工艺规程送审成功!') this.$Message.success("工艺规程送审成功!");
this.loaddata() this.loaddata();
//this.easySearch('') //this.easySearch('')
} else { } else {
this.$Message.error('工艺规程送审失败!') this.$Message.error("工艺规程送审失败!");
} }
}) });
this.documentShow = false this.documentShow = false;
} }
} }
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.order-quotation { .order-quotation {
......
<style lang="less">
@import "../../../processDesign/Process/menu.less";
</style>
<template>
<div class="new_box">
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="160" inline>
<!-- <Row>
<FormItem label="文件模板" prop="file_template">
<Select style="width:240px;" v-model="formValidate.file_template" placeholder="请选择...">
<Option
v-for="(item,index) in fileTemplateList"
:value="item.value"
:label="item.name"
:key="index"
></Option>
</Select>
</FormItem>
<FormItem label="文档名称" prop="name">
<Input
size="large"
v-model.trim="formValidate.name"
placeholder="请输入..."
style="width:240px"
/>
</FormItem>
</Row>-->
<Row>
<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">
<FormItem label="配套完成时间" prop="code">
<DatePicker type="date" v-model="supportFinishDate"></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
<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.material_type"
></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.name"></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.material_type"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('brand')" prop="brand">
<Input v-model="formprocessValidate.pate_number"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('specifications')" prop="specifications">
<Input v-model="formprocessValidate.spec"></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>
</template>
<script>
import service from "@/plugins/request";
export default {
name: "orderSupport",
components: {},
data() {
return {
order_comb_id: 0,
orderids: "",
productingPreparationPeople: "",
taskType: "",
Modeltitle: "料单",
dataTop: [],
isview: false,
codeisview: false,
newModel: false,
approvalStatus: 0,
editindex: -1,
supportFinishDate: "",
formValidate: {
id: 0,
code: "",
name: "",
platesnum: 0,
quota_per_board: 0,
file_template: "",
remarks: "",
extend: "",
order_comb_id: 0,
orderids: "",
routingHeaderId: 0,
productingPreparationPeople: "",
ordercodes: "",
approvalStatus: 0
},
formValidate1: [],
formprocessValidate: {
id: 0,
materialbillId: 0,
material_type: 0,
name: "",
pate_number: "",
spec: "",
categories: "",
quantity: 1,
singlequantity: 0,
quantity_unit: "",
estimated_part_height: 0,
height_unit: "",
lower_basal_plate: 0,
plate_unit: "",
use_equip: "",
remarks: "",
extend: "",
actual_quantity: 0,
routingHeaderId: 0,
routingDetailId: 0,
routingStepId: 0,
supportingID: 0,
materialNumber: "",
xhgg: "",
texture: "",
procurementStandards: "",
qualityGrade: ""
},
column1: [
{ title: "序号", type: "index", width: "70", align: "center" },
{
key: "materialNumber",
title: this.l("materialNumber"),
align: "left",
easy: true,
high: true
},
{
key: "name",
title: this.l("nameMaterial"),
align: "left",
easy: true,
high: true
},
{
key: "quantity",
title: this.l("quantity"),
align: "left",
high: true
},
{
title: "实际数量",
key: "actual_quantity",
align: "center",
render: (h, params) => {
if (this.isview) {
return h("div", this.dataTop[params.index].actual_quantity);
} else {
return h("div", [
h("InputNumber", {
props: {
value: this.dataTop[params.index].actual_quantity,
min: 1
},
on: {
"on-change": event => {
this.dataTop[params.index].actual_quantity = event;
}
}
})
]);
}
}
},
{
key: "material_type",
title: this.l("materialType"),
align: "left",
easy: true,
high: true,
slot: "materialType"
},
{
key: "pate_number",
title: this.l("brand"),
align: "left",
easy: true,
high: true
},
{
key: "spec",
title: this.l("specifications"),
align: "left",
easy: true,
high: true
},
{
key: "xhgg",
title: this.l("xhgg"),
align: "left",
easy: true,
high: true
},
{
key: "texture",
title: this.l("texture"),
align: "left",
easy: true,
high: true
},
{
key: "procurementStandards",
title: this.l("procurementStandards"),
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;
return h(
"div",
{
class: "icon_box"
},
[
h("op", {
class: "view ",
attrs: { icon: "ios-eye", title: "查看", type: "icon" },
on: {
click: () => {
this.editFun(params);
}
}
})
]
);
}
}
]
};
},
mounted() {},
created: function() {},
methods: {
handleCreate1(val) {
this.EquipList.push({
value: val,
label: val
});
},
l(key) {
key = "RoutingSupporting" + "." + key;
return this.$t(key);
},
openNew() {
// this.$nextTick(()=>{
// this.$refs['formItem'].resetFields()
// }
this.cleardata1();
this.newModel = true;
},
loaddata(orderid) {
if (this.formValidate.id != 0) {
var url =
`${designUrl}/ordersupport/getbyid?id=` + this.formValidate.id;
service.get(`${url}`).then(response => {
this.formValidate = response.result.orderMaterial;
this.isview = true;
this.codeisview = true;
this.formValidate1 = response.result.orderMaterialList;
for (let i = 0; i < this.formValidate1.length; i++) {
let obj = this.formValidate1[i];
obj.actual_quantity = obj.quantity;
}
});
}
},
SaveLd() {},
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;
this.formprocessValidate.name = params.row.name;
this.formprocessValidate.spec = params.row.spec;
this.formprocessValidate.pate_number = params.row.pate_number;
this.formprocessValidate.categories = params.row.categories;
this.formprocessValidate.materialId = params.row.materialId;
this.formprocessValidate.materialNumber = params.row.materialNumber;
this.formprocessValidate.nameMaterial = params.row.nameMaterial;
this.formprocessValidate.brand = params.row.brand;
this.formprocessValidate.quantity = params.row.quantity;
this.formprocessValidate.singlequantity = params.row.singlequantity;
this.formprocessValidate.quantity_unit = params.row.quantity_unit;
this.formprocessValidate.estimated_part_height =
params.row.estimated_part_height;
this.formprocessValidate.height_unit = params.row.height_unit;
this.formprocessValidate.lower_basal_plate = params.row.lower_basal_plate;
this.formprocessValidate.plate_unit = params.row.plate_unit;
this.formprocessValidate.use_equip = params.row.use_equip;
this.formprocessValidate.remarks = params.row.remarks;
this.formprocessValidate.extend = params.row.extend;
this.formprocessValidate.actual_quantity = params.row.actual_quantity;
this.formprocessValidate.routingHeaderId = params.row.routingHeaderId;
this.formprocessValidate.routingDetailId = params.row.routingDetailId;
this.formprocessValidate.routingStepId = params.row.routingStepId;
this.formprocessValidate.supportingID = params.row.supportingID;
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;
},
saveCancelModel() {
this.modalliao = false;
},
cancel() {
this.cleardata1();
this.editindex = -1;
},
cleardata() {
this.formValidate.id = 0;
this.formValidate.code = "";
this.formValidate.name = "";
this.formValidate.platesnum = 0;
this.formValidate.quota_per_board = 0;
this.formValidate.file_template = "";
},
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 = "");
}
}
};
</script>
\ No newline at end of file
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