Commit 896c3b7a authored by 徐来柯's avatar 徐来柯

update

parent a7296fd4
<!--
* @Description: 这是***页面(组件)
* @Date: 2020-08-10 15:29:17
* @Author: Tao
* @LastEditors: Tao
* @LastEditTime: 2020-09-01 17:21:50
-->
<template> <template>
<div class="dialog-mask">
<div class="scPopBox"> <div class="scPopBox">
<div v-drag class="head">{{titleText}} <div v-drag class="head">{{titleText}}
<div @click="close()" class="headImg"></div> <div @click="close()" class="headImg"></div>
...@@ -54,6 +48,7 @@ ...@@ -54,6 +48,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
...@@ -129,6 +124,17 @@ export default { ...@@ -129,6 +124,17 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.dialog-mask {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
z-index: 9;
}
.scPopBox{ .scPopBox{
.el-select{ .el-select{
width:310px; width:310px;
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
<div v-if="type === '7'" style="margin-top: 20px" class="name"> <div v-if="type === '7'" style="margin-top: 20px" class="name">
<span>关联变量:</span> <span>关联变量:</span>
<span @click="openRelate" class="relateBtn">。 。 。</span>
</div> </div>
<div v-if="type == 4" style="margin-top:10px" class="name"> <div v-if="type == 4" style="margin-top:10px" class="name">
...@@ -241,180 +242,185 @@ export default { ...@@ -241,180 +242,185 @@ export default {
this.init() this.init()
}, },
methods:{ methods:{
init(){ init(){
if(this.type == 1){ if(this.type == 1){
this.name = '线体' this.name = '线体'
this.title = '线体' this.title = '线体'
}else if(this.type == 2){ }else if(this.type == 2){
this.name = '工序' this.name = '工序'
this.title = '工序' this.title = '工序'
}else if(this.type == 3){ }else if(this.type == 3){
this.name = '工艺' this.name = '工艺'
this.title = '工艺' this.title = '工艺'
//工序赋值 //工序赋值
this.options = [] this.options = []
//中英文数字排序 //中英文数字排序
var paishunArr = [] var paishunArr = []
var arrData = [] var arrData = []
for(let e=0;e<this.tData.length;e++){ for(let e=0;e<this.tData.length;e++){
paishunArr.push(this.tData[e].Name) paishunArr.push(this.tData[e].Name)
} }
console.log('paishunArr11=>',paishunArr) console.log('paishunArr11=>',paishunArr)
var bb = this.arrSortMinToMax(paishunArr) var bb = this.arrSortMinToMax(paishunArr)
console.log('bb==>1',bb) console.log('bb==>1',bb)
for(let e1=0;e1<bb.length;e1++){ for(let e1=0;e1<bb.length;e1++){
for(let e2=0;e2<this.tData.length;e2++){ for(let e2=0;e2<this.tData.length;e2++){
if(bb[e1] == this.tData[e2].Name){ if(bb[e1] == this.tData[e2].Name){
arrData.push(this.tData[e2]) arrData.push(this.tData[e2])
}
} }
} }
for(let i=0;i<arrData.length;i++){ }
var value = { for(let i=0;i<arrData.length;i++){
id:arrData[i].ID, var value = {
name:arrData[i].Name id:arrData[i].ID,
} name:arrData[i].Name
this.options.push(value)
} }
console.log('工序赋值==》',this.options) this.options.push(value)
if(this.typePop == 'edit'){ }
//初始化工艺编辑下的表单 console.log('工序赋值==》',this.options)
let ID = this.data.ID if(this.typePop == 'edit'){
this.editDataArr = [] //初始化工艺编辑下的表单
let ID = this.data.ID
this.$axios({ this.editDataArr = []
method:"post",
url:`/api/Process/Process_WindowQuery?argID=${ID}`, this.$axios({
}).then((res)=>{ method:"post",
this.tableDataList = [] url:`/api/Process/Process_WindowQuery?argID=${ID}`,
this.editDataArr = res.data.data }).then((res)=>{
if(res.data.data.Cells.length != 0){ this.tableDataList = []
for(let i=0;i<res.data.data.Cells.length;i++){ this.editDataArr = res.data.data
var va = { if(res.data.data.Cells.length != 0){
id:res.data.data.Cells[i].ID, for(let i=0;i<res.data.data.Cells.length;i++){
name:res.data.data.Cells[i].Name, var va = {
number:res.data.data.Cells[i].NO id:res.data.data.Cells[i].ID,
} name:res.data.data.Cells[i].Name,
this.tableDataList.push(va) number:res.data.data.Cells[i].NO
} }
this.tableDataList.push(va)
} }
}).catch(function(err){
console.log('err',err)
})
}
}else if(this.type == 4){
this.name = '物料'
this.title = '物料'
}else if(this.type == 5){
this.name = '产品'
this.title = '产品'
//中英文数字排序
var paishunArr1 = []
var arrData1 = []
for(let e=0;e<this.tData.length;e++){
paishunArr1.push(this.tData[e].Name)
}
var bb1 = this.arrSortMinToMax(paishunArr1)
for(let e1=0;e1<bb1.length;e1++){
for(let e2=0;e2<this.tData.length;e2++){
if(bb1[e1] == this.tData[e2].Name){
arrData1.push(this.tData[e2])
} }
}
} }).catch(function(err){
console.log('err',err)
})
}
}else if(this.type == 4){
this.name = '物料'
this.title = '物料'
}else if(this.type == 5){
this.name = '产品'
this.title = '产品'
//工艺赋值 //中英文数字排序
this.technologyOptions = [] var paishunArr1 = []
for(let i2=0;i2<arrData1.length;i2++){ var arrData1 = []
var value4 = { for(let e=0;e<this.tData.length;e++){
id:arrData1[i2].ID, paishunArr1.push(this.tData[e].Name)
name:arrData1[i2].Name }
var bb1 = this.arrSortMinToMax(paishunArr1)
for(let e1=0;e1<bb1.length;e1++){
for(let e2=0;e2<this.tData.length;e2++){
if(bb1[e1] == this.tData[e2].Name){
arrData1.push(this.tData[e2])
} }
this.technologyOptions.push(value4)
} }
}else if(this.type == 6){ }
this.name = '订单'
this.title = "生产计划" //工艺赋值
this.technologyOptions = []
//中英文数字排序 for(let i2=0;i2<arrData1.length;i2++){
var paishunArr2 = [] var value4 = {
var arrData2 = [] id:arrData1[i2].ID,
for(let e=0;e<this.tData.length;e++){ name:arrData1[i2].Name
paishunArr2.push(this.tData[e].Name)
} }
console.log('paishunArr2',paishunArr2) this.technologyOptions.push(value4)
var bb2 = this.arrSortMinToMax(paishunArr2) }
console.log('bb2',bb2) }else if(this.type == 6){
for(let e1=0;e1<bb2.length;e1++){ this.name = '订单'
for(let e2=0;e2<this.tData.length;e2++){ this.title = "生产计划"
if(bb2[e1] == this.tData[e2].Name){
arrData2.push(this.tData[e2]) //中英文数字排序
} var paishunArr2 = []
var arrData2 = []
for(let e=0;e<this.tData.length;e++){
paishunArr2.push(this.tData[e].Name)
}
console.log('paishunArr2',paishunArr2)
var bb2 = this.arrSortMinToMax(paishunArr2)
console.log('bb2',bb2)
for(let e1=0;e1<bb2.length;e1++){
for(let e2=0;e2<this.tData.length;e2++){
if(bb2[e1] == this.tData[e2].Name){
arrData2.push(this.tData[e2])
} }
} }
}
//产品赋值 //产品赋值
this.productions = [] this.productions = []
for(let i2=0;i2<arrData2.length;i2++){ for(let i2=0;i2<arrData2.length;i2++){
var value7 = { var value7 = {
id:arrData2[i2].ID, id:arrData2[i2].ID,
name:arrData2[i2].Name, name:arrData2[i2].Name,
PID:arrData2[i2].PID, PID:arrData2[i2].PID,
}
this.productions.push(value7)
} }
this.dtatime = this.$moment().format('YYYY-MM-DD HH:mm:ss') this.productions.push(value7)
}
this.dtatime = this.$moment().format('YYYY-MM-DD HH:mm:ss')
}else if(this.type == 7){ }else if(this.type == 7){
this.name = '设备' this.name = '设备'
this.title = '设备' this.title = '设备'
//工序赋值 //工序赋值
this.deviceOptions = [] this.deviceOptions = []
for(let i1=0;i1<this.tData.length;i1++){ for(let i1=0;i1<this.tData.length;i1++){
var value6 = { var value6 = {
id:this.tData[i1].ID, id:this.tData[i1].ID,
name:this.tData[i1].Name name:this.tData[i1].Name
}
this.deviceOptions.push(value6)
} }
//工yi赋值 this.deviceOptions.push(value6)
this.deviceOptions2 = [] }
for(let i2=0;i2<this.tData2.length;i2++){ //工yi赋值
var value5 = { this.deviceOptions2 = []
id:this.tData2[i2].ID, for(let i2=0;i2<this.tData2.length;i2++){
name:this.tData2[i2].Name var value5 = {
} id:this.tData2[i2].ID,
this.deviceOptions2.push(value5) name:this.tData2[i2].Name
} }
this.deviceOptions2.push(value5)
} }
}
if(this.typePop == 'add'){ if(this.typePop == 'add'){
this.typeText = '添加' this.typeText = '添加'
}else{ }else{
this.typeText = '编辑' this.typeText = '编辑'
} }
if(this.typePop == 'edit'){ if(this.typePop == 'edit'){
//编辑转态 //编辑转态
this.nameV = this.data.Name this.nameV = this.data.Name
this.describeV = this.data.Desc this.describeV = this.data.Desc
this.workValue = this.data.CellName this.workValue = this.data.CellName
this.lineValue = this.data.LineName this.lineValue = this.data.LineName
this.numberV = this.data.MID this.numberV = this.data.MID
this.modelV = this.data.PID this.modelV = this.data.PID
this.applyValue = this.data.ProcessName this.applyValue = this.data.ProcessName
this.dNum = this.data.Quantity this.dNum = this.data.Quantity
this.numberV2 = this.data.PID this.numberV2 = this.data.PID
this.producV = this.data.ProductName this.producV = this.data.ProductName
this.dtatime = this.data.DeliveryDt this.dtatime = this.data.DeliveryDt
console.log('this==>',this.data) console.log('this==>',this.data)
} }
}, },
// 打开关联变量弹窗
openRelate () {
this.$emit('openRelate')
},
//取消关闭弹窗 //取消关闭弹窗
can(){ can(){
this.$parent.cancelFun() this.$parent.cancelFun()
...@@ -802,6 +808,25 @@ export default { ...@@ -802,6 +808,25 @@ export default {
border:1px solid #eee; border:1px solid #eee;
} }
} }
.relateBtn {
width: 75px;
height: 40px;
display: inline-block;
margin-left: 48px;
text-align: center;
line-height: 40px;
cursor: pointer;
user-select: none;
background:rgba(255,255,255,1);
border:1px solid rgba(37,92,193,1);
border-radius:4px;
box-sizing: border-box;
font-size:14px;
font-family:Microsoft YaHei;
font-weight:400;
color:rgba(51,51,51,1);
margin-right: 20px;
}
.btn{ .btn{
width:100%; width:100%;
height: 40px; height: 40px;
......
<template>
<div class="innerDialog-mask">
<div class="scPopBox">
<div v-drag class="head">{{titleText}}
<div @click="close()" class="headImg"></div>
</div>
<div class="popCenten_box">
<div class="popCenten">
<div class="centen_row" style="margin-top: 10px" >
<span class="centen_row_text" style="margin-left: 30px" >线体编号:</span>
<div class="centen_row_select">
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in planList"
:key="item.PlanType"
:label="item.PlanType"
:value="item.PlanType">
</el-option>
</el-select>
</div>
</div>
<div class="centen_row" style="margin-top:10px">
<span class="centen_row_text" style="margin-left: 30px" >物料编号:</span>
<div class="centen_row_select">
<el-select v-model="value1" placeholder="请选择">
<el-option
v-for="item in materList"
:key="item.LineName"
:label="item.LineName"
:value="item.LineName">
</el-option>
</el-select>
</div>
</div>
<div class="centen_row" style="margin-top:10px">
<span class="centen_row_text" style="margin-left: 30px" >入库数量:</span>
<div class="centen_row_select">
<el-input @change="numFun()" v-model="count" placeholder="请输入入库数量"></el-input>
</div>
</div>
</div>
<div class="btn">
<div @click="close()" class="cancle">取消</div>
<div @click="conserve()" class="add">保存</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
count: '',
value: '',
value1 : '',
planList: [],
materList: []
}
},
props: {
titleText: {
type: String,
default: '选择变量'
}
},
directives: {
drag: function(el) {
let dragBox = el; //获取当前元素
dragBox.onmousedown = e => {
let box = document.querySelector('.scPopBox')
//算出鼠标相对元素的位置
let disX = e.clientX - dragBox.offsetLeft;
let disY = e.clientY - dragBox.offsetTop;
document.onmousemove = e => {
//用鼠标的位置减去鼠标相对元素的位置,得到元素的位置
let left = e.clientX - (Number(disX));
let top = e.clientY - (Number(disY));
//移动当前元素
box.style.left = left + "px";
box.style.top = top + "px";
};
document.onmouseup = e => {
document.onmousemove = null;
document.onmouseup = null;
};
};
}
},
methods:{
// guid() {
// return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
// var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
// return v.toString(16);
// });
// },
close(){
this.count = ''
this.value = ''
this.value1 = ''
this.$emit('closeDialog')
},
numFun(){
this.count = parseInt(this.count)
if(String(this.count) == 'NaN'){
this.count = ''
}
},
conserve () {
var dialogData = {
count: this.count,
value: this.value,
value1 : this.value1,
}
this.$emit('conserve', dialogData)
}
}
}
</script>
<style lang="scss">
.innerDialog-mask {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
z-index: 29;
}
.scPopBox{
.el-select{
width:310px;
}
.el-date-editor.el-input, .el-date-editor.el-input__inner{
width:310px;
}
}
</style>
<style lang="scss" scoped>
.scPopBox{
width:820px;
height:550px;
background:rgba(238,238,238,1);
box-shadow:-7px 7px 50px 0px rgba(51,51,51,0.5);
position: absolute;
top: 0px;
left: 0px;
right: 0;
bottom: 0;
margin:auto;
z-index: 10;
.head{
position: relative;
line-height: 60px;
text-align: center;
width:820px;
height:60px;
background:rgba(37,92,193,1);
font-size:18px;
font-family:Microsoft YaHei;
font-weight:bold;
color:rgba(238,238,238,1);
user-select: none;
}
.headImg{
position: absolute;
right: 12px;
top: 12px;
width:36px;
height: 36px;
background:url('../../../assets/images/no.png') ;
background-size:cover ;
cursor: pointer;
}
.popCenten_box{
height:480px;
width:100%;
background: #EEEEEE;
.popCenten{
width:737px;
height:380px;
background: #fff;
margin-top:30px;
margin-left:30px;
padding-top:42px;
.centen_row{
width: 60%;
margin: auto;
height: 40px;
line-height: 40px;
}
.centen_row_text{
float: left;
}
.centen_row_select{
float: right;
width: 310px;
height: 40px;
}
}
}
.btn{
width:100%;
height: 40px;
overflow: hidden;
margin:20px 0 0 280px;
.cancle{
width: 160px;
height: 40px;
float: left;
text-align: center;
line-height: 40px;
cursor: pointer;
user-select: none;
background:rgba(255,255,255,1);
border:1px solid rgba(37,92,193,1);
border-radius:4px;
box-sizing: border-box;
font-size:14px;
font-family:Microsoft YaHei;
font-weight:400;
color:rgba(51,51,51,1);
margin-right: 20px;
}
.add{
width: 160px;
height: 40px;
float: left;
text-align: center;
line-height: 40px;
cursor: pointer;
user-select: none;
background:rgba(37,92,193,1);
border:1px solid rgba(37,92,193,1);
border-radius:4px;
box-sizing: border-box;
font-size:14px;
font-family:Microsoft YaHei;
font-weight:400;
color:rgba(255,255,255,1);
}
}
}
</style>
\ No newline at end of file
...@@ -93,9 +93,10 @@ ...@@ -93,9 +93,10 @@
</div> </div>
</div> </div>
<!-- 弹窗内容 --> <!-- 弹窗内容 -->
<LinePop :typePop='type' :tData="tData" :tData2="tData2" :data="itemdata" type="7" v-if="popShow"></LinePop> <LinePop :typePop='type' :tData="tData" :tData2="tData2" :data="itemdata" type="7" v-if="popShow" @openRelate="openRelate" ></LinePop>
<deletePop ref="delete" :deletetext="deletetext" :type="typeV" v-if="deleteShow"></deletePop> <deletePop ref="delete" :deletetext="deletetext" :type="typeV" v-if="deleteShow"></deletePop>
<div v-if="popShow || deleteShow" class="box"></div> <div v-if="popShow || deleteShow" class="box"></div>
<relate-dialog v-if="relateShow" @closeDialog="closeDialog" />
</div> </div>
</template> </template>
...@@ -103,16 +104,20 @@ ...@@ -103,16 +104,20 @@
import Head from './component/head.vue' import Head from './component/head.vue'
import LinePop from './component/linePop' import LinePop from './component/linePop'
import deletePop from './component/deletePop' import deletePop from './component/deletePop'
import relateDialog from './component/relateDialog'
export default { export default {
components:{ components:{
Head, Head,
LinePop, LinePop,
deletePop deletePop,
relateDialog
}, },
data() { data() {
return { return {
tableData: [], tableData: [],
AllTableData:[], AllTableData:[],
relateShow: false,
ss:'', ss:'',
num:1, num:1,
TotalCount:1, TotalCount:1,
...@@ -166,6 +171,13 @@ export default { ...@@ -166,6 +171,13 @@ export default {
console.log('err',err) console.log('err',err)
}) })
}, },
openRelate () {
this.relateShow = true
},
closeDialog () {
this.relateShow = false
},
//查询添加工序 //查询添加工序
queryWord(){ queryWord(){
var value = '' var value = ''
......
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