Commit 5e101264 authored by renjintao's avatar renjintao Committed by 佟礼

设置工艺规程

parents e204bba9 af027958
......@@ -5,11 +5,8 @@
<Button @click="open" type="text"><Icon type="md-search" />高级</Button>
<!-- <Input v-model="value" placeholder="关键字" style="width:300px;" :clearable='true'>
<Button @click="easySearch" icon="ios-search-outline" slot="append" style="width:40px;background-color:#249E91;color:#FFF;"></Button>
</Input> -->
</Input> -->
</div>
<!-- 右侧按钮 -->
<slot name="button"></slot>
<!-- 弹出高级搜索框 -->
......
......@@ -133,8 +133,8 @@ export default {
columnsCur: [],
configLoad: false,
userConfig: null, //用户页面配置信息。,
userId: 1
// userId: this.$store.state.userInfo.userId
// userId: 1
userId: this.$store.state.userInfo.userId
}
},
props: {
......
......@@ -16,6 +16,7 @@
</div>
<!-- 右侧内容 -->
<div class="content-right">
<div class="title_box">
<div class="table_title">
<div style="width:100px; float:left">
......@@ -33,12 +34,12 @@
v-model="searchIterms"
placeholder="请输入订单编号"
@on-search="easySearch"
></Input>
/>
<Button type="primary" class="title_btn" @click="searchModel">高级查询</Button>
</div>
</div>
<div class="fr"></div>
</div>
<!-- 高级搜索弹框 draggable -->
......@@ -200,7 +201,7 @@
</Form>
<div slot="footer">
<Button @click="close" style="margin-left:20px;">取消</Button>
<Button @click="easySearch" type="primary" style="margin-left:10px;">查询</Button>
<Button @click="search" type="primary" style="margin-left:10px;">查询</Button>
</div>
</Modal>
......@@ -243,9 +244,20 @@
:mask-closable="false"
:loading="myloading"
>
<processMain ref="processMain"></processMain>
<processMain ref="processMain" :issetProcess="true"></processMain>
<div v-if="!isview" slot="footer" v-model="greateArtmodel">
<template>
<template v-if="createtype==1">
<Button type="text" size="large" @click="saveCancelModel">取消</Button>
<Checkbox v-model="issendAudit" label="送审">送审</Checkbox>
<Button type="primary" size="large" @click="modalOk">保存</Button>
<Button type="primary" size="large" @click="nextStepandSave">下一步</Button>
</template>
<template v-else-if="createtype==2">
<Button type="text" size="large" @click="saveCancelModel">取消</Button>
<Button type="primary" size="large" @click="modalOk">克隆</Button>
<Button type="primary" size="large" @click="nextStep">查看详情</Button>
</template>
<template v-else-if="createtype==3">
<Button type="text" size="large" @click="saveCancelModel">取消</Button>
<Button type="primary" size="large" @click="modalOk">绑定</Button>
<Button type="primary" size="large" @click="nextStep">查看详情</Button>
......@@ -302,21 +314,7 @@
<Button type="primary" @click="upSave">确定送审</Button>
</div>
</Modal>
<Modal
v-model="orderDatadia"
title="数据审查"
class="model_tabel"
:width="740"
:mask-closable="false"
:loading="myloading"
footer-hide
>
<orderData ref="orderData"></orderData>
<!-- <div slot="footer" v-model="greateArtmodel">
<Button type="text" size="large" @click="orderDatadia=false">取消</Button>
<Button type="primary" size="large" @click="saveorderdata">确定</Button>
</div>-->
</Modal>
<Modal
v-model="documentShow"
......@@ -350,7 +348,7 @@ import DrawerSet from './components/drawerSet.vue' //抽屉列表
import TreeType from './components/treeType.vue' //左侧树列表
import orderMaterial from './components/orderMaterial.vue' //料单
import orderData from './components/orderData.vue' //数据审查
import processMain from './processMain.vue'
import processNew from '../Process/processNew.vue'
import service from '@/plugins/request'
......@@ -368,8 +366,8 @@ export default {
orderMaterial,
OrderSendReview,
processview,
sendAudit,
orderData
sendAudit
},
data() {
return {
......@@ -401,7 +399,7 @@ export default {
processviewModal: false, //工艺预览
documentShow: false, //工艺送审
modalliao: false,
orderDatadia: false,
ProductingPreparationPeople: 0,
checked: true, //送审选择框
modalInfo: false, //校验送审弹框
......@@ -521,28 +519,13 @@ export default {
fixed: 'left'
},
{ title: '图号', key: 'drawnNumber', width: 120 },
{
title: '材料',
key: 'materialName',
width: 80,
align: 'center',
render: (h, params) => {
return h('state', {
props: {
code: 'plan.order.material',
type: 'text',
value: params.row.materialId + ''
}
})
}
},
{ title: '数量', key: 'quantity', width: 80, align: 'center' },
{ title: '外包络尺寸', key: 'outer_Envelope_Size', width: 120 },
{ title: '外协要求', key: 'inhouseOffice', width: 140 },
{
title: '设置工艺',
title: '工艺',
key: 'mainRoutingID',
width: 120,
render: (h, params) => {
......@@ -573,52 +556,132 @@ export default {
content = gh[0].name
editColor = gh[0].color
}
return h('div', [
h(
'span',
{
props: {
type: 'text',
ghost: true
},
style: {
color: editColor,
cursor: 'pointer'
},
on: {
click: (e) => {
e.stopPropagation()
if (params.row.mainRoutingID != 0) {
if (
params.row.mainRoutingStatus == 4 ||
params.row.mainRoutingStatus == 0 ||
params.row.mainRoutingStatus == -1 ||
params.row.mainRoutingStatus == null
) {
this.editProcessRow(
params,
params.row.mainRoutingID,
1
)
if (this.tabstatus == '1') {
return h('div', [
h(
'span',
{
props: {
type: 'text',
ghost: true
},
style: {
color: editColor,
cursor: 'pointer'
},
on: {
click: (e) => {
e.stopPropagation()
if (params.row.mainRoutingID != 0) {
if (
params.row.mainRoutingStatus == 4 ||
params.row.mainRoutingStatus == 0 ||
params.row.mainRoutingStatus == -1 ||
params.row.mainRoutingStatus == null
) {
this.editProcessRow(
params,
params.row.mainRoutingID,
1
)
} else {
this.viewProcessRow(
params,
params.row.mainRoutingID,
1
)
}
} else {
this.viewProcessRow(
params,
params.row.mainRoutingID,
1
)
this.addProcessRow(params, 1)
}
} else {
this.addProcessRow(params, 1)
}
}
}
},
content
},
content
)
])
} else {
return h('div', [
h(
'span',
{
props: {
type: 'text',
ghost: true
},
style: {
color: editColor,
cursor: 'pointer'
}
},
content
)
])
}
}
},
{
title: '料单',
key: 'materialbillID',
width: 120,
render: (h, params) => {
if (this.tabstatus == '1') {
h('div', '')
} else {
let id = params.row.id
let editColor1 = ''
let content1 = ''
let gh
let statusarr = this.$store.getters.dictionaryByKey(
'process.RoutingStatus'
)
])
if (params.row.materialbillID == 0) {
gh = statusarr.filter(function(obj) {
return obj.code == -1
})
} else {
gh = statusarr.filter(function(obj) {
return obj.code == params.row.materialbillStatus
})
if (gh == null) {
gh = statusarr.filter(function(obj) {
return obj.code == -1
})
}
}
if (gh != null && gh.length > 0) {
content1 = gh[0].name
editColor1 = gh[0].color
}
return h('div', [
h(
'span',
{
props: {
type: 'text',
ghost: true
},
style: {
color: editColor1,
cursor: 'pointer'
},
on: {
click: (e) => {
e.stopPropagation()
this.savematerialbill(params)
}
}
},
content1
)
])
}
}
}
],
data1: [],
......@@ -631,7 +694,7 @@ export default {
created() {
this.treeHeight = window.innerHeight - 100
this.tableHeight = window.innerHeight - 240
this.newColumn = this.historycolumn
this.newColumn = this.historycolumn;
this.column = this.newColumn
this.loaddata('')
},
......@@ -673,7 +736,16 @@ export default {
},
methods: {
// tab切换
tabChange(name) {
this.tabstatus = name
this.page = 1
this.orderSearchForm.SkipCount = 0
this.newColumn = this.historycolumn
this.column = this.newColumn
this.loaddata(this.orderSearchForm)
},
updateColumn(checkShowColumn) {
this.newColumn = checkShowColumn
},
......@@ -690,6 +762,10 @@ export default {
this.orderSearchForm.SkipCount = 0
this.loaddata({})
},
search()
{
this.easySearch(this.orderSearchForm)
},
//搜索查询
easySearch(params) {
this.page = 1
......@@ -763,9 +839,7 @@ export default {
let count = 1
for (let i = 0; i < this.data1.length; i++) {
let order = this.data1[i]
if (order.specialtyRoutingID != 0 || order.materialbillID != 0) {
this.data1[i]._disabled = true //禁用多选框
}
this.data1[i].orderrowspan = 1
if (i == this.data1.length - 1) {
break
......@@ -847,7 +921,70 @@ export default {
selectedrow(selection) {
this.orderselected = selection
},
specialtyProcess() {
if (this.orderselected == null || this.orderselected.length == 0) {
this.$Message.error('请选择订单!')
}
this.isview = false
let mainids = new Array()
let orderids = new Array()
let productNames = new Array()
var productids1 = new Array()
var productCodes = new Array()
let ids = ''
for (let i = 0; i < this.orderselected.length; i++) {
let obj = this.orderselected[i]
if (productids1.indexOf(obj.productId) < 0) {
productNames.push(obj.productName)
productCodes.push(obj.drawnNumber)
productids1.push(obj.productId)
}
orderids.push(obj.id)
if (obj.mainRoutingID != 0) {
mainids.push(obj.mainRoutingID)
ids += 'ids=' + obj.mainRoutingID + '&'
}
}
if (mainids == null || mainids.length == 0) {
this.$Message.error('请先设置主工艺!')
return
}
this.gymodaltitle = '设置专业工艺规程'
this.createtype = 1
this.modal1 = true
this.addpdefm = this.$refs.processMain
this.addpdefm.clearModal()
this.$refs.processMain.isview = false
this.addpdefm.issetProcess = true
this.addpdefm.dataTop = this.orderselected
for (let i = 0; i < this.addpdefm.dataTop.length; i++) {
this.addpdefm.dataTop[i].perboardnum = 1
}
this.addpdefm.formValidate.productingPreparationPeople = this.orderselected[0].productingPreparationPeople
this.addpdefm.formValidate.id = 0
this.addpdefm.issetProcess = true
this.addpdefm.formValidate.routingType = 2
let that = this
var url = `${designUrl}/routingheader/GetCodeByType?code=ZY`
service.get(`${url}`).then((response) => {
that.addpdefm.formValidate.code = response.data.result
that.addpdefm.gycode = response.data.result
})
this.addpdefm.Mianids = ids.substring(0, ids.length - 1)
this.addpdefm.ProductName = productNames.toString(',')
this.addpdefm.ProductCode = productCodes.toString(',')
this.addpdefm.formValidate.productids = productids1.toString(',')
this.addpdefm.formValidate.orderids = orderids.toString(',')
this.addpdefm.setshow()
},
clearModal() {
this.addpdefm.id = 0
this.addpdefm.formValidate.name = ''
......@@ -876,10 +1013,45 @@ export default {
this.dataListRetrunNew.idList = []
},
modalOk() {
this.SetHeader(false)
if (this.createtype == 2 && this.headerid == 0) {
this.$Message.error('请选择要克隆的工艺规程')
return
} else {
this.addpdefm = this.$refs.processMain
var pernums = new Array()
for (let i = 0; i < this.addpdefm.dataTop.length; i++) {
let obj = this.addpdefm.dataTop[i]
pernums.push(obj.perboardnum)
}
this.addpdefm.formValidate.perboardnums = pernums.toString(',')
if (this.addpdefm.createtype == 3) {
this.SetHeader(false)
} else {
this.saveHeader(false)
}
}
},
nextStepandSave() {
this.SetHeader(true)
this.addpdefm = this.$refs.processMain
var pernums = new Array()
for (let i = 0; i < this.addpdefm.dataTop.length; i++) {
let obj = this.addpdefm.dataTop[i]
pernums.push(obj.perboardnum)
}
this.addpdefm.formValidate.perboardnums = pernums.toString(',')
if (this.addpdefm.createtype == 3) {
this.SetHeader(true)
} else {
this.saveHeader(true)
}
},
nextStep() {
this.addpdefm = this.$refs.processMain
......@@ -899,6 +1071,132 @@ export default {
this.$refs.processNew.loaddata()
},
//保存增加修改
saveHeader(next) {
var a = this.$refs.processMain
if (a.formValidate.routingType == 1) {
this.savebill()
}
var filelist = a.getfile()
let isvalidate = false
a.$refs['formValidate'].validate((valid) => {
if (valid) {
isvalidate = valid
} else {
}
})
if (!isvalidate) {
return
}
var ar = this.data1.find((val) => {
return val.code == a.formValidate.code
})
if (ar && a.formValidate.id == 0) {
this.$Message.error('产品文件编号已存在')
return
}
if (a.formValidate.code != null) {
let orders = a.dataTop
var url = `${designUrl}/routingheader/createorupdate`
// JSON.stringify({Process:this.formValidate})
service
.post(
`${url}`,
JSON.stringify({
routingHeaderEntity: a.formValidate,
FileList: filelist
})
)
.then((response) => {
if (response.data.success) {
if (!next) {
if (this.createtype == 1 || this.createtype == 3) {
this.$Message.success('保存成功')
}
}
this.loaddata(this.orderSearchForm)
this.headeroldid = a.selectpdefmid
this.headerInfo = a.formValidate
let versioncode = this.headerInfo.versioncode
let task_type = this.headerInfo.task_type
let development_mode = this.headerInfo.development_mode
let print_data_versioncode = this.headerInfo
.print_data_versioncode
a.formValidate = response.data.result
a.formValidate.versioncode = versioncode
a.formValidate.task_type = task_type
a.formValidate.development_mode = development_mode
a.formValidate.print_data_versioncode = print_data_versioncode
this.headerInfo.id = response.data.result.id
// this.modal1 = false
this.headerid = response.data.result.id
this.detailInfo = response.data.result
this.detailInfo.productName = this.headerInfo.productName
this.detailInfo.routingTypeDesc = this.headerInfo.routingTypeDesc
let ordercombid = a.formValidate.ordercombid
let routingType = a.formValidate.routingType
// alert(JSON.stringify(this.detailInfo))
if (this.headeroldid != 0) {
var url =
`${designUrl}/routingdetail/copybyheader?headerID=` +
this.headeroldid +
'&headerNewID=' +
this.headerid
service.post(`${url}`).then((response) => {
if (response.data.success) {
if (next) {
this.headeroldid = 0
a.selectpdefmid = 0
this.modalShow = true
this.$refs.processNew.formprocessValidate.routing_header_id = this.headerid
this.$refs.processNew.isview = false
this.$refs.processNew.loaddata()
} else {
this.$Message.success('克隆成功')
this.headeroldid = 0
a.selectpdefmid = 0
this.editProcess(
ordercombid,
this.headerid,
routingType,
orders
)
}
}
})
} else {
if (next) {
this.modalShow = true
this.$refs.processNew.formprocessValidate.routing_header_id = this.headerid
this.$refs.processNew.isview = false
this.$refs.processNew.loaddata()
} else {
if (this.issendAudit) {
this.saveDocument()
}
}
}
}
})
.catch((error) => {
this.$Message.error('保存失败')
})
} else {
this.$Message.error('请输入工艺文件编号')
}
},
SetHeader(next) {
if (this.addpdefm.formValidate.id == 0) {
this.$Message.error('请选择要绑定的工艺规程')
......@@ -910,6 +1208,10 @@ export default {
this.$refs.processNew.formprocessValidate.routing_header_id = this.headerid
this.$refs.processNew.loaddata()
} else {
if (this.addpdefm.formValidate.routingType == 1) {
this.savebill()
}
var a = this.addpdefm
this.headerid = this.addpdefm.formValidate.id
var orderRoutingobj = {
......@@ -993,7 +1295,10 @@ export default {
modalShowCancel() {
this.modalShow = false
},
savebill() {
this.$refs.modelTable.$refs.quotationBox2.saveData()
this.$refs.modelTable.$refs.quotationBox3.saveData()
},
saveOK() {
var url = `${PlanUrl}/OrderMaterial/createorupdate`
// JSON.stringify({Process:this.formValidate})
......@@ -1027,16 +1332,57 @@ export default {
let orderids = new Array()
let ordercombid = 0
this.createtype = 1
if (routingType == 1) {
this.gymodaltitle = '设置主工艺规程'
this.gymodaltitle = '设置工艺规程'
for (let i = 0; i < this.data1.length; i++) {
let obj1 = this.data1[i]
for (let i = 0; i < this.data1.length; i++) {
let obj1 = this.data1[i]
if (obj1.id == params.row.id) {
// obj.perboardnum = 1
orderlist.push(obj1)
orderids.push(obj1.id)
}
}
this.$refs.modelTable.issetProcess1 = true
this.$refs.modelTable.selectFault = 'greateArt'
if (obj1.id == params.row.id) {
// obj.perboardnum = 1
orderlist.push(obj1)
orderids.push(obj1.id)
this.$refs.modelTable.$refs.quotationBox2.loadData(
orderids.toString(',')
)
this.$refs.modelTable.$refs.quotationBox3.loadData(
orderids.toString(',')
)
this.$refs.modelTable.$refs.quotationBox2.isview = this.isview
this.$refs.modelTable.$refs.quotationBox3.isview = this.isview
} else {
this.$refs.modelTable.issetProcess1 = false
this.gymodaltitle = '设置专业工艺规程'
ordercombid = params.row.specialtyOrderCombID
if (ordercombid != 0) {
this.$refs.modelTable.issetProcess1 = false
this.addpdefm.formValidate.ordercombid = ordercombid
for (let i = 0; i < this.data1.length; i++) {
let obj = this.data1[i]
if (obj.specialtyOrderCombID == ordercombid) {
orderlist.push(obj)
orderids.push(obj.id)
}
}
} else {
for (let i = 0; i < this.data1.length; i++) {
let obj1 = this.data1[i]
if (obj1.id == params.row.id) {
// obj.perboardnum = 1
orderlist.push(obj1)
orderids.push(obj1.id)
}
}
}
}
......@@ -1103,7 +1449,16 @@ export default {
let orderids = new Array()
let orderlist = new Array()
if (routingType == 1) {
// ordercombid = params.row.orderCombID
this.$refs.modelTable.issetProcess1 = true
this.$refs.modelTable.$refs.quotationBox2.isview = this.isview
this.$refs.modelTable.$refs.quotationBox3.isview = this.isview
} else {
// ordercombid = params.row.specialtyOrderCombID
this.$refs.modelTable.issetProcess1 = false
}
this.addpdefm.formValidate.ordercombid = ordercombid
if (orders == null) {
for (let i = 0; i < this.data1.length; i++) {
......@@ -1136,10 +1491,20 @@ export default {
}
this.addpdefm.dataTop = orderlist
if (routingType == 1) {
this.$refs.modelTable.$refs.quotationBox2.loadData(
orderids.toString(',')
)
this.$refs.modelTable.$refs.quotationBox3.loadData(
orderids.toString(',')
)
this.$refs.modelTable.selectFault = 'greateArt'
}
if (routingType == 1) {
this.gymodaltitle = '设置工艺规程'
} else {
this.gymodaltitle = '设置工艺规程'
}
var url = `${designUrl}/routingheader/getbyid?id=` + RoutingID
service.get(`${url}`).then((response) => {
......@@ -1173,9 +1538,13 @@ export default {
let orderids = new Array()
let orderlist = new Array()
let ordercombid = 0
if (routingType == 1) {
ordercombid = params.row.orderCombID
this.$refs.modelTable.issetProcess1 = true
} else {
ordercombid = params.row.specialtyOrderCombID
this.$refs.modelTable.issetProcess1 = false
}
this.addpdefm.formValidate.ordercombid = ordercombid
for (let i = 0; i < this.data1.length; i++) {
let obj = this.data1[i]
......@@ -1198,10 +1567,22 @@ export default {
}
this.addpdefm.dataTop = orderlist
this.gymodaltitle = '查看工艺规程'
if (routingType == 1) {
this.$refs.modelTable.$refs.quotationBox2.loadData(
orderids.toString(',')
)
this.$refs.modelTable.$refs.quotationBox3.loadData(
orderids.toString(',')
)
this.$refs.modelTable.selectFault = 'greateArt'
this.$refs.modelTable.$refs.quotationBox2.isview = this.isview
this.$refs.modelTable.$refs.quotationBox3.isview = this.isview
}
if (routingType == 1) {
this.gymodaltitle = '查看工艺规程'
} else {
this.gymodaltitle = '查看工艺规程'
}
var url = `${designUrl}/routingheader/getbyid?id=` + RoutingID
service.get(`${url}`).then((response) => {
this.addpdefm.formValidate = response.data.result
......@@ -1231,7 +1612,9 @@ export default {
this.addpdefm.formValidate = this.headerInfo
this.addpdefm.isview = this.isview
this.$refs.modelTable.$refs.quotationBox2.isview = this.isview
this.$refs.modelTable.$refs.quotationBox3.isview = this.isview
this.addpdefm.ProductName = this.headerInfo.productName
this.addpdefm.ProductCode = this.headerInfo.productCode
......@@ -1392,29 +1775,7 @@ export default {
this.modalInfo = false
this.dataListRetrunNew.idList = []
},
showorderdata(params) {
//数据审查
this.orderDatadia = true
let dd = this.$refs.orderData
let orderids = new Array()
for (let i = 0; i < this.data1.length; i++) {
let obj = this.data1[i]
if (obj.specialtyOrderCombID == params.row.specialtyOrderCombID) {
orderids.push(obj.id)
}
}
dd.order_comb_id = params.row.specialtyOrderCombID
dd.orderids = orderids.toString(',')
dd.formValidate.id = params.row.datamodelID
dd.loaddata()
},
passDocument() {
this.dataListRetrun = []
......
<style lang="less">
@import '../Process/menu.less';
@import "../Process/menu.less";
</style>
<template>
<div class="quotation-box">
......@@ -15,7 +15,7 @@
:loading="loading"
>-->
<div class="top_part">
<!-- <RadioGroup
<RadioGroup
v-if="!isedit"
v-model="createtype"
@on-change="onchange_createtype"
......@@ -27,12 +27,12 @@
<Radio label="2">
<span>克隆工艺流程</span>
</Radio>
<Radio v-if="issetProcess" label="3">
<Radio label="3">
<span>选择工艺流程</span>
</Radio>
</RadioGroup>-->
</RadioGroup>
<Select
v-show="createtype!='1'"
class="select_order"
v-model="selectpdefmid"
filterable
......@@ -183,32 +183,32 @@
</div>
</template>
<script>
import service from '@/plugins/request'
import processfile from '../Process/processfile.vue'
import service from "@/plugins/request";
import processfile from "../Process/processfile.vue";
export default {
name: 'processMain',
name: "processMain",
components: {
processfile
},
data() {
return {
fileparms: {
app: 'process',
eid: '10000',
name: ''
app: "process",
eid: "10000",
name: ""
},
RoutingList: {},
components: {},
ruleValidate: {
code: [
{ required: true, message: '工艺文件编号不能为空', trigger: 'blur' }
{ required: true, message: "工艺文件编号不能为空", trigger: "blur" }
],
// number:[{required: true,type:'number'}],
name: [
{ required: true, message: '工艺文件名称不能为空', trigger: 'blur' }
{ required: true, message: "工艺文件名称不能为空", trigger: "blur" }
]
},
createtype: '1',
createtype: "1",
taskTypeList: [], //任务类型
developmentList: [], //研制方式
versionList: [], //版本
......@@ -217,20 +217,20 @@ export default {
isshow: false,
ischangeshow: false,
isshow_selectpdefm: false,
issetProcess: false,
selectpdefmid: 0,
oldformValidate: {},
processList: [],
gycode: '',
gycode: "",
platesnum: 1,
formValidate: {
id: 0,
unicode: '',
name: '',
code: '',
unicode: "",
name: "",
code: "",
product_id: 0,
productids: '',
version: '1',
productids: "",
version: "1",
versioncode: 1,
author: 0,
department_id: 0,
......@@ -239,59 +239,59 @@ export default {
up_detail_id: 0,
routingType: 0,
status: 0,
remark: '',
remark: "",
development_mode: 1,
development_mode_str: '1',
change_order_code: '',
change_order_date: '',
change_method: '',
development_mode_str: "1",
change_order_code: "",
change_order_date: "",
change_method: "",
task_type: 1,
task_type_str: '1',
task_type_str: "1",
change_order_id: 0,
print_data_name: '',
production_batch: '',
print_data_version: '',
print_data_name: "",
production_batch: "",
print_data_version: "",
print_data_versioncode: 0,
platesnum: 1,
orderids: '',
orderids: "",
ordercombid: 0,
perboardnums: '',
productingPreparationPeople: '',
file_Path: '',
perboardnums: "",
productingPreparationPeople: "",
file_Path: "",
oldid: 0
},
ProductCode: '',
ProductName: '',
Mianids: '',
MianVer: '',
MianCode: '',
ProductCode: "",
ProductName: "",
Mianids: "",
MianVer: "",
MianCode: "",
dataTop: [],
columnTop: [
{
title: '订单编号',
key: 'mesCode',
align: 'center'
title: "订单编号",
key: "mesCode",
align: "center"
},
{
title: '产品名称',
key: 'productName',
align: 'center'
title: "产品名称",
key: "productName",
align: "center"
},
{
title: '产品图号',
key: 'drawnNumber',
align: 'center'
title: "产品图号",
key: "drawnNumber",
align: "center"
},
{
title: '任务类型',
key: 'taskTypeName',
align: 'center'
title: "任务类型",
key: "taskTypeName",
align: "center"
},
{
title: '数量',
key: 'quantity',
align: 'center'
title: "数量",
key: "quantity",
align: "center"
},
// {
// title: '每版数量',
......@@ -299,12 +299,34 @@ export default {
// align: 'center'
// }
{
title: '每板数量',
key: 'perboardnum',
align: 'center'
title: "每板数量",
key: "perboardnum",
align: "center",
render: (h, params) => {
if (this.isview && this.createtype != 3) {
return h("div", this.dataTop[params.index].perboardnum);
} else if (this.formValidate.routingType == 1) {
return h("div", "");
} else {
return h("div", [
h("InputNumber", {
props: {
value: this.dataTop[params.index].perboardnum,
min: 1
},
on: {
"on-change": event => {
this.dataTop[params.index].perboardnum = event;
this.calcplatesnum();
}
}
})
]);
}
}
}
]
}
};
},
mounted() {},
created() {},
......@@ -312,64 +334,81 @@ export default {
methods: {
uuid() {
var s = []
var hexDigits = '0123456789abcdef'
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1)
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[14] = '4' // bits 12-15 of the time_hi_and_version field to 0010
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1) // bits 6-7 of the clock_seq_hi_and_reserved to 01
s[8] = s[13] = s[18] = s[23] = '-'
s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
s[8] = s[13] = s[18] = s[23] = "-";
var uuid = s.join('')
return uuid
var uuid = s.join("");
return uuid;
},
Loadfile(id) {
if (id == 0) {
this.fileparms.eid = this.uuid()
this.$refs.refFile.routing_header_id = 0
this.fileparms.eid = this.uuid();
this.$refs.refFile.routing_header_id = 0;
} else {
this.fileparms.eid = id
this.$refs.refFile.routing_header_id = id
this.fileparms.eid = id;
this.$refs.refFile.routing_header_id = id;
}
this.$refs.refFile.unClosable = this.isview
this.$refs.refFile.intFiles()
this.$refs.refFile.unClosable = this.isview;
this.$refs.refFile.intFiles();
},
l(key) {
key = "routing_header" + "." + key;
return this.$t(key)
},
calcplatesnum() {
//计算板数
let boardnum = 1;
if (this.dataTop != null && this.dataTop.length > 0) {
for (let i = 0; i < this.dataTop.length; i++) {
let remainder =
this.dataTop[i].quantity % this.dataTop[i].perboardnum; //余数
let count = this.dataTop[i].quantity / this.dataTop[i].perboardnum; //得数
let boardnum1 = remainder > 0 ? parseInt(count) + 1 : parseInt(count);
if (boardnum1 > boardnum) {
boardnum = boardnum1;
}
}
}
this.formValidate.platesnum = boardnum;
this.platesnum = boardnum;
},
updateEid(newId) {
let parms = {
eid: this.fileparms.eid,
id: newId + ''
}
this.$http.sysUser.updateEid(parms).then((res) => {
id: newId + ""
};
this.$http.sysUser.updateEid(parms).then(res => {
if (res.status) {
// this.$Message.success('修改成功!')
// this.modalAvatar = false
} else {
//this.$Message.error('修改失败!')
}
})
},
l(key) {
key = 'routing_header' + '.' + key
return this.$t(key)
});
},
getfile() {
return this.$refs.refFile.nameList
return this.$refs.refFile.nameList;
},
clearModal() {
this.id = 0
this.formValidate.name = ''
this.formValidate.version = '1'
this.formValidate.versioncode = 1
this.formValidate.task_type_str = '1'
this.formValidate.print_data_name = ''
this.formValidate.print_data_version = '1'
this.formValidate.print_data_versioncode = 1
this.formValidate.production_batch = ''
this.formValidate.platesnum = 1
this.id = 0;
this.formValidate.name = "";
this.formValidate.version = "1";
this.formValidate.versioncode = 1;
this.formValidate.task_type_str = "1";
this.formValidate.print_data_name = "";
this.formValidate.print_data_version = "1";
this.formValidate.print_data_versioncode = 1;
this.formValidate.production_batch = "";
this.formValidate.platesnum = 1;
this.formValidate.remark = ''
this.formValidate.remark = "";
// // this.Mianids = ''
// // this.MianCode = ''
// // this.MianVer = ''
......@@ -378,22 +417,22 @@ export default {
// this.formValidate.change_order_date = ''
// this.formValidate.change_method = ''
// this.formValidate.change_order_id = 0
this.fileparms.eid = this.uuid()
this.$refs.refFile.routing_header_id = 0
this.$refs.refFile.intFiles()
this.fileparms.eid = this.uuid();
this.$refs.refFile.routing_header_id = 0;
this.$refs.refFile.intFiles();
},
clearModal2() {
this.id = 0
this.formValidate.name = ''
this.formValidate.version = '1'
this.formValidate.versioncode = 1
this.formValidate.task_type_str = '1'
this.formValidate.print_data_name = ''
this.formValidate.print_data_version = '1'
this.formValidate.print_data_versioncode = 1
this.formValidate.production_batch = ''
this.id = 0;
this.formValidate.name = "";
this.formValidate.version = "1";
this.formValidate.versioncode = 1;
this.formValidate.task_type_str = "1";
this.formValidate.print_data_name = "";
this.formValidate.print_data_version = "1";
this.formValidate.print_data_versioncode = 1;
this.formValidate.production_batch = "";
this.formValidate.remark = ''
this.formValidate.remark = "";
// // this.Mianids = ''
// // this.MianCode = ''
// // this.MianVer = ''
......@@ -402,83 +441,164 @@ export default {
// this.formValidate.change_order_date = ''
// this.formValidate.change_method = ''
// this.formValidate.change_order_id = 0
this.fileparms.eid = this.uuid()
this.$refs.refFile.routing_header_id = 0
this.$refs.refFile.intFiles()
this.fileparms.eid = this.uuid();
this.$refs.refFile.routing_header_id = 0;
this.$refs.refFile.intFiles();
},
LoadprocessList() {
this.processList = [];
let url = `${designUrl}/routingheader/getlistbyids?` + this.Mianids,
that = this;
service.get(`${url}`).then(res => {
let selectdata = res.data.result;
selectdata.forEach(item => {
this.processList.push({
value: item.id,
name: item.code,
ver: item.version
});
});
this.formValidate.up_id = this.processList[0].value;
this.MianVer = this.processList[0].ver;
this.MianCode = this.processList[0].name;
});
},
MainProcess_selected(val) {
//这里的val默认拿到的是:value绑定的那个
this.formValidate.up_id = val;
this.processList.forEach(item => {
if (val == item.value) {
this.MianVer = item.ver;
}
});
},
quotationBox() {
this.$refs.generateQuotation.modalShow = true;
},
previousStep() {
this.modalShow = false
this.modalShow = false;
},
handleChange(date) {
this.formValidate.mydate = date
this.formValidate.mydate = date;
},
onchange_createtype() {
this.isshow_selectpdefm = true
this.selectpdefmid = 0
this.formValidate.id = 0
this.bindRoutinglist(this.formValidate.productids)
if (this.createtype == 1) {
this.isshow_selectpdefm = false;
this.clearModal2();
this.selectpdefmid = 0;
this.isview = false;
this.$refs.refFile.unClosable = this.isview;
this.setparentcreatetype(1, 0);
this.formValidate.code = this.gycode;
this.formValidate.platesnum = this.platesnum;
} else if (this.createtype == 2) {
this.isshow_selectpdefm = true;
this.selectpdefmid = 0;
this.formValidate.id = 0;
this.bindRoutinglist(0);
this.isview = false;
this.$refs.refFile.unClosable = this.isview;
this.formValidate.code = this.gycode;
this.formValidate.platesnum = this.platesnum;
this.setparentcreatetype(2, 0);
} else if (this.createtype == 3) {
this.isshow_selectpdefm = true;
this.selectpdefmid = 0;
this.formValidate.id = 0;
this.bindRoutinglist(this.formValidate.productids);
this.isview = true
this.isview = true;
this.$refs.refFile.unClosable = this.isview
this.setparentcreatetype(3, 0)
this.$refs.refFile.unClosable = this.isview;
this.setparentcreatetype(3, 0);
}
},
onchange_selectpdefm(val) {
if (this.selectpdefmid == 0 || typeof this.selectpdefmid == 'undefined') {
return
if (this.selectpdefmid == 0 || typeof this.selectpdefmid == "undefined") {
return;
}
var url = `${designUrl}/routingheader/getbyid?id=` + this.selectpdefmid
service.get(`${url}`).then((response) => {
this.oldformValidate = this.formValidate
var url = `${designUrl}/routingheader/getbyid?id=` + this.selectpdefmid;
service.get(`${url}`).then(response => {
this.oldformValidate = this.formValidate;
this.formValidate = response.data.result
this.formValidate = response.data.result;
this.formValidate.up_id = this.oldformValidate.up_id
this.formValidate.productids = this.oldformValidate.productids
this.formValidate.up_id = this.oldformValidate.up_id;
this.formValidate.productids = this.oldformValidate.productids;
this.formValidate.orderids = this.oldformValidate.orderids
this.formValidate.productingPreparationPeople = this.oldformValidate.productingPreparationPeople
this.formValidate.orderids = this.oldformValidate.orderids;
this.formValidate.productingPreparationPeople = this.oldformValidate.productingPreparationPeople;
this.formValidate.platesnum = this.platesnum
this.$refs.refFile.routing_header_id = this.selectpdefmid
if (this.createtype == 2) {
this.formValidate.code = this.gycode;
}
this.formValidate.platesnum = this.platesnum;
this.$refs.refFile.routing_header_id = this.selectpdefmid;
this.$refs.refFile.intFiles()
this.$refs.refFile.intFiles();
//this.setshow()
this.setparentcreatetype(3, response.data.result.id)
})
if (this.createtype == 2) {
this.setparentcreatetype(2, response.data.result.id);
this.formValidate.id = 0; //克隆为新建,id设置为0
}
if (this.createtype == 3) {
//只读
this.setparentcreatetype(3, response.data.result.id);
}
});
},
setparentcreatetype(type, headerid) {
this.$parent.$parent.$parent.createtype = type
this.$parent.$parent.$parent.headerid = headerid
this.$parent.$parent.$parent.createtype = type;
this.$parent.$parent.$parent.headerid = headerid;
},
bindRoutinglist(productid) {
var url =
`${designUrl}/routingheader/GetListSmall?approvalstatus=1&product_id=` +
productid +
'&routingType=' +
this.formValidate.routingType
service.get(`${url}`).then((response) => {
this.RoutingList = response.data.result
})
"&routingType=" +
this.formValidate.routingType;
service.get(`${url}`).then(response => {
this.RoutingList = response.data.result;
});
},
setshow() {
if (this.formValidate.routingType == 2) {
this.isshow = true;
} else {
this.isshow = false;
}
if (this.formValidate.id != 0) {
this.isedit = true
this.isedit = true;
this.Loadfile(this.formValidate.id)
this.Loadfile(this.formValidate.id);
} else {
this.isedit = false
this.Loadfile(0)
this.isedit = false;
this.Loadfile(0);
}
if (this.Mianids != "") {
this.LoadprocessList();
}
this.selectpdefmid = 0
this.onchange_createtype()
this.createtype = "1";
this.selectpdefmid = 0;
this.RoutingList = [];
this.calcplatesnum();
}
}
}
};
</script>
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