Commit 8db2c804 authored by 李苏's avatar 李苏 💬

设备检修信息

parent 72697f0f
......@@ -58,7 +58,7 @@
give:(row)=>{
this.form.code=row.code
this.form.cz=row.cz
this.form.ggxh=row.ggxh
this.form.gg=row.gg
}
}
......@@ -80,7 +80,7 @@
{
label: '规格型号',
readonly:true,
prop: 'ggxh',
prop: 'gg',
span: 12,
type: 'input',
},
......
<template>
<RelDialog @getForm='getForm' ref="reldialog" width="80vw" :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<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;">
<addgjmx @save='addgjmxbc' v-if="showDialog&&DialogTitle=='新增工具'" :app="this"></addgjmx>
......@@ -37,32 +38,38 @@
<editTableForEdit :phsxTitle='false' :expandTitle='false' code='false' :AuxButton='false' :indexApp='app'
:type='type' ref="editTableForEdit1" :editTableTitle='editTableTitle3' :editTableData="editTableData3">
<template v-if="type!='view'" #toolbar="ctx">
<el-button @click="addhcmx" size='mini' type="primary">新增耗材</el-button>
<el-button @click="addhcmx" size='mini' type="primary">新增耗材</el-button>
</template>
</editTableForEdit>
</div>
</el-tab-pane>
<el-tab-pane label="完工附件" name="4">
<el-tab-pane label="完工附件" name="4">
<!-- 上传div-->
<div style="border-bottom: 1px solid #eee;padding-bottom: 20px;" >
<span style="line-height: 40px;font-size: 16px;font-weight: 700;color: #666;" >附件上传</span>
<div style="border-bottom: 1px solid #eee;padding-bottom: 20px;">
<span style="line-height: 40px;font-size: 16px;font-weight: 700;color: #666;">附件上传</span>
<div class="upload padding-10">
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-success="success"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
<el-upload
ref="upload"
:headers='{
Gtoken
}'
:data="{
groupid:'',
folder:'usbjx'
}"
class="upload-demo" :action="`${baseurl}/jxgl/usbjx/attachment/upload`" :on-success='success' :on-remove="handleRemove"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
<div v-if="type!='add'" >
<span style="line-height: 40px;font-size: 16px;font-weight: 700;color: #666;" >附件列表</span>
<div v-if="type!='add'">
<span style="line-height: 40px;font-size: 16px;font-weight: 700;color: #666;">附件列表</span>
<div class="download padding-10">
<div v-for="(item,index) in downList" :key="index" class="fileList">
<div v-for="(item,index) in downList" :key="index" class="fileList">
<div class="index">
{{index+1}}
</div>
......@@ -70,14 +77,14 @@
{{item.name}}
</div>
<div class="size">
{{item.size}}
{{item.size}}
</div>
<div class="down">
<span style="color: cornflowerblue;cursor: pointer;" >下载</span>
<span style="color: cornflowerblue;cursor: pointer;">下载</span>
</div>
<div class="del">
<span style="color: red;cursor: pointer;" >删除</span>
<span style="color: red;cursor: pointer;">删除</span>
</div>
</div>
......@@ -88,22 +95,27 @@
</el-tab-pane>
</el-tabs>
</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>
<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>
</div>
</RelDialog>
</template>
<script>
import addgjmx from './addgjmx.vue'
import addbpbjmx from './addbpbjmx.vue'
import addhcmx from './addhcmx.vue'
import {
autoAttachDownload,
} from "common/src/api/system/dmgSystem.js";
import {
editMixin
} from 'common'
import sbxx from '@/views/auxinput/sbxx'
const baseurl = process.env.VUE_APP_BASE_API
const Gtoken = localStorage.getItem('Gtoken')
export default {
mixins: [editMixin],
components: {
......@@ -111,41 +123,45 @@
addbpbjmx,
addhcmx
},
computed:{
sfsybpbj(){
computed: {
sfsybpbj() {
return this.form.sfsybpbj
},
sfsyhc(){
sfsyhc() {
return this.form.sfsyhc
}
},
watch:{
sfsybpbj(v){
if(v=='Y'){
this.activeName='2'
}else{
this.activeName='1'
watch: {
sfsybpbj(v) {
if (v == 'Y') {
this.activeName = '2'
} else {
this.activeName = '1'
}
},
sfsyhc(v){
if(v=='Y'){
this.activeName='3'
}else{
this.activeName='1'
sfsyhc(v) {
if (v == 'Y') {
this.activeName = '3'
} else {
this.activeName = '1'
}
}
},
data() {
return {
fileList:[],
downList:[
{
name:'测试1',
size:'200kb',
form:{
attachmentList:[]
},
Gtoken:Gtoken,
baseurl:baseurl,
fileList: [],
downList: [{
name: '测试1',
size: '200kb',
},
{
name:'测试2',
size:'2030kb',
name: '测试2',
size: '2030kb',
}
],
......@@ -170,7 +186,7 @@
},
{
label: '规格型号',
prop: 'ggxh',
prop: 'gg',
}
],
......@@ -218,7 +234,7 @@
activeName: '1',
editColItemList: [{
label: '设备名称',
prop: 'sbxxCode',
prop: 'sbxxName',
span: 12,
required: true,
type: 'AuxInput',
......@@ -285,66 +301,120 @@
}
},
methods: {
getForm(form){
this.$post('jxgl/ujxgj/query',{
mid:form.id
}).then(res=>{
res.data.records.forEach(item=>{
handleRemove(file, fileList) {
let attachmentList = []
fileList.forEach(item => {
if (item.status == 'success') {
attachmentList.push(item.response.data.id)
}
})
this.form.attachmentList = attachmentList
},
success(res, file, fileList) {
console.log(res,'asdasdas')
if (res.success) {
this.$success('上传成功')
/* 成功后同步fileList数据到form表单*/
let attachmentList = []
fileList.forEach(item => {
if (item.status == 'success') {
attachmentList.push(item.response.data.id)
}
})
this.form.attachmentList = attachmentList
} else {
const delIndex = fileList.findIndex(item => item.uid === file.uid);
if (delIndex !== -1) {
fileList.splice(delIndex, 1);
this.$error(res.message || '未知错误');
}
}
},
getForm(form) {
/* 获取附件*/
this.$post('jxgl/ujxgj/attachment/list', {
groupid: form.id,
}).then(res => {
res.data.records.forEach(item => {
autoAttachDownload({}, 'jxgl/ujxgj', item.id).then(res => {
let blob = new Blob([res], {
type: 'application/' + item.type + ';charset=UTF-8',
});
let url = URL.createObjectURL(blob)
let uitem = {
url,
id: item.id
}
this.downList.push(uitem)
})
})
})
this.$post('jxgl/ujxgj/query', {
mid: form.id
}).then(res => {
res.data.records.forEach(item => {
this.editTableData1.push(item)
console.log(this.editTableData1,'this.editTableData1')
})
})
this.$post('jxgl/ujxwl/query',{
mid:form.id
}).then(res=>{
res.data.records.forEach(item=>{
this.editTableData3.push(item)
})
this.$post('jxgl/ujxwl/query', {
mid: form.id
}).then(res => {
res.data.records.forEach(item => {
this.editTableData3.push(item)
})
})
this.$post('jxgl/ubpbj/query',{
mid:form.id
}).then(res=>{
res.data.records.forEach(item=>{
this.editTableData2.push(item)
})
this.$post('jxgl/ubpbj/query', {
mid: form.id
}).then(res => {
res.data.records.forEach(item => {
this.editTableData2.push(item)
})
})
},
save(){
save() {
this.$refs['form'].validate((valid) => {
if (valid) {
if(this.type=='add'){
let params = {
details: [{
id: 'U_JXGJ',
records: [...this.editTableData1] || []
},
{
id: 'U_JXWL',
records: [...this.editTableData3] || []
},
{
id: 'U_BPBJ',
records: [...this.editTableData2] || []
}],
master: this.form
}
this.$post('jxgl/usbjx/add',params).then(res=>{
if(res.success){
this.$success('添加成功')
this.$refs.reldialog.closeAll()
}
})
if (this.type == 'add') {
let params = {
details: [{
id: 'U_JXGJ',
records: [...this.editTableData1] || []
},
{
id: 'U_JXWL',
records: [...this.editTableData3] || []
},
{
id: 'U_BPBJ',
records: [...this.editTableData2] || []
}
],
master: this.form
}
this.$post('jxgl/usbjx/add', params).then(res => {
if (res.success) {
this.$success('添加成功')
this.$refs.reldialog.closeAll()
this.app.refresh()
}
})
}
}
})
},
success(response, file, fileList){
console.log(response, file, fileList)
},
savehc(data) {
let ndata = _.cloneDeep(data)
this.editTableData3.push(ndata)
......@@ -375,34 +445,41 @@
}
}
</script>
<style lang="scss" scoped>
.el-tooltip {
<style lang="scss" scoped>
::v-deep .el-tooltip {
display: none;
}
.download{
.download {
width: 100%;
border-top: 1px solid #eee;
}
.fileList{
.fileList {
display: flex;
line-height: 35px;
width: 100%;
border-bottom: 1px solid #eee;
text-align: center;
.index{
.index {
width: 5%;
}
.name{
.name {
width: 35%;
}
.size{
.size {
width: 20%;
}
.down{
.down {
width: 20%;
}
.del{
.del {
width: 20%;
}
}
......
<template>
<BasePage class="min_full" :config="config">
<BasePage :power='power' class="min_full" :config="config">
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
......@@ -17,8 +17,23 @@
name: 'sbjxxx',
data() {
return {
power: {
add: true,
copy: false,
/* 手动控制删除 */
delButton: true,
/* 手动控制编辑按钮权限 */
editButton: true,
/* 是否渲染右侧操作按钮 */
operateButtons: true,
/* 是否开启工作流按钮 */
workFlow: false,
/* 表格开启选择,以及记住选择 */
showSelection: false,
saveSelected: false
},
config: {
queryDetail:true,
/* 基本配置*/
url: 'jxgl/usbjx',
tableTitle: [{
......@@ -43,49 +58,14 @@
width: 350
},
{
title: "备品备件名称",
field: "bpbjmc",
width: 130
},
{
title: "备品备件编码",
field: "bpbjbm",
width: 130
},
{
title: "备品备件材料牌号",
field: "bpbjclph",
width: 200
},
{
title: "备品备件规格",
field: "bpbjgg",
width: 130
},
{
title: "检修内容",
field: "jxnr",
width: 350
},
{
title: "检修时间",
field: "jxsj",
fieldType: "ftDateTime"
},
{
title: "检修方法",
field: "jxffid",
width: 140,
transform: {
url: 'jxgl/ujxzyff/query',
"label": "name",
"value": "id"
}
title: "备品备件使用",
field: "sfsybpbj",
fieldType: "checkbox"
},
{
title: "完工报告",
field: "wgbg",
width: 350
title: "耗材使用",
field: "sfsyhc",
fieldType: "checkbox"
},
{
title: "备注",
......
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