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

设置工艺规程

parents e204bba9 af027958
...@@ -5,11 +5,8 @@ ...@@ -5,11 +5,8 @@
<Button @click="open" type="text"><Icon type="md-search" />高级</Button> <Button @click="open" type="text"><Icon type="md-search" />高级</Button>
<!-- <Input v-model="value" placeholder="关键字" style="width:300px;" :clearable='true'> <!-- <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> <Button @click="easySearch" icon="ios-search-outline" slot="append" style="width:40px;background-color:#249E91;color:#FFF;"></Button>
</Input> --> </Input> -->
</div> </div>
<!-- 右侧按钮 --> <!-- 右侧按钮 -->
<slot name="button"></slot> <slot name="button"></slot>
<!-- 弹出高级搜索框 --> <!-- 弹出高级搜索框 -->
......
...@@ -133,8 +133,8 @@ export default { ...@@ -133,8 +133,8 @@ export default {
columnsCur: [], columnsCur: [],
configLoad: false, configLoad: false,
userConfig: null, //用户页面配置信息。, userConfig: null, //用户页面配置信息。,
userId: 1 // userId: 1
// userId: this.$store.state.userInfo.userId userId: this.$store.state.userInfo.userId
} }
}, },
props: { props: {
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
</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">
...@@ -33,12 +34,12 @@ ...@@ -33,12 +34,12 @@
v-model="searchIterms" v-model="searchIterms"
placeholder="请输入订单编号" placeholder="请输入订单编号"
@on-search="easySearch" @on-search="easySearch"
></Input> />
<Button type="primary" class="title_btn" @click="searchModel">高级查询</Button> <Button type="primary" class="title_btn" @click="searchModel">高级查询</Button>
</div> </div>
</div> </div>
<div class="fr"></div>
</div> </div>
<!-- 高级搜索弹框 draggable --> <!-- 高级搜索弹框 draggable -->
...@@ -200,7 +201,7 @@ ...@@ -200,7 +201,7 @@
</Form> </Form>
<div slot="footer"> <div slot="footer">
<Button @click="close" style="margin-left:20px;">取消</Button> <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> </div>
</Modal> </Modal>
...@@ -243,9 +244,20 @@ ...@@ -243,9 +244,20 @@
:mask-closable="false" :mask-closable="false"
:loading="myloading" :loading="myloading"
> >
<processMain ref="processMain"></processMain> <processMain ref="processMain" :issetProcess="true"></processMain>
<div v-if="!isview" slot="footer" v-model="greateArtmodel"> <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="text" size="large" @click="saveCancelModel">取消</Button>
<Button type="primary" size="large" @click="modalOk">绑定</Button> <Button type="primary" size="large" @click="modalOk">绑定</Button>
<Button type="primary" size="large" @click="nextStep">查看详情</Button> <Button type="primary" size="large" @click="nextStep">查看详情</Button>
...@@ -302,21 +314,7 @@ ...@@ -302,21 +314,7 @@
<Button type="primary" @click="upSave">确定送审</Button> <Button type="primary" @click="upSave">确定送审</Button>
</div> </div>
</Modal> </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 <Modal
v-model="documentShow" v-model="documentShow"
...@@ -350,7 +348,7 @@ import DrawerSet from './components/drawerSet.vue' //抽屉列表 ...@@ -350,7 +348,7 @@ 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 orderData from './components/orderData.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'
...@@ -368,8 +366,8 @@ export default { ...@@ -368,8 +366,8 @@ export default {
orderMaterial, orderMaterial,
OrderSendReview, OrderSendReview,
processview, processview,
sendAudit, sendAudit
orderData
}, },
data() { data() {
return { return {
...@@ -401,7 +399,7 @@ export default { ...@@ -401,7 +399,7 @@ export default {
processviewModal: false, //工艺预览 processviewModal: false, //工艺预览
documentShow: false, //工艺送审 documentShow: false, //工艺送审
modalliao: false, modalliao: false,
orderDatadia: false,
ProductingPreparationPeople: 0, ProductingPreparationPeople: 0,
checked: true, //送审选择框 checked: true, //送审选择框
modalInfo: false, //校验送审弹框 modalInfo: false, //校验送审弹框
...@@ -521,28 +519,13 @@ export default { ...@@ -521,28 +519,13 @@ export default {
fixed: 'left' fixed: 'left'
}, },
{ title: '图号', key: 'drawnNumber', width: 120 }, { 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: 'quantity', width: 80, align: 'center' },
{ title: '外包络尺寸', key: 'outer_Envelope_Size', width: 120 },
{ title: '外协要求', key: 'inhouseOffice', width: 140 },
{ {
title: '设置工艺', title: '工艺',
key: 'mainRoutingID', key: 'mainRoutingID',
width: 120, width: 120,
render: (h, params) => { render: (h, params) => {
...@@ -573,52 +556,132 @@ export default { ...@@ -573,52 +556,132 @@ export default {
content = gh[0].name content = gh[0].name
editColor = gh[0].color editColor = gh[0].color
} }
if (this.tabstatus == '1') {
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 ||
params.row.mainRoutingStatus == 0 || params.row.mainRoutingStatus == 0 ||
params.row.mainRoutingStatus == -1 || params.row.mainRoutingStatus == -1 ||
params.row.mainRoutingStatus == null params.row.mainRoutingStatus == null
) { ) {
this.editProcessRow( this.editProcessRow(
params, params,
params.row.mainRoutingID, params.row.mainRoutingID,
1 1
) )
} else {
this.viewProcessRow(
params,
params.row.mainRoutingID,
1
)
}
} else { } else {
this.viewProcessRow( this.addProcessRow(params, 1)
params,
params.row.mainRoutingID,
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: [], data1: [],
...@@ -631,7 +694,7 @@ export default { ...@@ -631,7 +694,7 @@ export default {
created() { created() {
this.treeHeight = window.innerHeight - 100 this.treeHeight = window.innerHeight - 100
this.tableHeight = window.innerHeight - 240 this.tableHeight = window.innerHeight - 240
this.newColumn = this.historycolumn this.newColumn = this.historycolumn;
this.column = this.newColumn this.column = this.newColumn
this.loaddata('') this.loaddata('')
}, },
...@@ -673,7 +736,16 @@ export default { ...@@ -673,7 +736,16 @@ export default {
}, },
methods: { methods: {
// tab切换 // 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) { updateColumn(checkShowColumn) {
this.newColumn = checkShowColumn this.newColumn = checkShowColumn
}, },
...@@ -690,6 +762,10 @@ export default { ...@@ -690,6 +762,10 @@ export default {
this.orderSearchForm.SkipCount = 0 this.orderSearchForm.SkipCount = 0
this.loaddata({}) this.loaddata({})
}, },
search()
{
this.easySearch(this.orderSearchForm)
},
//搜索查询 //搜索查询
easySearch(params) { easySearch(params) {
this.page = 1 this.page = 1
...@@ -763,9 +839,7 @@ export default { ...@@ -763,9 +839,7 @@ export default {
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]
if (order.specialtyRoutingID != 0 || order.materialbillID != 0) {
this.data1[i]._disabled = true //禁用多选框
}
this.data1[i].orderrowspan = 1 this.data1[i].orderrowspan = 1
if (i == this.data1.length - 1) { if (i == this.data1.length - 1) {
break break
...@@ -847,7 +921,70 @@ export default { ...@@ -847,7 +921,70 @@ export default {
selectedrow(selection) { selectedrow(selection) {
this.orderselected = 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() { clearModal() {
this.addpdefm.id = 0 this.addpdefm.id = 0
this.addpdefm.formValidate.name = '' this.addpdefm.formValidate.name = ''
...@@ -876,10 +1013,45 @@ export default { ...@@ -876,10 +1013,45 @@ export default {
this.dataListRetrunNew.idList = [] this.dataListRetrunNew.idList = []
}, },
modalOk() { 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() { 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() { nextStep() {
this.addpdefm = this.$refs.processMain this.addpdefm = this.$refs.processMain
...@@ -899,6 +1071,132 @@ export default { ...@@ -899,6 +1071,132 @@ export default {
this.$refs.processNew.loaddata() 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) { SetHeader(next) {
if (this.addpdefm.formValidate.id == 0) { if (this.addpdefm.formValidate.id == 0) {
this.$Message.error('请选择要绑定的工艺规程') this.$Message.error('请选择要绑定的工艺规程')
...@@ -910,6 +1208,10 @@ export default { ...@@ -910,6 +1208,10 @@ export default {
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 {
if (this.addpdefm.formValidate.routingType == 1) {
this.savebill()
}
var a = this.addpdefm var a = this.addpdefm
this.headerid = this.addpdefm.formValidate.id this.headerid = this.addpdefm.formValidate.id
var orderRoutingobj = { var orderRoutingobj = {
...@@ -993,7 +1295,10 @@ export default { ...@@ -993,7 +1295,10 @@ export default {
modalShowCancel() { modalShowCancel() {
this.modalShow = false this.modalShow = false
}, },
savebill() {
this.$refs.modelTable.$refs.quotationBox2.saveData()
this.$refs.modelTable.$refs.quotationBox3.saveData()
},
saveOK() { saveOK() {
var url = `${PlanUrl}/OrderMaterial/createorupdate` var url = `${PlanUrl}/OrderMaterial/createorupdate`
// JSON.stringify({Process:this.formValidate}) // JSON.stringify({Process:this.formValidate})
...@@ -1027,16 +1332,57 @@ export default { ...@@ -1027,16 +1332,57 @@ export default {
let orderids = new Array() let orderids = new Array()
let ordercombid = 0 let ordercombid = 0
this.createtype = 1 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++) { if (obj1.id == params.row.id) {
let obj1 = this.data1[i] // 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) { this.$refs.modelTable.$refs.quotationBox2.loadData(
// obj.perboardnum = 1 orderids.toString(',')
orderlist.push(obj1) )
orderids.push(obj1.id) 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 { ...@@ -1103,7 +1449,16 @@ export default {
let orderids = new Array() let orderids = new Array()
let orderlist = 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 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++) {
...@@ -1136,10 +1491,20 @@ export default { ...@@ -1136,10 +1491,20 @@ export default {
} }
this.addpdefm.dataTop = orderlist 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 = '设置工艺规程' this.gymodaltitle = '设置工艺规程'
} else {
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) => {
...@@ -1173,9 +1538,13 @@ export default { ...@@ -1173,9 +1538,13 @@ export default {
let orderids = new Array() let orderids = new Array()
let orderlist = new Array() let orderlist = new Array()
let ordercombid = 0 let ordercombid = 0
if (routingType == 1) {
ordercombid = params.row.orderCombID ordercombid = params.row.orderCombID
this.$refs.modelTable.issetProcess1 = true
} else {
ordercombid = params.row.specialtyOrderCombID
this.$refs.modelTable.issetProcess1 = false
}
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]
...@@ -1198,10 +1567,22 @@ export default { ...@@ -1198,10 +1567,22 @@ export default {
} }
this.addpdefm.dataTop = orderlist this.addpdefm.dataTop = orderlist
if (routingType == 1) {
this.$refs.modelTable.$refs.quotationBox2.loadData(
this.gymodaltitle = '查看工艺规程' 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 var url = `${designUrl}/routingheader/getbyid?id=` + RoutingID
service.get(`${url}`).then((response) => { service.get(`${url}`).then((response) => {
this.addpdefm.formValidate = response.data.result this.addpdefm.formValidate = response.data.result
...@@ -1231,7 +1612,9 @@ export default { ...@@ -1231,7 +1612,9 @@ export default {
this.addpdefm.formValidate = this.headerInfo this.addpdefm.formValidate = this.headerInfo
this.addpdefm.isview = this.isview 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.ProductName = this.headerInfo.productName
this.addpdefm.ProductCode = this.headerInfo.productCode this.addpdefm.ProductCode = this.headerInfo.productCode
...@@ -1392,29 +1775,7 @@ export default { ...@@ -1392,29 +1775,7 @@ export default {
this.modalInfo = false this.modalInfo = false
this.dataListRetrunNew.idList = [] 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() { passDocument() {
this.dataListRetrun = [] this.dataListRetrun = []
......
<style lang="less"> <style lang="less">
@import '../Process/menu.less'; @import "../Process/menu.less";
</style> </style>
<template> <template>
<div class="quotation-box"> <div class="quotation-box">
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
:loading="loading" :loading="loading"
>--> >-->
<div class="top_part"> <div class="top_part">
<!-- <RadioGroup <RadioGroup
v-if="!isedit" v-if="!isedit"
v-model="createtype" v-model="createtype"
@on-change="onchange_createtype" @on-change="onchange_createtype"
...@@ -27,12 +27,12 @@ ...@@ -27,12 +27,12 @@
<Radio label="2"> <Radio label="2">
<span>克隆工艺流程</span> <span>克隆工艺流程</span>
</Radio> </Radio>
<Radio v-if="issetProcess" label="3"> <Radio label="3">
<span>选择工艺流程</span> <span>选择工艺流程</span>
</Radio> </Radio>
</RadioGroup>--> </RadioGroup>
<Select <Select
v-show="createtype!='1'"
class="select_order" class="select_order"
v-model="selectpdefmid" v-model="selectpdefmid"
filterable filterable
...@@ -183,32 +183,32 @@ ...@@ -183,32 +183,32 @@
</div> </div>
</template> </template>
<script> <script>
import service from '@/plugins/request' import service from "@/plugins/request";
import processfile from '../Process/processfile.vue' import processfile from "../Process/processfile.vue";
export default { export default {
name: 'processMain', name: "processMain",
components: { components: {
processfile processfile
}, },
data() { data() {
return { return {
fileparms: { fileparms: {
app: 'process', app: "process",
eid: '10000', eid: "10000",
name: '' name: ""
}, },
RoutingList: {}, RoutingList: {},
components: {}, components: {},
ruleValidate: { ruleValidate: {
code: [ code: [
{ required: true, message: '工艺文件编号不能为空', trigger: 'blur' } { required: true, message: "工艺文件编号不能为空", trigger: "blur" }
], ],
// number:[{required: true,type:'number'}], // number:[{required: true,type:'number'}],
name: [ name: [
{ required: true, message: '工艺文件名称不能为空', trigger: 'blur' } { required: true, message: "工艺文件名称不能为空", trigger: "blur" }
] ]
}, },
createtype: '1', createtype: "1",
taskTypeList: [], //任务类型 taskTypeList: [], //任务类型
developmentList: [], //研制方式 developmentList: [], //研制方式
versionList: [], //版本 versionList: [], //版本
...@@ -217,20 +217,20 @@ export default { ...@@ -217,20 +217,20 @@ export default {
isshow: false, isshow: false,
ischangeshow: false, ischangeshow: false,
isshow_selectpdefm: false, isshow_selectpdefm: false,
issetProcess: false,
selectpdefmid: 0, selectpdefmid: 0,
oldformValidate: {}, oldformValidate: {},
processList: [], processList: [],
gycode: '', gycode: "",
platesnum: 1, platesnum: 1,
formValidate: { formValidate: {
id: 0, id: 0,
unicode: '', unicode: "",
name: '', name: "",
code: '', code: "",
product_id: 0, product_id: 0,
productids: '', productids: "",
version: '1', version: "1",
versioncode: 1, versioncode: 1,
author: 0, author: 0,
department_id: 0, department_id: 0,
...@@ -239,59 +239,59 @@ export default { ...@@ -239,59 +239,59 @@ export default {
up_detail_id: 0, up_detail_id: 0,
routingType: 0, routingType: 0,
status: 0, status: 0,
remark: '', remark: "",
development_mode: 1, development_mode: 1,
development_mode_str: '1', development_mode_str: "1",
change_order_code: '', change_order_code: "",
change_order_date: '', change_order_date: "",
change_method: '', change_method: "",
task_type: 1, task_type: 1,
task_type_str: '1', task_type_str: "1",
change_order_id: 0, change_order_id: 0,
print_data_name: '', print_data_name: "",
production_batch: '', production_batch: "",
print_data_version: '', print_data_version: "",
print_data_versioncode: 0, print_data_versioncode: 0,
platesnum: 1, platesnum: 1,
orderids: '', orderids: "",
ordercombid: 0, ordercombid: 0,
perboardnums: '', perboardnums: "",
productingPreparationPeople: '', productingPreparationPeople: "",
file_Path: '', file_Path: "",
oldid: 0 oldid: 0
}, },
ProductCode: '', ProductCode: "",
ProductName: '', ProductName: "",
Mianids: '', Mianids: "",
MianVer: '', MianVer: "",
MianCode: '', MianCode: "",
dataTop: [], dataTop: [],
columnTop: [ columnTop: [
{ {
title: '订单编号', title: "订单编号",
key: 'mesCode', key: "mesCode",
align: 'center' align: "center"
}, },
{ {
title: '产品名称', title: "产品名称",
key: 'productName', key: "productName",
align: 'center' align: "center"
}, },
{ {
title: '产品图号', title: "产品图号",
key: 'drawnNumber', key: "drawnNumber",
align: 'center' align: "center"
}, },
{ {
title: '任务类型', title: "任务类型",
key: 'taskTypeName', key: "taskTypeName",
align: 'center' align: "center"
}, },
{ {
title: '数量', title: "数量",
key: 'quantity', key: "quantity",
align: 'center' align: "center"
}, },
// { // {
// title: '每版数量', // title: '每版数量',
...@@ -299,12 +299,34 @@ export default { ...@@ -299,12 +299,34 @@ export default {
// align: 'center' // align: 'center'
// } // }
{ {
title: '每板数量', title: "每板数量",
key: 'perboardnum', key: "perboardnum",
align: 'center' 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() {}, mounted() {},
created() {}, created() {},
...@@ -312,64 +334,81 @@ export default { ...@@ -312,64 +334,81 @@ export default {
methods: { methods: {
uuid() { uuid() {
var s = [] var s = [];
var hexDigits = '0123456789abcdef' var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) { 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[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[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[8] = s[13] = s[18] = s[23] = "-";
var uuid = s.join('') var uuid = s.join("");
return uuid return uuid;
}, },
Loadfile(id) { Loadfile(id) {
if (id == 0) { if (id == 0) {
this.fileparms.eid = this.uuid() this.fileparms.eid = this.uuid();
this.$refs.refFile.routing_header_id = 0 this.$refs.refFile.routing_header_id = 0;
} else { } else {
this.fileparms.eid = id this.fileparms.eid = id;
this.$refs.refFile.routing_header_id = id this.$refs.refFile.routing_header_id = id;
} }
this.$refs.refFile.unClosable = this.isview this.$refs.refFile.unClosable = this.isview;
this.$refs.refFile.intFiles() 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) { updateEid(newId) {
let parms = { let parms = {
eid: this.fileparms.eid, eid: this.fileparms.eid,
id: newId + '' id: newId + ""
} };
this.$http.sysUser.updateEid(parms).then((res) => { this.$http.sysUser.updateEid(parms).then(res => {
if (res.status) { if (res.status) {
// this.$Message.success('修改成功!') // this.$Message.success('修改成功!')
// this.modalAvatar = false // this.modalAvatar = false
} else { } else {
//this.$Message.error('修改失败!') //this.$Message.error('修改失败!')
} }
}) });
},
l(key) {
key = 'routing_header' + '.' + key
return this.$t(key)
}, },
getfile() { getfile() {
return this.$refs.refFile.nameList return this.$refs.refFile.nameList;
}, },
clearModal() { clearModal() {
this.id = 0 this.id = 0;
this.formValidate.name = '' this.formValidate.name = "";
this.formValidate.version = '1' this.formValidate.version = "1";
this.formValidate.versioncode = 1 this.formValidate.versioncode = 1;
this.formValidate.task_type_str = '1' this.formValidate.task_type_str = "1";
this.formValidate.print_data_name = '' this.formValidate.print_data_name = "";
this.formValidate.print_data_version = '1' this.formValidate.print_data_version = "1";
this.formValidate.print_data_versioncode = 1 this.formValidate.print_data_versioncode = 1;
this.formValidate.production_batch = '' this.formValidate.production_batch = "";
this.formValidate.platesnum = 1 this.formValidate.platesnum = 1;
this.formValidate.remark = '' this.formValidate.remark = "";
// // this.Mianids = '' // // this.Mianids = ''
// // this.MianCode = '' // // this.MianCode = ''
// // this.MianVer = '' // // this.MianVer = ''
...@@ -378,22 +417,22 @@ export default { ...@@ -378,22 +417,22 @@ export default {
// this.formValidate.change_order_date = '' // this.formValidate.change_order_date = ''
// this.formValidate.change_method = '' // this.formValidate.change_method = ''
// this.formValidate.change_order_id = 0 // this.formValidate.change_order_id = 0
this.fileparms.eid = this.uuid() this.fileparms.eid = this.uuid();
this.$refs.refFile.routing_header_id = 0 this.$refs.refFile.routing_header_id = 0;
this.$refs.refFile.intFiles() this.$refs.refFile.intFiles();
}, },
clearModal2() { clearModal2() {
this.id = 0 this.id = 0;
this.formValidate.name = '' this.formValidate.name = "";
this.formValidate.version = '1' this.formValidate.version = "1";
this.formValidate.versioncode = 1 this.formValidate.versioncode = 1;
this.formValidate.task_type_str = '1' this.formValidate.task_type_str = "1";
this.formValidate.print_data_name = '' this.formValidate.print_data_name = "";
this.formValidate.print_data_version = '1' this.formValidate.print_data_version = "1";
this.formValidate.print_data_versioncode = 1 this.formValidate.print_data_versioncode = 1;
this.formValidate.production_batch = '' this.formValidate.production_batch = "";
this.formValidate.remark = '' this.formValidate.remark = "";
// // this.Mianids = '' // // this.Mianids = ''
// // this.MianCode = '' // // this.MianCode = ''
// // this.MianVer = '' // // this.MianVer = ''
...@@ -402,83 +441,164 @@ export default { ...@@ -402,83 +441,164 @@ export default {
// this.formValidate.change_order_date = '' // this.formValidate.change_order_date = ''
// this.formValidate.change_method = '' // this.formValidate.change_method = ''
// this.formValidate.change_order_id = 0 // this.formValidate.change_order_id = 0
this.fileparms.eid = this.uuid() this.fileparms.eid = this.uuid();
this.$refs.refFile.routing_header_id = 0 this.$refs.refFile.routing_header_id = 0;
this.$refs.refFile.intFiles() 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() { previousStep() {
this.modalShow = false this.modalShow = false;
}, },
handleChange(date) { handleChange(date) {
this.formValidate.mydate = date this.formValidate.mydate = date;
}, },
onchange_createtype() { onchange_createtype() {
this.isshow_selectpdefm = true if (this.createtype == 1) {
this.selectpdefmid = 0 this.isshow_selectpdefm = false;
this.formValidate.id = 0 this.clearModal2();
this.bindRoutinglist(this.formValidate.productids) 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.$refs.refFile.unClosable = this.isview;
this.setparentcreatetype(3, 0) this.setparentcreatetype(3, 0);
}
}, },
onchange_selectpdefm(val) { onchange_selectpdefm(val) {
if (this.selectpdefmid == 0 || typeof this.selectpdefmid == 'undefined') { if (this.selectpdefmid == 0 || typeof this.selectpdefmid == "undefined") {
return return;
} }
var url = `${designUrl}/routingheader/getbyid?id=` + this.selectpdefmid var url = `${designUrl}/routingheader/getbyid?id=` + this.selectpdefmid;
service.get(`${url}`).then((response) => { service.get(`${url}`).then(response => {
this.oldformValidate = this.formValidate this.oldformValidate = this.formValidate;
this.formValidate = response.data.result this.formValidate = response.data.result;
this.formValidate.up_id = this.oldformValidate.up_id this.formValidate.up_id = this.oldformValidate.up_id;
this.formValidate.productids = this.oldformValidate.productids this.formValidate.productids = this.oldformValidate.productids;
this.formValidate.orderids = this.oldformValidate.orderids this.formValidate.orderids = this.oldformValidate.orderids;
this.formValidate.productingPreparationPeople = this.oldformValidate.productingPreparationPeople this.formValidate.productingPreparationPeople = this.oldformValidate.productingPreparationPeople;
this.formValidate.platesnum = this.platesnum if (this.createtype == 2) {
this.$refs.refFile.routing_header_id = this.selectpdefmid 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.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) { 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) { bindRoutinglist(productid) {
var url = var url =
`${designUrl}/routingheader/GetListSmall?approvalstatus=1&product_id=` + `${designUrl}/routingheader/GetListSmall?approvalstatus=1&product_id=` +
productid + productid +
'&routingType=' + "&routingType=" +
this.formValidate.routingType this.formValidate.routingType;
service.get(`${url}`).then((response) => { service.get(`${url}`).then(response => {
this.RoutingList = response.data.result this.RoutingList = response.data.result;
}) });
}, },
setshow() { setshow() {
if (this.formValidate.routingType == 2) {
this.isshow = true;
} else {
this.isshow = false;
}
if (this.formValidate.id != 0) { if (this.formValidate.id != 0) {
this.isedit = true this.isedit = true;
this.Loadfile(this.formValidate.id) this.Loadfile(this.formValidate.id);
} else { } else {
this.isedit = false this.isedit = false;
this.Loadfile(0) this.Loadfile(0);
}
if (this.Mianids != "") {
this.LoadprocessList();
} }
this.selectpdefmid = 0 this.createtype = "1";
this.onchange_createtype() this.selectpdefmid = 0;
this.RoutingList = [];
this.calcplatesnum();
} }
} }
} };
</script> </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