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 @@
<RelDialog @getForm='getForm' ref="reldialog" width="80vw" :type='type' :editApp='editApp' :app='app'
:buttonApp='buttonApp'>
<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>
<addbpbjmx ref="addbpbjmx" @save='savebpbj' v-if="showDialog&&DialogTitle=='备品备件'" :app="this"></addbpbjmx>
<addhcmx ref="addhcmx" @save='savehc' v-if="showDialog&&DialogTitle=='耗材'" :app="this"></addhcmx>
<addjxzyff ref="addjxzyff" @save='savejxzyff' v-if="showDialog&&DialogTitle=='检修作业方法'" :app="this" />
<addbpbjmx ref="addbpbjmx" @save='savebpbj' v-if="showDialog&&DialogTitle=='备品备件'" :app="this"></addbpbjmx>
<addhcmx ref="addhcmx" @save='savehc' v-if="showDialog&&DialogTitle=='耗材'" :app="this"></addhcmx>
<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">
<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"
......@@ -27,11 +28,11 @@
</el-tab-pane>
<el-tab-pane v-if="form.sfsybpbj=='Y'" label="备品备件使用" name="2">
<div style="height: 300px;">
<editTableForEdit :phsxTitle='false' :expandTitle='false' code='false' :AuxButton='false' :indexApp='app'
<editTableForEdit :phsxTitle='false' :expandTitle='false' code='false' :AuxButton='false' :indexApp='app'
:type='type' ref="bpbjTab" :editTableTitle='editTableTitle2' :editTableData="editTableData2">
<template v-if="type!='view'" #toolbar="ctx">
<el-button @click="addbpbj" size='mini' type="primary">新增备品备件</el-button>
<el-button @click="cktzbpbj" size='mini' type="primary">查看调整备品备件</el-button>
<el-button @click="cktzbpbj" size='mini' type="primary">查看调整备品备件</el-button>
</template>
</editTableForEdit>
</div>
......@@ -42,16 +43,28 @@
:type='type' ref="hcTab" :editTableTitle='editTableTitle3' :editTableData="editTableData3">
<template v-if="type!='view'" #toolbar="ctx">
<el-button @click="addhcmx" size='mini' type="primary">新增耗材</el-button>
<el-button @click="cktzhc" size='mini' type="primary">查看调整耗材</el-button>
<el-button @click="cktzhc" size='mini' type="primary">查看调整耗材</el-button>
</template>
</editTableForEdit>
</div>
</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;">
<editTableForEdit ref="jxzyffTab" :phsxTitle='false' :expandTitle='false' code='false' :AuxButton='false' :indexApp='app'
:type='type' :editTableTitle='editTableTitle4' :editTableData="editTableData4">
<editTableForEdit ref="jxzyffTab" :phsxTitle='false' :expandTitle='false' code='false' :AuxButton='false'
:indexApp='app' :type='type' :editTableTitle='editTableTitle4' :editTableData="editTableData4">
<template v-if="type!='view'" #toolbar="ctx">
<el-button @click="addjxzyff" size='mini' type="primary">新增检修作业</el-button>
......@@ -63,7 +76,7 @@
<el-tab-pane label="完工附件" name="4">
<!-- 上传div-->
<div v-if="type!='view'" style="border-bottom: 1px solid #eee;padding-bottom: 20px;">
<div v-if="type!='view'" style="border-bottom: 1px solid #eee;padding-bottom: 20px;">
<span style="line-height: 40px;font-size: 12px;font-weight: 700;color: #666;">附件上传</span>
<div class="upload padding-10">
<el-upload ref="upload" :headers='{
......@@ -111,7 +124,7 @@
{{ sizeFormatter(item.size) }}
</div>
<div class="down">
<el-button @click="download(item)" size="mini" type="success">下载文件</el-button>
<el-button @click="download(item)" size="mini" type="success">下载文件</el-button>
</div>
<div class="del">
<el-button @click="delitem(item.id,index)" size="mini" type="danger">删除文件</el-button>
......@@ -138,6 +151,7 @@
import addbpbjmx from './addbpbjmx.vue'
import addhcmx from './addhcmx.vue'
import addjxzyff from './addjxzyff.vue'
import addhjsy from './addhjsy.vue'
import {
autoAttachDownload,
} from "common/src/api/system/dmgSystem.js";
......@@ -153,9 +167,13 @@
addgjmx,
addbpbjmx,
addhcmx,
addjxzyff
addjxzyff,
addhjsy
},
computed: {
sfhjsy() {
return this.form.sfhjsy
},
sfsybpbj() {
return this.form.sfsybpbj
},
......@@ -163,17 +181,24 @@
return this.form.sfsyhc
}
},
computed:{
dxdm(){
return this.form.dxdm
}
computed: {
// dxdm(){
// return this.form.dxdm
// }
},
watch: {
dxdm(val){
if(!val.startsWith("YJ")){
this.form.dxdm="YJ".concat(val)
}
// dxdm(val){
// if(!val.startsWith("YJ")){
// this.form.dxdm="YJ".concat(val)
// }
// },
sfhjsy(v){
if (v == 'Y') {
this.activeName = '6'
} else {
this.activeName = '1'
}
},
sfsybpbj(v) {
if (v == 'Y') {
......@@ -192,12 +217,11 @@
},
data() {
return {
attachmentList:[],
attachmentList: [],
Gtoken: Gtoken,
baseurl: baseurl,
fileList: [],
downList: [
],
downList: [],
showDialog: false,
DialogWidth: '40vw',
DialogTitle: '新增明细',
......@@ -267,36 +291,72 @@
prop: 'jxwlXh',
}
],
editTableTitle4:[{
label: '设备名称',
prop: 'sbxxName',
width: '260'
},
{
label: '设备编码',
prop: 'sbxxCode',
width: '260'
},
{
label: '检修作业方法编码',
prop: 'code',
width: '260'
},
{
label: '检修作业方法',
prop: 'name',
width: '260'
},
editTableTitle4: [{
label: '设备名称',
prop: 'sbxxName',
width: '260'
},
{
label: '设备编码',
prop: 'sbxxCode',
width: '260'
},
{
label: '检修作业方法编码',
prop: 'code',
width: '260'
},
{
label: '检修作业方法',
prop: 'name',
width: '260'
},
],
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: [],
editTableData2: [],
editTableData3: [],
editTableData4: [],
editTableData4: [],
editTableData5: [],
/* 调整*/
activeName: '1',
editColItemList: [{
label: '订单号(AUFNR)',
prop: 'aufnr',
span: 24,
type: 'input',
},
{
label: '设备名称',
prop: 'sbxxName',
span: 12,
......@@ -329,17 +389,56 @@
{
label: '是否大修',
prop: 'sfdx',
span: 4,
type: 'checkbox',
value: 'Y'
span: 6,
"type": "RelSelect",
"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: '专业(ILOAN)',
prop: 'iloan',
span: 12,
type: 'input',
},
{
label: '大修编码',
prop: 'dxdm',
span: 20,
label: '工作中心(GEWRK)',
prop: 'gewrk',
span: 12,
type: 'input',
value:'YJ'
},
{
label: '工厂维护和客户服务(REVNR)',
prop: 'revnr',
span: 12,
type: 'input',
},
// {
// label: '大修编码',
// prop: 'dxdm',
// span: 20,
// type: 'input',
// value:'YJ'
// },
{
label: '备注',
prop: 'bz',
......@@ -361,30 +460,37 @@
type: 'checkbox',
value: 'N'
},
{
label: '焊接使用',
prop: 'sfhjsy',
span: 6,
type: 'checkbox',
value: 'N'
},
]
}
},
methods: {
sizeFormatter(bytes){
if (bytes === 0) return '0 B';
var k = 1000, // or 1024
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
},
download(item){
let url=`jxgl/usbjx/attachment/download/${item.id}`
this.$cDownload(url, {},item.name)
sizeFormatter(bytes) {
if (bytes === 0) return '0 B';
var k = 1000, // or 1024
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
},
download(item) {
let url = `jxgl/usbjx/attachment/download/${item.id}`
this.$cDownload(url, {}, item.name)
},
delitem(id,index) {
delitem(id, index) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.downList.splice(index, 1)
this.downList.splice(index, 1)
})
},
handleRemove(file, fileList) {
......@@ -409,7 +515,7 @@
attachmentList.push(item.response.data.records.id)
}
})
this.attachmentList = attachmentList
this.attachmentList = attachmentList
} else {
const delIndex = fileList.findIndex(item => item.uid === file.uid);
if (delIndex !== -1) {
......@@ -473,6 +579,13 @@
this.editTableData4.push(item)
})
})
this.$post('jxgl/uhjxx/query', {
mid: form.id
}).then(res => {
res.data.records.forEach(item => {
this.editTableData5.push(item)
})
})
},
save() {
......@@ -480,10 +593,10 @@
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.type == 'add') {
let attachments=[]
this.attachmentList.forEach(item=>{
let attachments = []
this.attachmentList.forEach(item => {
attachments.push({
id:item
id: item
})
})
let params = {
......@@ -503,6 +616,10 @@
{
id: 'U_JXZYFF',
records: [...this.editTableData4] || []
},
{
id: 'U_HJXX',
records: [...this.editTableData5] || []
}
],
master: this.form
......@@ -511,33 +628,33 @@
if (res.success) {
this.$success('添加成功')
this.$refs.reldialog.closeAll()
let newData = this.form
newData.id=res.data.id
this.app.$refs.TablePager.tableData.unshift(newData)
/* 总数据++ */
this.app.$refs.TablePager.total+=1
/* 选中当前行 */
this.app.$refs.TablePager.setCurrent(newData)
let newData = this.form
newData.id = res.data.id
this.app.$refs.TablePager.tableData.unshift(newData)
/* 总数据++ */
this.app.$refs.TablePager.total += 1
/* 选中当前行 */
this.app.$refs.TablePager.setCurrent(newData)
}
})
}else if(this.type=='edit'){
} else if (this.type == 'edit') {
/* 修改的时候先拿去加载的文件list
和上传的list 混合然后上传
*/
let attachments=[]
this.attachmentList.forEach(item=>{
attachments.push({
id:item
})
})
this.downList.forEach(item=>{
attachments.push({
id:item.id
})
})
let attachments = []
this.attachmentList.forEach(item => {
attachments.push({
id: item
})
})
this.downList.forEach(item => {
attachments.push({
id: item.id
})
})
let params = {
......@@ -557,6 +674,10 @@
{
id: 'U_JXZYFF',
records: [...this.editTableData4] || []
},
{
id: 'U_HJXX',
records: [...this.editTableData5] || []
}
],
master: this.form
......@@ -568,14 +689,14 @@
let nowIndex = false
let tableData = this.app.$refs['TablePager'].tableData
tableData.forEach((data, index) => {
if (data.id == params.master.id) {
nowIndex = index
}
if (data.id == params.master.id) {
nowIndex = index
}
})
if (nowIndex !== false) {
this.app.$refs['TablePager'].tableData.splice(nowIndex, 1, params
.master)
this.app.$refs['TablePager'].setCurrent(params.master)
this.app.$refs['TablePager'].tableData.splice(nowIndex, 1, params
.master)
this.app.$refs['TablePager'].setCurrent(params.master)
}
}
})
......@@ -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)
this.editTableData4.push(ndata)
this.showDialog = false
......@@ -612,21 +738,21 @@
},
cktzjxgj() {
let singleItem = this.$refs.jxgjTab.$refs.editTable.singleItem
if(Object.keys(singleItem).length==0){
if (Object.keys(singleItem).length == 0) {
this.$warning('请选中一条数据进行操作')
}else{
} else {
this.DialogTitle = '工具'
this.showDialog = true
this.$nextTick(()=>{
if(Array.isArray(singleItem.photo)){
this.$nextTick(() => {
if (Array.isArray(singleItem.photo)) {
}else{
singleItem.photo=JSON.parse(singleItem.photo)
} else {
singleItem.photo = JSON.parse(singleItem.photo)
}
console.log(this.$refs.addgjmx)
this.$refs.addgjmx.form=singleItem
this.$refs.addgjmx.rtype='update'
this.$refs.addgjmx.form = singleItem
this.$refs.addgjmx.rtype = 'update'
})
}
},
......@@ -636,21 +762,21 @@
},
cktzbpbj() {
let singleItem = this.$refs.bpbjTab.$refs.editTable.singleItem
if(Object.keys(singleItem).length==0){
if (Object.keys(singleItem).length == 0) {
this.$warning('请选中一条数据进行操作')
}else{
} else {
this.DialogTitle = '备品备件'
this.showDialog = true
this.$nextTick(()=>{
if(Array.isArray(singleItem.photo)){
this.$nextTick(() => {
if (Array.isArray(singleItem.photo)) {
}else{
singleItem.photo=JSON.parse(singleItem.photo)
} else {
singleItem.photo = JSON.parse(singleItem.photo)
}
this.$refs.addbpbjmx.form=singleItem
this.$refs.addbpbjmx.rtype='update'
this.$refs.addbpbjmx.form = singleItem
this.$refs.addbpbjmx.rtype = 'update'
})
}
},
......@@ -658,48 +784,52 @@
this.DialogTitle = '耗材'
this.showDialog = true
},
cktzhc(){
cktzhc() {
let singleItem = this.$refs.hcTab.$refs.editTable.singleItem
if(Object.keys(singleItem).length==0){
if (Object.keys(singleItem).length == 0) {
this.$warning('请选中一条数据进行操作')
}else{
} else {
this.DialogTitle = '耗材'
this.showDialog = true
this.$nextTick(()=>{
this.$nextTick(() => {
if(Array.isArray(singleItem.photo)){
if (Array.isArray(singleItem.photo)) {
}else{
singleItem.photo=JSON.parse(singleItem.photo)
} else {
singleItem.photo = JSON.parse(singleItem.photo)
}
this.$refs.addhcmx.form=singleItem
this.$refs.addhcmx.rtype='update'
this.$refs.addhcmx.form = singleItem
this.$refs.addhcmx.rtype = 'update'
})
}
},
addjxzyff(){
addhjsy(){
this.DialogTitle = '焊接使用'
this.showDialog = true
},
addjxzyff() {
this.DialogTitle = '检修作业方法'
this.showDialog = true
},
cktzjxzyff(){
cktzjxzyff() {
let singleItem = this.$refs.jxzyffTab.$refs.editTable.singleItem
if(Object.keys(singleItem).length==0){
if (Object.keys(singleItem).length == 0) {
this.$warning('请选中一条数据进行操作')
}else{
} else {
this.DialogTitle = '检修作业方法'
this.showDialog = true
this.$nextTick(()=>{
if(Array.isArray(singleItem.photo)){
this.$nextTick(() => {
if (Array.isArray(singleItem.photo)) {
}else{
singleItem.photo=JSON.parse(singleItem.photo)
} else {
singleItem.photo = JSON.parse(singleItem.photo)
}
console.log(singleItem)
this.$refs.addjxzyff.form=singleItem
this.$refs.addjxzyff.rtype='update'
this.$refs.addjxzyff.form = singleItem
this.$refs.addjxzyff.rtype = 'update'
})
}
......
......@@ -36,7 +36,13 @@
/* 基本配置*/
url: 'jxgl/usbjx',
tableTitle: [{
tableTitle: [
{
title: "订单号(AUFNR)",
field: "aufnr",
width: 180
},
{
title: "设备名称",
field: "sbxxName",
width: 180
......@@ -53,9 +59,24 @@
fieldType: "checkbox"
},
{
title: "大修编码",
field: "dxdm",
width: 350
title: "时间(ADUHR)",
field: "aduhr",
fieldType: 'ftDateTime',
},
{
title: "专业(ILOAN)",
field: "iloan",
width: 120
},
{
title: "工作中心(GEWRK)",
field: "gewrk",
width: 120
},
{
title: "工厂维护和客户服务(REVNR)",
field: "revnr",
width: 120
},
{
title: "备品备件使用",
......@@ -67,6 +88,11 @@
field: "sfsyhc",
fieldType: "checkbox"
},
{
title: "焊接使用",
field: "sfhjsy",
fieldType: "checkbox"
},
{
title: "备注",
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