Commit 0db1d7e2 authored by 李苏's avatar 李苏 💬

调整

parent e0316e06
<template>
<DefaultDialog :app='app'>
<el-form slot="form" ref="form" :model="form" label-width="100px" :rules="rules">
<!-- 辅助编码-->
<el-row :gutter="20" :app="this">
<EditColItem :required="item.required||false" :readonly="item.readonly?true:false "
v-for="(item,index) in editColItemList " :value="item.value" :span="item.span" :label="item.label"
:prop='item.prop' :key="item.prop" :type="item.type" :typeConfig='item.typeConfig' :rule="item.rule" />
</el-row>
</el-form>
<div slot="reFooter" class="refooter">
<span slot="footer" class="dialog-footer">
<el-button @click="app.showDialog=false">取 消</el-button>
<el-button type="primary" @click="save()">保 存</el-button>
</span>
</div>
</DefaultDialog>
</template>
<script>
import {
editMixin
} from 'common'
import sbxx from '@/views/auxinput/sbxx'
export default {
props: {
app: {
type: Object,
default: () => {
return {}
}
}
},
mixins: [editMixin],
async mounted() {
},
data() {
return {
fileList: [],
readonly: false,
editColItemList: [{
label: '焊接缝编码',
prop: 'code',
span: 12,
type: 'input',
},
{
label: '焊接位置',
prop: 'hjwz',
span: 24,
type: 'input',
},
{
label: '母材1材质',
prop: 'mcone',
span: 24,
type: 'input',
},
{
label: '母材2材质',
prop: 'mctwo',
span: 24,
type: 'input',
},
{
label: '备注',
prop: 'bz',
span: 24,
type: 'input',
},
]
}
},
methods: {
save() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.$emit('save', this.form)
}
})
}
}
}
</script>
<style scoped>
</style>
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
<RelDialog @getForm='getForm' ref="reldialog" width="80vw" :type='type' :editApp='editApp' :app='app' <RelDialog @getForm='getForm' ref="reldialog" width="80vw" :type='type' :editApp='editApp' :app='app'
:buttonApp='buttonApp'> :buttonApp='buttonApp'>
<el-form slot="form" ref="form" :model="form" label-width="120px" :rules="rules" <el-form slot="form" ref="form" :model="form" label-width="120px" :rules="rules"
style="height: 70vh;overflow: auto;overflow-x: hidden;"> style="height: 80vh;overflow: auto;overflow-x: hidden;">
<addgjmx ref="addgjmx" @save='addgjmxbc' v-if="showDialog&&DialogTitle=='工具'" :app="this"></addgjmx> <addgjmx ref="addgjmx" @save='addgjmxbc' v-if="showDialog&&DialogTitle=='工具'" :app="this"></addgjmx>
<addbpbjmx ref="addbpbjmx" @save='savebpbj' v-if="showDialog&&DialogTitle=='备品备件'" :app="this"></addbpbjmx> <addbpbjmx ref="addbpbjmx" @save='savebpbj' v-if="showDialog&&DialogTitle=='备品备件'" :app="this"></addbpbjmx>
<addhcmx ref="addhcmx" @save='savehc' v-if="showDialog&&DialogTitle=='耗材'" :app="this"></addhcmx> <addhcmx ref="addhcmx" @save='savehc' v-if="showDialog&&DialogTitle=='耗材'" :app="this"></addhcmx>
<addjxzyff ref="addjxzyff" @save='savejxzyff' v-if="showDialog&&DialogTitle=='检修作业方法'" :app="this" /> <addjxzyff ref="addjxzyff" @save='savejxzyff' v-if="showDialog&&DialogTitle=='检修作业方法'" :app="this" />
<addhjsy ref="addhjsy" @save='savehjsy' v-if="showDialog&&DialogTitle=='焊接使用'" :app="this" />
<el-row :gutter="20" :app="this"> <el-row :gutter="20" :app="this">
<EditColItem :required="item.required||false" :readonly="item.readonly?true:false " <EditColItem :required="item.required||false" :readonly="item.readonly?true:false "
v-for="(item,index) in editColItemList " :value="item.value" :span="item.span" :label="item.label" v-for="(item,index) in editColItemList " :value="item.value" :span="item.span" :label="item.label"
...@@ -47,11 +48,23 @@ ...@@ -47,11 +48,23 @@
</editTableForEdit> </editTableForEdit>
</div> </div>
</el-tab-pane> </el-tab-pane>
<!--是否焊接使用 -->
<el-tab-pane v-if="form.sfhjsy=='Y'" label="焊接使用" name="6">
<div style="height: 300px;">
<editTableForEdit ref="sfhjsyTab" :phsxTitle='false' :expandTitle='false' code='false' :AuxButton='false'
:indexApp='app' :type='type' :editTableTitle='editTableTitle5' :editTableData="editTableData5">
<template v-if="type!='view'" #toolbar="ctx">
<el-button @click="addhjsy" size='mini' type="primary">新增焊接使用</el-button>
</template>
</editTableForEdit>
</div>
</el-tab-pane>
<!-- 检修作业方法--> <!-- 检修作业方法-->
<el-tab-pane label="检修作业方法" name="5"> <el-tab-pane label="检修作业方法" name="5">
<div style="height: 300px;"> <div style="height: 300px;">
<editTableForEdit ref="jxzyffTab" :phsxTitle='false' :expandTitle='false' code='false' :AuxButton='false' :indexApp='app' <editTableForEdit ref="jxzyffTab" :phsxTitle='false' :expandTitle='false' code='false' :AuxButton='false'
:type='type' :editTableTitle='editTableTitle4' :editTableData="editTableData4"> :indexApp='app' :type='type' :editTableTitle='editTableTitle4' :editTableData="editTableData4">
<template v-if="type!='view'" #toolbar="ctx"> <template v-if="type!='view'" #toolbar="ctx">
<el-button @click="addjxzyff" size='mini' type="primary">新增检修作业</el-button> <el-button @click="addjxzyff" size='mini' type="primary">新增检修作业</el-button>
...@@ -138,6 +151,7 @@ ...@@ -138,6 +151,7 @@
import addbpbjmx from './addbpbjmx.vue' import addbpbjmx from './addbpbjmx.vue'
import addhcmx from './addhcmx.vue' import addhcmx from './addhcmx.vue'
import addjxzyff from './addjxzyff.vue' import addjxzyff from './addjxzyff.vue'
import addhjsy from './addhjsy.vue'
import { import {
autoAttachDownload, autoAttachDownload,
} from "common/src/api/system/dmgSystem.js"; } from "common/src/api/system/dmgSystem.js";
...@@ -153,9 +167,13 @@ ...@@ -153,9 +167,13 @@
addgjmx, addgjmx,
addbpbjmx, addbpbjmx,
addhcmx, addhcmx,
addjxzyff addjxzyff,
addhjsy
}, },
computed: { computed: {
sfhjsy() {
return this.form.sfhjsy
},
sfsybpbj() { sfsybpbj() {
return this.form.sfsybpbj return this.form.sfsybpbj
}, },
...@@ -163,17 +181,24 @@ ...@@ -163,17 +181,24 @@
return this.form.sfsyhc return this.form.sfsyhc
} }
}, },
computed:{ computed: {
dxdm(){ // dxdm(){
return this.form.dxdm // return this.form.dxdm
} // }
}, },
watch: { watch: {
dxdm(val){ // dxdm(val){
if(!val.startsWith("YJ")){ // if(!val.startsWith("YJ")){
this.form.dxdm="YJ".concat(val) // this.form.dxdm="YJ".concat(val)
} // }
// },
sfhjsy(v){
if (v == 'Y') {
this.activeName = '6'
} else {
this.activeName = '1'
}
}, },
sfsybpbj(v) { sfsybpbj(v) {
if (v == 'Y') { if (v == 'Y') {
...@@ -192,12 +217,11 @@ ...@@ -192,12 +217,11 @@
}, },
data() { data() {
return { return {
attachmentList:[], attachmentList: [],
Gtoken: Gtoken, Gtoken: Gtoken,
baseurl: baseurl, baseurl: baseurl,
fileList: [], fileList: [],
downList: [ downList: [],
],
showDialog: false, showDialog: false,
DialogWidth: '40vw', DialogWidth: '40vw',
DialogTitle: '新增明细', DialogTitle: '新增明细',
...@@ -267,7 +291,7 @@ ...@@ -267,7 +291,7 @@
prop: 'jxwlXh', prop: 'jxwlXh',
} }
], ],
editTableTitle4:[{ editTableTitle4: [{
label: '设备名称', label: '设备名称',
prop: 'sbxxName', prop: 'sbxxName',
width: '260' width: '260'
...@@ -289,14 +313,50 @@ ...@@ -289,14 +313,50 @@
}, },
],
editTableTitle5: [{
label: '焊接缝编码',
prop: 'code',
width: '260'
},
{
label: '焊接位置',
prop: 'hjwz',
width: '260'
},
{
label: '母材1材质',
prop: 'mcone',
width: '260'
},
{
label: '母材2材质',
prop: 'mctwo',
width: '260'
},
{
label: '备注',
prop: 'bz',
width: '300'
}
], ],
editTableData1: [], editTableData1: [],
editTableData2: [], editTableData2: [],
editTableData3: [], editTableData3: [],
editTableData4: [], editTableData4: [],
editTableData5: [],
/* 调整*/ /* 调整*/
activeName: '1', activeName: '1',
editColItemList: [{ editColItemList: [{
label: '订单号(AUFNR)',
prop: 'aufnr',
span: 24,
type: 'input',
},
{
label: '设备名称', label: '设备名称',
prop: 'sbxxName', prop: 'sbxxName',
span: 12, span: 12,
...@@ -329,17 +389,56 @@ ...@@ -329,17 +389,56 @@
{ {
label: '是否大修', label: '是否大修',
prop: 'sfdx', prop: 'sfdx',
span: 4, span: 6,
type: 'checkbox', "type": "RelSelect",
value: 'Y' "value": "",
"typeConfig": {
hasValue: false,
clearable: true,
"src": "yhlywpc/uywxx/init/istrue",
"match": {
"value": "id",
"label": "name"
}
}
},
// {
// label: '版本',
// prop: 'version',
// span: 6,
// type: 'inputNumber',
// },
{
label: '时间(ADUHR)',
prop: 'aduhr',
span: 6,
type: 'datetime',
}, },
{ {
label: '大修编码', label: '专业(ILOAN)',
prop: 'dxdm', prop: 'iloan',
span: 20, span: 12,
type: 'input', type: 'input',
value:'YJ'
}, },
{
label: '工作中心(GEWRK)',
prop: 'gewrk',
span: 12,
type: 'input',
},
{
label: '工厂维护和客户服务(REVNR)',
prop: 'revnr',
span: 12,
type: 'input',
},
// {
// label: '大修编码',
// prop: 'dxdm',
// span: 20,
// type: 'input',
// value:'YJ'
// },
{ {
label: '备注', label: '备注',
prop: 'bz', prop: 'bz',
...@@ -361,12 +460,19 @@ ...@@ -361,12 +460,19 @@
type: 'checkbox', type: 'checkbox',
value: 'N' value: 'N'
}, },
{
label: '焊接使用',
prop: 'sfhjsy',
span: 6,
type: 'checkbox',
value: 'N'
},
] ]
} }
}, },
methods: { methods: {
sizeFormatter(bytes){ sizeFormatter(bytes) {
if (bytes === 0) return '0 B'; if (bytes === 0) return '0 B';
var k = 1000, // or 1024 var k = 1000, // or 1024
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
...@@ -374,11 +480,11 @@ ...@@ -374,11 +480,11 @@
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i]; return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
}, },
download(item){ download(item) {
let url=`jxgl/usbjx/attachment/download/${item.id}` let url = `jxgl/usbjx/attachment/download/${item.id}`
this.$cDownload(url, {},item.name) this.$cDownload(url, {}, item.name)
}, },
delitem(id,index) { delitem(id, index) {
this.$confirm('是否继续操作, 是否继续?', '提示', { this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -473,6 +579,13 @@ ...@@ -473,6 +579,13 @@
this.editTableData4.push(item) this.editTableData4.push(item)
}) })
}) })
this.$post('jxgl/uhjxx/query', {
mid: form.id
}).then(res => {
res.data.records.forEach(item => {
this.editTableData5.push(item)
})
})
}, },
save() { save() {
...@@ -480,10 +593,10 @@ ...@@ -480,10 +593,10 @@
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
if (this.type == 'add') { if (this.type == 'add') {
let attachments=[] let attachments = []
this.attachmentList.forEach(item=>{ this.attachmentList.forEach(item => {
attachments.push({ attachments.push({
id:item id: item
}) })
}) })
let params = { let params = {
...@@ -503,6 +616,10 @@ ...@@ -503,6 +616,10 @@
{ {
id: 'U_JXZYFF', id: 'U_JXZYFF',
records: [...this.editTableData4] || [] records: [...this.editTableData4] || []
},
{
id: 'U_HJXX',
records: [...this.editTableData5] || []
} }
], ],
master: this.form master: this.form
...@@ -512,30 +629,30 @@ ...@@ -512,30 +629,30 @@
this.$success('添加成功') this.$success('添加成功')
this.$refs.reldialog.closeAll() this.$refs.reldialog.closeAll()
let newData = this.form let newData = this.form
newData.id=res.data.id newData.id = res.data.id
this.app.$refs.TablePager.tableData.unshift(newData) this.app.$refs.TablePager.tableData.unshift(newData)
/* 总数据++ */ /* 总数据++ */
this.app.$refs.TablePager.total+=1 this.app.$refs.TablePager.total += 1
/* 选中当前行 */ /* 选中当前行 */
this.app.$refs.TablePager.setCurrent(newData) this.app.$refs.TablePager.setCurrent(newData)
} }
}) })
}else if(this.type=='edit'){ } else if (this.type == 'edit') {
/* 修改的时候先拿去加载的文件list /* 修改的时候先拿去加载的文件list
和上传的list 混合然后上传 和上传的list 混合然后上传
*/ */
let attachments=[] let attachments = []
this.attachmentList.forEach(item=>{ this.attachmentList.forEach(item => {
attachments.push({ attachments.push({
id:item id: item
}) })
}) })
this.downList.forEach(item=>{ this.downList.forEach(item => {
attachments.push({ attachments.push({
id:item.id id: item.id
}) })
}) })
...@@ -557,6 +674,10 @@ ...@@ -557,6 +674,10 @@
{ {
id: 'U_JXZYFF', id: 'U_JXZYFF',
records: [...this.editTableData4] || [] records: [...this.editTableData4] || []
},
{
id: 'U_HJXX',
records: [...this.editTableData5] || []
} }
], ],
master: this.form master: this.form
...@@ -586,7 +707,12 @@ ...@@ -586,7 +707,12 @@
} }
}) })
}, },
savejxzyff(data){ savehjsy(data){
let ndata = _.cloneDeep(data)
this.editTableData5.push(ndata)
this.showDialog = false
},
savejxzyff(data) {
let ndata = _.cloneDeep(data) let ndata = _.cloneDeep(data)
this.editTableData4.push(ndata) this.editTableData4.push(ndata)
this.showDialog = false this.showDialog = false
...@@ -612,21 +738,21 @@ ...@@ -612,21 +738,21 @@
}, },
cktzjxgj() { cktzjxgj() {
let singleItem = this.$refs.jxgjTab.$refs.editTable.singleItem let singleItem = this.$refs.jxgjTab.$refs.editTable.singleItem
if(Object.keys(singleItem).length==0){ if (Object.keys(singleItem).length == 0) {
this.$warning('请选中一条数据进行操作') this.$warning('请选中一条数据进行操作')
}else{ } else {
this.DialogTitle = '工具' this.DialogTitle = '工具'
this.showDialog = true this.showDialog = true
this.$nextTick(()=>{ this.$nextTick(() => {
if(Array.isArray(singleItem.photo)){ if (Array.isArray(singleItem.photo)) {
}else{ } else {
singleItem.photo=JSON.parse(singleItem.photo) singleItem.photo = JSON.parse(singleItem.photo)
} }
console.log(this.$refs.addgjmx) console.log(this.$refs.addgjmx)
this.$refs.addgjmx.form=singleItem this.$refs.addgjmx.form = singleItem
this.$refs.addgjmx.rtype='update' this.$refs.addgjmx.rtype = 'update'
}) })
} }
}, },
...@@ -636,21 +762,21 @@ ...@@ -636,21 +762,21 @@
}, },
cktzbpbj() { cktzbpbj() {
let singleItem = this.$refs.bpbjTab.$refs.editTable.singleItem let singleItem = this.$refs.bpbjTab.$refs.editTable.singleItem
if(Object.keys(singleItem).length==0){ if (Object.keys(singleItem).length == 0) {
this.$warning('请选中一条数据进行操作') this.$warning('请选中一条数据进行操作')
}else{ } else {
this.DialogTitle = '备品备件' this.DialogTitle = '备品备件'
this.showDialog = true this.showDialog = true
this.$nextTick(()=>{ this.$nextTick(() => {
if(Array.isArray(singleItem.photo)){ if (Array.isArray(singleItem.photo)) {
}else{ } else {
singleItem.photo=JSON.parse(singleItem.photo) singleItem.photo = JSON.parse(singleItem.photo)
} }
this.$refs.addbpbjmx.form=singleItem this.$refs.addbpbjmx.form = singleItem
this.$refs.addbpbjmx.rtype='update' this.$refs.addbpbjmx.rtype = 'update'
}) })
} }
}, },
...@@ -658,48 +784,52 @@ ...@@ -658,48 +784,52 @@
this.DialogTitle = '耗材' this.DialogTitle = '耗材'
this.showDialog = true this.showDialog = true
}, },
cktzhc(){ cktzhc() {
let singleItem = this.$refs.hcTab.$refs.editTable.singleItem let singleItem = this.$refs.hcTab.$refs.editTable.singleItem
if(Object.keys(singleItem).length==0){ if (Object.keys(singleItem).length == 0) {
this.$warning('请选中一条数据进行操作') this.$warning('请选中一条数据进行操作')
}else{ } else {
this.DialogTitle = '耗材' this.DialogTitle = '耗材'
this.showDialog = true this.showDialog = true
this.$nextTick(()=>{ this.$nextTick(() => {
if(Array.isArray(singleItem.photo)){ if (Array.isArray(singleItem.photo)) {
}else{ } else {
singleItem.photo=JSON.parse(singleItem.photo) singleItem.photo = JSON.parse(singleItem.photo)
} }
this.$refs.addhcmx.form=singleItem this.$refs.addhcmx.form = singleItem
this.$refs.addhcmx.rtype='update' this.$refs.addhcmx.rtype = 'update'
}) })
} }
}, },
addjxzyff(){ addhjsy(){
this.DialogTitle = '焊接使用'
this.showDialog = true
},
addjxzyff() {
this.DialogTitle = '检修作业方法' this.DialogTitle = '检修作业方法'
this.showDialog = true this.showDialog = true
}, },
cktzjxzyff(){ cktzjxzyff() {
let singleItem = this.$refs.jxzyffTab.$refs.editTable.singleItem let singleItem = this.$refs.jxzyffTab.$refs.editTable.singleItem
if(Object.keys(singleItem).length==0){ if (Object.keys(singleItem).length == 0) {
this.$warning('请选中一条数据进行操作') this.$warning('请选中一条数据进行操作')
}else{ } else {
this.DialogTitle = '检修作业方法' this.DialogTitle = '检修作业方法'
this.showDialog = true this.showDialog = true
this.$nextTick(()=>{ this.$nextTick(() => {
if(Array.isArray(singleItem.photo)){ if (Array.isArray(singleItem.photo)) {
}else{ } else {
singleItem.photo=JSON.parse(singleItem.photo) singleItem.photo = JSON.parse(singleItem.photo)
} }
console.log(singleItem) console.log(singleItem)
this.$refs.addjxzyff.form=singleItem this.$refs.addjxzyff.form = singleItem
this.$refs.addjxzyff.rtype='update' this.$refs.addjxzyff.rtype = 'update'
}) })
} }
......
...@@ -36,7 +36,13 @@ ...@@ -36,7 +36,13 @@
/* 基本配置*/ /* 基本配置*/
url: 'jxgl/usbjx', url: 'jxgl/usbjx',
tableTitle: [{ tableTitle: [
{
title: "订单号(AUFNR)",
field: "aufnr",
width: 180
},
{
title: "设备名称", title: "设备名称",
field: "sbxxName", field: "sbxxName",
width: 180 width: 180
...@@ -53,9 +59,24 @@ ...@@ -53,9 +59,24 @@
fieldType: "checkbox" fieldType: "checkbox"
}, },
{ {
title: "大修编码", title: "时间(ADUHR)",
field: "dxdm", field: "aduhr",
width: 350 fieldType: 'ftDateTime',
},
{
title: "专业(ILOAN)",
field: "iloan",
width: 120
},
{
title: "工作中心(GEWRK)",
field: "gewrk",
width: 120
},
{
title: "工厂维护和客户服务(REVNR)",
field: "revnr",
width: 120
}, },
{ {
title: "备品备件使用", title: "备品备件使用",
...@@ -67,6 +88,11 @@ ...@@ -67,6 +88,11 @@
field: "sfsyhc", field: "sfsyhc",
fieldType: "checkbox" fieldType: "checkbox"
}, },
{
title: "焊接使用",
field: "sfhjsy",
fieldType: "checkbox"
},
{ {
title: "备注", title: "备注",
field: "bz", field: "bz",
......
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