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

update

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