Commit 22da3240 authored by 徐来柯's avatar 徐来柯

update

parent 9879ace4
...@@ -110,10 +110,10 @@ ...@@ -110,10 +110,10 @@
</div> </div>
</div> </div>
</div> </div>
<LinePop :typePop='type' :tData="tData" :data="itemdata" type="6" v-if="popShow" @openRelate="openRelate" ></LinePop> <LinePop :typePop='type' ref="linePop" :tData="tData" :data="itemdata" type="6" 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" /> <relate-dialog v-if="relateShow" :relateType="relateType" @conserve="saveData" @closeDialog="closeDialog" />
</div> </div>
</template> </template>
...@@ -152,7 +152,8 @@ export default { ...@@ -152,7 +152,8 @@ export default {
deleteManyData:[], deleteManyData:[],
typeV:'', typeV:'',
tData:[], tData:[],
relateShow: false relateShow: false,
relateType: ''
} }
}, },
props:[], props:[],
...@@ -165,7 +166,7 @@ export default { ...@@ -165,7 +166,7 @@ export default {
query(){ query(){
this.$axios({ this.$axios({
method:"post", method:"post",
url:`/api/Plan/Plan_Query?argKeyWord=${this.argKeyWord}&&argID=${this.argID}`, url:`/api/Plan/Plan_Query?argKeyWord=${this.argKeyWord}&argID=${this.argID}`,
}).then((res)=>{ }).then((res)=>{
if(res.data.data.length != 0 ){ if(res.data.data.length != 0 ){
for(let i=0;i<res.data.data.length;i++){ for(let i=0;i<res.data.data.length;i++){
...@@ -190,8 +191,14 @@ export default { ...@@ -190,8 +191,14 @@ export default {
console.log('err',err) console.log('err',err)
}) })
}, },
// 保存变量
openRelate () { saveData (data, type) {
debugger
this.$refs.linePop[type] = data.Name
this.relateShow = false
},
openRelate (type) {
this.relateType = type
this.relateShow = true this.relateShow = true
}, },
closeDialog () { closeDialog () {
......
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
<div class="popCenten_box"> <div class="popCenten_box">
<div class="popCenten"> <div class="popCenten">
<div v-if="type == 5 || type === '7'" class="name"> <div v-if="type == 5" class="name">
<span>{{name}}编号:</span> <span>{{name}}编号:</span>
<input v-model="modelV" class="nameipt" /> <input v-model="modelV" class="nameipt" />
</div> </div>
<div v-if="type==2" class="name" style="margin-top:10px" > <div v-if="type === '7'" class="name" style="margin-top:10px" >
<span>{{name}}编号:</span> <span>{{name}}编号:</span>
<input v-model="CellNuber" class="nameipt" /> <input v-model="DevNuber" class="nameipt" />
</div> </div>
<div v-if="type != 6" class="name" style="margin-top:10px"> <div v-if="type != 6" class="name" style="margin-top:10px">
...@@ -29,17 +29,18 @@ ...@@ -29,17 +29,18 @@
</div> </div>
<div v-if="type == 6" class="name"> <div v-if="type == 6" class="name">
<span>生产计划编号:</span> <span>生产计划编号:</span>
<span @click="openRelate" class="relateBtn plan_relateBtn" >。 。 。</span> <span @click="openRelate('VPID')" class="relateBtn plan_relateBtn" >选 择</span>
<input v-model="planNo" class="nameipt planName" /> <input v-model="VPID" disabled class="nameipt disInput"/>
<input v-model="PID" disabled class="nameipt planName" />
</div> </div>
<div v-if="type == 6" style="margin-top: 20px" class="name"> <div v-if="type == 6" style="margin-top: 20px" class="name">
<span>产品编号:</span> <span>产品编号:</span>
<el-select class="apply planName" v-model="producV" clearable placeholder="请选择"> <el-select class="apply planName" v-model="ProductID" clearable placeholder="请选择">
<el-option <el-option
v-for="item in productions" v-for="item in proList"
:key="item.name" :key="item.Name"
:label="item.name" :label="item.Name"
:value="item.name"> :value="item.ID">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
...@@ -69,7 +70,8 @@ ...@@ -69,7 +70,8 @@
<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> <span @click="openRelate" style=" float: right; margin: 0;" class="relateBtn">选 择</span>
<input v-model="Proalert" disabled class="nameipt" style="width: 360px !important; margin-right: 25px;" />
</div> </div>
<div v-if="type == 4" style="margin-top:10px" class="name"> <div v-if="type == 4" style="margin-top:10px" class="name">
...@@ -110,15 +112,17 @@ ...@@ -110,15 +112,17 @@
<div v-if="type == 6" class="name2" style="margin:15px auto"> <div v-if="type == 6" class="name2" style="margin:15px auto">
<span>计划数量:</span> <span>计划数量:</span>
<span @click="openRelate" class="relateBtn plan_relateBtn" >。 。 。</span> <span @click="openRelate('VPlanQuantity')" class="relateBtn plan_relateBtn" >选 择</span>
<input @change="dNumFun()" class="planName" style="width:460px;height:40px;margin-left:46px" v-model="dNum" type="text"/> <input v-model="VPlanQuantity" disabled class="name2_input"/>
<input @change="dNumFun()" class="planName" style="width:460px;height:40px;margin-left:46px" v-model="Quantity" type="text"/>
</div> </div>
<div v-if="type == 6" class="name2" style="margin:15px auto"> <div v-if="type == 6" class="name2" style="margin:15px auto">
<span style="float:left;display:block">计划交货日期: </span> <span style="float:left;display:block">计划交货日期: </span>
<span @click="openRelate" class="relateBtn plan_relateBtn" >。 。 。</span> <span @click="openRelate('VDeliveryDt')" class="relateBtn plan_relateBtn" >选 择</span>
<input v-model="VDeliveryDt" disabled class="name2_input"/>
<div class="planName" style="float:left;width:461px;height:40px;margin-left: 25px"> <div class="planName" style="float:left;width:461px;height:40px;margin-left: 25px">
<el-date-picker <el-date-picker
v-model="dtatime" v-model="DeliveryDt"
type="datetime" type="datetime"
placeholder="选择日期时间"> placeholder="选择日期时间">
</el-date-picker> </el-date-picker>
...@@ -126,7 +130,8 @@ ...@@ -126,7 +130,8 @@
</div> </div>
<div v-if="type == 6" class="name2" style="margin-top: 70px"> <div v-if="type == 6" class="name2" style="margin-top: 70px">
<span>交货日期临近报警:</span> <span>交货日期临近报警:</span>
<span @click="openRelate" class="relateBtn" style="margin-left: 20px">。 。 。</span> <span @click="openRelate('VStatus')" style=" float: right; margin: 0;" class="relateBtn">选 择</span>
<input v-model="VStatus" disabled class="nameipt" style="width: 348px !important;height: 40px" />
</div> </div>
<div v-if="type==3" class="namebtn"> <div v-if="type==3" class="namebtn">
<span>选择所包含的工序:</span> <span>选择所包含的工序:</span>
...@@ -213,9 +218,19 @@ export default { ...@@ -213,9 +218,19 @@ export default {
lineValue:'', lineValue:'',
editDataArr:[], editDataArr:[],
istech:false,//适用工艺 istech:false,//适用工艺
planNo: '', PID: '',
CellNuber: '', //工序编号 CellNuber: '', //工序编号
Company: '', //单位 Company: '', //单位
Proalert: '',
DevNuber: '', //type 7 设备编号
VPID: '',
VStatus: '',
VDeliveryDt: '',
VPlanQuantity: '',
DeliveryDt: '',
Quantity: '',
ProductID: '',
proList: []
} }
}, },
directives: { directives: {
...@@ -255,8 +270,26 @@ export default { ...@@ -255,8 +270,26 @@ export default {
created(){ created(){
// 1为线体管理 2为工序管理 3为工艺管理 4为物料管理 5为产品管理 6为生产管理 7设备管理 // 1为线体管理 2为工序管理 3为工艺管理 4为物料管理 5为产品管理 6为生产管理 7设备管理
this.init() this.init()
this.getNum()
this.getPros()
}, },
methods:{ methods:{
getNum () {
this.$axios({
method:"post",
url:`/api/Plan/PlanMaxProNumber`,
}).then((res)=>{
this.PID = res.data.data
})
},
getPros () {
this.$axios({
method:"post",
url:`/api/ProductDelivery/ProductDelivery_Data`,
}).then((res)=>{
this.proList = res.data.data
})
},
init(){ init(){
if(this.type == 1){ if(this.type == 1){
this.name = '线体' this.name = '线体'
...@@ -414,11 +447,14 @@ export default { ...@@ -414,11 +447,14 @@ export default {
this.typeText = '编辑' this.typeText = '编辑'
} }
if(this.typePop == 'edit'){ if(this.typePop == 'edit'){
console.log(this.data)
//编辑转态 //编辑转态
this.nameV = this.data.Name this.nameV = this.data.Name
this.describeV = this.data.Desc this.describeV = this.data.Desc
this.prodescribe = this.data.Prodescribe this.prodescribe = this.data.Prodescribe
this.prounit = this.data.Prounit this.prounit = this.data.Prounit
this.Proalert = this.data.Proalert
this.DevNuber = this.data.DevNuber
this.workValue = this.data.CellName this.workValue = this.data.CellName
this.CellNuber = this.data.CellNuber this.CellNuber = this.data.CellNuber
this.Company = this.data.Company this.Company = this.data.Company
...@@ -437,8 +473,9 @@ export default { ...@@ -437,8 +473,9 @@ export default {
}, },
// 打开关联变量弹窗 // 打开关联变量弹窗
openRelate () { openRelate (type) {
this.$emit('openRelate') type ? this.$emit('openRelate', type) : this.$emit('openRelate')
}, },
//取消关闭弹窗 //取消关闭弹窗
can(){ can(){
...@@ -512,29 +549,34 @@ export default { ...@@ -512,29 +549,34 @@ export default {
}else if(this.type==6){ }else if(this.type==6){
var time = this.$moment(this.dtatime).format('YYYY-MM-DD HH:mm:ss') var time = this.$moment(this.dtatime).format('YYYY-MM-DD HH:mm:ss')
this.valuedata={ this.valuedata={
PID:this.numberV2, ProductID:this.ProductID,
Quantity:this.dNum, PID:this.PID,
DeliveryDt:time, Quantity: this.Quantity,
Status:1 DeliveryDt: this.DeliveryDt,
VPID: this.VPID,
VStatus: this.VStatus,
VDeliveryDt: this.VDeliveryDt,
VPlanQuantity: this.VPlanQuantity
} }
if(this.tData != 0){ // if(this.tData != 0){
for(let i=0;i<this.tData.length;i++){ // for(let i=0;i<this.tData.length;i++){
if(this.producV == this.tData[i].Name){ // if(this.producV == this.tData[i].Name){
this.valuedata.ProductType = this.tData[i].PID // this.valuedata.ProductType = this.tData[i].PID
this.valuedata.ProductName = this.tData[i].Name // this.valuedata.ProductName = this.tData[i].Name
this.valuedata.ProductID = this.tData[i].ID // this.valuedata.ProductID = this.tData[i].ID
} // }
} // }
}else{ // }else{
this.valuedata.ProductType = '' // this.valuedata.ProductType = ''
this.valuedata.ProductName = '' // this.valuedata.ProductName = ''
this.valuedata.ProductID = '' // this.valuedata.ProductID = ''
} // }
}else if(this.type==7){ }else if(this.type==7){
this.valuedata = { this.valuedata = {
Name:this.nameV, Name:this.nameV, //设备名称
DevNuber: '', DevNuber: this.DevNuber,
Proalert: this.Proalert, //绑定变量
} }
this.valuedata.LineName = this.lineValue this.valuedata.LineName = this.lineValue
this.valuedata.CellName = this.workValue this.valuedata.CellName = this.workValue
...@@ -803,11 +845,14 @@ export default { ...@@ -803,11 +845,14 @@ export default {
margin: auto; margin: auto;
line-height: 40px; line-height: 40px;
overflow: hidden; overflow: hidden;
.nameipt{ .nameipt, .relate_nameipt {
width: 460px; width: 460px;
height: 40px; height: 40px;
float: right; float: right;
} }
.relate_nameipt {
width: 360px;
}
.nametextar{ .nametextar{
width: 460px; width: 460px;
margin-top:10px; margin-top:10px;
...@@ -817,8 +862,18 @@ export default { ...@@ -817,8 +862,18 @@ export default {
} }
.planName { .planName {
width: 360px !important; width: 235px !important;
margin-right: 25px; margin-right: 20px;
}
.name2_input {
height: 40px;
width: 110px !important;
float: right;
margin-right: 20px;
}
.disInput {
width: 110px !important;
margin-right: 20px
} }
.plan_relateBtn { .plan_relateBtn {
float: right ; float: right ;
......
...@@ -103,19 +103,28 @@ ...@@ -103,19 +103,28 @@
</div> </div>
</div> </div>
</div> </div>
<deletePop ref="delete" :deletetext="deletetext" :type="typeV" v-if="deleteShow"></deletePop>
</div> </div>
</template> </template>
<script> <script>
import Pagination from './Pagination' import Pagination from './Pagination'
import deletePop from './deletePop'
export default { export default {
components: { Pagination }, components: { Pagination, deletePop },
props: {
relateType: {
type: String,
default: ''
}
},
data() { data() {
return { return {
argDevice: '', argDevice: '不限',
argGroup: '', argGroup: '不限',
argDataType: '', argDataType: '不限',
argKeyWord: '', argKeyWord: '',
deviceList: [], deviceList: [],
typeList: [], typeList: [],
...@@ -123,6 +132,8 @@ export default { ...@@ -123,6 +132,8 @@ export default {
cloneData: [], cloneData: [],
innerTableData: [], innerTableData: [],
currentRow: {}, currentRow: {},
deleteShow: false,
typeV: '',
// 分页数据 // 分页数据
totalCount: 0, totalCount: 0,
// pageIndex: 1, // pageIndex: 1,
...@@ -152,13 +163,11 @@ export default { ...@@ -152,13 +163,11 @@ export default {
}; };
} }
}, },
created () { async created () {
this.$nextTick(() => { await this.getDevices()
this.getDevices() await this.getGroups()
this.getGroups() await this.getTypes()
this.getTypes() this.getData()
this.getData()
})
}, },
methods:{ methods:{
// guid() { // guid() {
...@@ -226,20 +235,75 @@ export default { ...@@ -226,20 +235,75 @@ export default {
} }
}, },
conserve () { conserve () {
this.$emit('conserve', this.currentRow) if (this.relateType) {
// var flag = Object.prototype.toString.call(this.relateType)
if (this.relateType === 'VPID') {
if (this.currentRow.DateType.indexOf('字符串') !== -1) {
return this.$emit('conserve', this.currentRow, this.relateType)
} else {
this.typeV = '5'
this.deleteShow = true
this.deletetext = '该变量不是字符串变量,请重新选择'
return
}
}
if (this.relateType === 'VPlanQuantity') {
if (this.currentRow.DateType.indexOf('整型') !== -1) {
return this.$emit('conserve', this.currentRow, this.relateType)
} else {
this.typeV = '5'
this.deleteShow = true
this.deletetext = '该变量不是整型变量,请重新选择'
return
}
}
if (this.relateType === 'VDeliveryDt') {
if (this.currentRow.DateType.indexOf('日期') !== -1 || this.currentRow.DateType.indexOf('时间') !== -1) {
return this.$emit('conserve', this.currentRow, this.relateType)
} else {
this.typeV = '5'
this.deleteShow = true
this.deletetext = '该变量不是日期时间型变量,请重新选择'
return
}
}
if (this.relateType === 'VStatus') {
if (this.currentRow.DateType.indexOf('二进制') !== -1) {
return this.$emit('conserve', this.currentRow, this.relateType)
} else {
this.typeV = '5'
this.deleteShow = true
this.deletetext = '该变量不是二进制变量,请重新选择'
return
}
}
} else {
this.$emit('conserve', this.currentRow)
}
},
//关闭弹窗
cancel_delete(){
this.deleteShow = false
}, },
getDevices () { getDevices () {
return new Promise((resolve, reject)=>{
var $this = this
this.$axios({ this.$axios({
method:"post", method:"post",
url:`/api/FormulaManage/FormulaManage_GstCondition`, url:`/api/FormulaManage/FormulaManage_GstCondition`,
}).then((res)=>{ }).then((res)=>{
this.deviceList = res.data.data $this.deviceList = res.data.data
resolve()
}) })
})
}, },
getGroups () { getGroups () {
return new Promise((resolve, reject)=>{
var $this = this var $this = this
this.argGroup = '' // this.argGroup = ''
this.argDataType = '' // this.argDataType = ''
this.groupList = [] this.groupList = []
this.typeList = [] this.typeList = []
this.$axios({ this.$axios({
...@@ -249,11 +313,16 @@ export default { ...@@ -249,11 +313,16 @@ export default {
res.data.data.forEach(item => { res.data.data.forEach(item => {
if (item.DeviceName === this.argDevice) { if (item.DeviceName === this.argDevice) {
$this.groupList = item.Groups $this.groupList = item.Groups
$this.argGroup = item.Groups[0].GroupName
$this.getTypes()
} }
resolve()
}) })
}) })
})
}, },
getTypes () { getTypes () {
return new Promise((resolve, reject)=>{
var $this = this var $this = this
this.argDataType = '' this.argDataType = ''
this.typeList = [] this.typeList = []
...@@ -266,11 +335,14 @@ export default { ...@@ -266,11 +335,14 @@ export default {
item.Groups.forEach(item => { item.Groups.forEach(item => {
if (item.GroupName === $this.argGroup) { if (item.GroupName === $this.argGroup) {
$this.typeList = item.DataTypes $this.typeList = item.DataTypes
$this.argDataType = item.DataTypes[0]
} }
}) })
} }
resolve()
}) })
}) })
})
}, },
} }
} }
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</div> </div>
</div> </div>
<!-- 弹窗内容 --> <!-- 弹窗内容 -->
<LinePop :typePop='type' :tData="tData" :tData2="tData2" :data="itemdata" type="7" v-if="popShow" @openRelate="openRelate" ></LinePop> <LinePop :typePop='type' :tData="tData" :tData2="tData2" ref="linePop" :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" @conserve="saveData" @closeDialog="closeDialog" /> <relate-dialog v-if="relateShow" @conserve="saveData" @closeDialog="closeDialog" />
...@@ -180,7 +180,8 @@ export default { ...@@ -180,7 +180,8 @@ export default {
}, },
// 保存变量 // 保存变量
saveData (data) { saveData (data) {
console.log(data) this.$refs.linePop.Proalert = data.Name
this.relateShow = false
}, },
//查询添加工序 //查询添加工序
queryWord(){ queryWord(){
......
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