Vue.component('show-table', {
|
// 声明 props
|
props: ['tablehead','tabledata'],
|
// 同样也可以在 vm 实例中像 "this.message" 这样使用
|
template: `<el-table
|
:data="tabledata"
|
height="100%"
|
style="width: 100%">
|
<el-table-column
|
v-if='index!=4'
|
v-for="(item,keys,index) in tablehead[0]"
|
:key="index"
|
:label="item"
|
:prop="keys.toString()"
|
>
|
<template v-slot="scope" v-if=" keys=='6_parts_change' ">
|
<el-button
|
:style="tabledata[scope.$index]['6_parts_change']==1?textColor:null"
|
type="text"
|
size="small"
|
@click='openParts(scope.$index,tabledata)'
|
>
|
更换
|
</el-button>
|
</template>
|
</el-table-column>
|
|
</el-table>`
|
,
|
data() {
|
return {
|
textColor:{
|
color:'orange'
|
}
|
}
|
},
|
|
methods:{
|
openParts(index,machineData){
|
this.$parent.$emit('dialogvisible',
|
{
|
'show':true,
|
'machineid':machineData[index]['10_id']
|
}
|
)
|
}
|
}
|
|
})
|
Vue.component('parts-change', {
|
// 声明 props
|
props: ['machine'],
|
// 同样也可以在 vm 实例中像 "this.message" 这样使用
|
template: `<el-dialog
|
title="更换设备零部件列表"
|
:visible.sync="centerDialogVisible"
|
width="55%"
|
center
|
>
|
<el-table :data="machineChange" width="100%" height='100%'>
|
<el-table-column
|
v-for="(item,keys,index) in machineChangeHead[0]"
|
:prop="keys"
|
:label="item"
|
|
>
|
<template v-slot="scope" v-if="keys=='5_surpass' && Object.keys(machineChange[0]).length!=0">
|
<el-button
|
:style="machineChange[scope.$index]['5_surpass']==1?textColor:null"
|
type="text"
|
size="small"
|
v-preventreclick
|
@click="partsChange(scope.$index, machineChange,0)"
|
>
|
更换
|
</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
<el-button type="primary" v-if="Object.keys(machineChange[0]).length!=0" v-preventreclick @click="partsChange(0,0,1)">一键更换</el-button>
|
</span>
|
</el-dialog>`
|
,
|
mixins: [mixin],
|
data(){
|
return{
|
centerDialogVisible:false,
|
machineChange:[{}],
|
machineChangeHead:[{}],
|
machineId:null,
|
textColor:{
|
color:'orange'
|
}
|
}
|
|
},
|
methods:{
|
partsChange(index,data,type){//修改零部件更换周期,type: 0代表单个零部件,1代表此机器所有零部件
|
|
let para
|
if(type==0){
|
para={
|
id:data[index]['7_id'],
|
machineId:data[index]['6_machine_id'],
|
type:type
|
}
|
}else{
|
para={
|
id:0,
|
machineId:this.machineId,
|
type:type
|
}
|
}
|
let sql="{call AXJ_a_largeScreen_machinePartsChange_update(?,?,?,?)}~"+JSON.stringify(para);
|
this.connects("更新耗材:",sql,1,1);
|
this.centerDialogVisible = false
|
}
|
},
|
watch: {
|
async machineId(){
|
let machine={
|
id:this.machineId
|
}
|
let canshu={
|
gongneng:'大屏更换周期机器零部件查询,机器号:'+this.machineId,
|
sql:"{call AXJ_a_largeScreen_machinePartsChange_select(?,?)}~"+JSON.stringify(machine),
|
flag:2,
|
vals:"machineChange"
|
}
|
this.machineChange=await this.returnloadAjxss(canshu)
|
}
|
},
|
async mounted() {
|
let parameter={
|
gongneng:'大屏更换周期表头查询',
|
sql:"{call AXJ_a_largeScreen_machinePartsChangeHead_select()}",
|
flag:2,
|
vals:"machineChangeHead"
|
}
|
this.machineChangeHead=await this.returnloadAjxss(parameter)
|
|
this.$parent.$on("dialogvisible",val=>{
|
//这是事件函数 一旦changeBgc事件被触发,就会执行这里的代码
|
this.centerDialogVisible = val.show
|
this.machineId=val.machineid
|
|
|
})
|
}
|
|
})
|
Vue.component('screen-order', {//钢化贴膜下片订单组件
|
// 声明 props
|
props: ['tablehead','tabledata'],
|
// 同样也可以在 vm 实例中像 "this.message" 这样使用
|
template: `<el-table
|
:data="tabledata"
|
height="100%"
|
style="width: 100%">
|
<el-table-column
|
|
v-for="(item,keys,index) in tablehead[0]"
|
:key="index"
|
:label="item"
|
:prop="keys.toString()"
|
>
|
<template v-slot="scope" v-if=" keys=='3_ratio' && Object.keys(tabledata[0]).length!=0">
|
<el-progress :text-inside="true" :stroke-width="26"
|
:percentage="tabledata[scope.$index]['3_ratio']==null?0*1:tabledata[scope.$index]['3_ratio']*1"
|
>
|
</el-progress>
|
</template>
|
</el-table-column>
|
|
</el-table>`
|
|
|
})
|
|
Vue.component('screen-photo', {//现场作业图轮换
|
// 声明 props
|
props: ['id','intime'],
|
// 同样也可以在 vm 实例中像 "this.message" 这样使用
|
template: `<div style='width:100%;height:100%;max-width=100%;max-height=100%;position: relative;'>
|
<img class="imgCenter" :src="url"/>
|
</div>`,
|
mixins: [mixin],
|
data(){
|
return{
|
photoList:[{}],
|
indexs:-1,
|
url:null
|
}
|
},
|
watch:{
|
photoList(newVal){
|
if(Object.keys(this.photoList[0]).length==0){
|
return
|
}
|
|
this.url=newVal[0]['0_route']
|
setInterval(()=>{
|
|
this.indexs>=newVal.length-1?this.indexs=0:this.indexs++
|
this.url=newVal[this.indexs]['0_route']
|
},parseInt(this.intime/newVal.length))
|
}
|
},
|
async mounted() {
|
let para={
|
id:this.id
|
}
|
let canshu={
|
gongneng:'组件图片查询:',
|
sql:"{call AXJ_a_largeScreen_phtot_select(?,?)}~"+JSON.stringify(para),
|
flag:2,
|
vals:"photoList"
|
}
|
this.photoList=await this.returnloadAjxss(canshu)
|
|
}
|
|
|
})
|
|
|
|
Vue.component('parts-change-all', {
|
// 声明 props
|
props: ['machinetype'],
|
// 同样也可以在 vm 实例中像 "this.message" 这样使用
|
template: `
|
<el-table :data="machineChange" width="100%" height='100%'>
|
<el-table-column
|
v-for="(item,keys,index) in machineChangeHead[0]"
|
:prop="keys"
|
:label="item"
|
|
>
|
<template v-slot="scope" v-if="keys=='5_surpass' && Object.keys(machineChange[0]).length!=0">
|
<el-button
|
:style="machineChange[scope.$index]['5_surpass']==1?textColor:null"
|
type="text"
|
size="small"
|
v-preventreclick
|
@click="partsChange(scope.$index, machineChange,0)"
|
>
|
更换
|
</el-button>
|
</template>
|
</el-table-column>
|
</el-table>`
|
,
|
mixins: [mixin],
|
data(){
|
return{
|
centerDialogVisible:true,
|
machineChange:[{}],
|
machineChangeHead:[{}],
|
machineId:null,
|
textColor:{
|
color:'orange'
|
}
|
}
|
|
},
|
methods:{
|
partsChange(index,data,type){//修改零部件更换周期,type: 0代表单个零部件,1代表此机器所有零部件
|
|
let para
|
if(type==0){
|
para={
|
id:data[index]['7_id'],
|
machineId:data[index]['6_machine_id'],
|
type:type
|
}
|
}else{
|
para={
|
id:0,
|
machineId:this.machineId,
|
type:type
|
}
|
}
|
let sql="{call AXJ_a_largeScreen_machinePartsChange_update(?,?,?,?)}~"+JSON.stringify(para);
|
this.connects("更新耗材:",sql,1,1);
|
this.centerDialogVisible = false
|
}
|
},
|
watch: {
|
async machineId(){
|
|
}
|
},
|
async mounted() {
|
let parameter={
|
gongneng:'大屏更换周期表头查询',
|
sql:"{call AXJ_a_largeScreen_machinePartsChangeHead_select()}",
|
flag:2,
|
vals:"machineChangeHead"
|
}
|
this.machineChangeHead=await this.returnloadAjxss(parameter)
|
|
let machine={
|
type:this.machinetype
|
}
|
let canshu={
|
gongneng:'大屏更换周期机器零部件查询,机器类型:'+this.machinetype,
|
sql:"{call AXJ_a_largeScreen_machinePartsChange_type_select(?,?)}~"+JSON.stringify(machine),
|
flag:2,
|
vals:"machineChange"
|
}
|
//this.machineChange=
|
await setInterval(async () => {
|
this.machineChange= await app.returnloadAjxss(canshu);
|
},5000)
|
|
|
}
|
|
})
|