|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-button size="mini" type="text" @click="onEdit">{{$t(`编辑`)}}</el-button>
|
|
|
+ <el-button size="mini" type="text" @click="onEdit">{{$t(type)}}</el-button>
|
|
|
<el-drawer
|
|
|
:visible.sync="drawerVisible"
|
|
|
size="700px"
|
|
|
@@ -22,7 +22,7 @@
|
|
|
</template>
|
|
|
<div class="drawer__panel" style="margin-bottom: 0 !important;" v-if="detailInfo">
|
|
|
<div class="title-div">{{$t(`操作说明`)}}:</div>
|
|
|
- <div class="content-div">{{detailInfo.workpresetjson.remarks || $t(`暂无说明`)}}</div>
|
|
|
+ <div class="content-div" style="margin-top: 10px">{{detailInfo.workpresetjson.remarks || $t(`暂无数据`)}}</div>
|
|
|
</div>
|
|
|
<div class="div-style-div"></div>
|
|
|
<div class="title-div-title">{{$t(`操作人员`)}}:</div>
|
|
|
@@ -38,24 +38,26 @@
|
|
|
<div v-if="detailInfo.team.length > 0" class="inline-16">
|
|
|
<el-tag
|
|
|
v-for="item in detailInfo.team"
|
|
|
+ :closable="type == '详情'?false:true"
|
|
|
:key="item.userid"
|
|
|
:type="item.type"
|
|
|
size="small"
|
|
|
+ @close="tagClose(item)"
|
|
|
style="margin-right: 5px;margin-bottom: 5px"
|
|
|
effect="info">
|
|
|
{{ item.name }}
|
|
|
</el-tag>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <addTeam :data="teamList" :teamData="detailInfo.team" :detailInfo="detailInfo" @addTeam="addTeam"></addTeam>
|
|
|
+ <addTeam :data="teamList" :teamData="detailInfo.team" :detailInfo="detailInfo" @addTeam="addTeam" :selectTeam="selectTeam" v-if="type == '编辑'"></addTeam>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="div-style-div"></div>
|
|
|
<div v-if="detailInfo && detailInfo.workpresetjson.confirm != 0">
|
|
|
<div class="title-div-title">{{$t(`是否确认`)}}<span v-if="detailInfo.workpresetjson.confirm == 11" style="color: #e13333">{{$t(`(必填)`)}}</span></div>
|
|
|
<div class="drawer__panel" style="margin-bottom: 0 !important;" v-if="detailInfo">
|
|
|
- <el-radio v-model="form.confirm_value" label="是" @change="onSave">{{$t(`是`)}}</el-radio>
|
|
|
- <el-radio v-model="form.confirm_value" label="否" @change="onSave">{{$t(`否`)}}</el-radio>
|
|
|
+ <el-radio v-model="form.confirm_value" label="是" @change="onSave" :disabled="type == '详情'">{{$t(`是`)}}</el-radio>
|
|
|
+ <el-radio v-model="form.confirm_value" label="否" @change="onSave" :disabled="type == '详情'">{{$t(`否`)}}</el-radio>
|
|
|
</div>
|
|
|
<div class="div-style-div"></div>
|
|
|
</div>
|
|
|
@@ -71,9 +73,10 @@
|
|
|
<p>{{(file.contentlength / 1024).toFixed(2)}}kb</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <i style="color:red;" class="el-icon-delete" @click="deleteFile(file,'附件')"></i>
|
|
|
+ <i style="color:red;" class="el-icon-delete" @click="deleteFile(file,'附件')" v-if="type == '编辑'"></i>
|
|
|
</div>
|
|
|
<upload
|
|
|
+ v-if="type == '编辑'"
|
|
|
:folderid="folderid"
|
|
|
@upload="loading = true"
|
|
|
btntype="icon"
|
|
|
@@ -90,7 +93,8 @@
|
|
|
<div v-if="detailInfo && detailInfo.workpresetjson.textedit != 0">
|
|
|
<div class="title-div-title">{{$t(`文本信息`)}}<span v-if="detailInfo.workpresetjson.textedit == 11" style="color: #e13333">{{$t(`(必填)`)}}</span></div>
|
|
|
<div class="drawer__panel" style="margin-bottom: 0 !important;" v-if="detailInfo">
|
|
|
- <el-input v-model="form.textcontent" size="small" placeholder="请填写文本" @blur="onSave"></el-input>
|
|
|
+ <el-input v-model="form.textcontent" size="small" placeholder="请填写文本" @blur="onSave" v-if="type == '编辑'"></el-input>
|
|
|
+ <div v-else class="content-div">{{form.textcontent || $t(`暂无数据`)}}</div>
|
|
|
</div>
|
|
|
<div class="div-style-div"></div>
|
|
|
</div>
|
|
|
@@ -106,9 +110,10 @@
|
|
|
<p>{{(file.contentlength / 1024).toFixed(2)}}kb</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <i style="color:red;" class="el-icon-delete" @click="deleteFile(file,'合同')"></i>
|
|
|
+ <i style="color:red;" class="el-icon-delete" @click="deleteFile(file,'合同')" v-if="type == '编辑'"></i>
|
|
|
</div>
|
|
|
<upload
|
|
|
+ v-if="type == '编辑'"
|
|
|
:folderid="folderid"
|
|
|
@upload="loading = true"
|
|
|
btntype="icon"
|
|
|
@@ -125,7 +130,12 @@
|
|
|
<div v-if="detailInfo && detailInfo.workpresetjson.amountpay != 0">
|
|
|
<div class="title-div-title">{{$t(`是否有偿`)}}<span v-if="detailInfo.workpresetjson.amountpay == 11" style="color: #e13333">{{$t(`(必填)`)}}</span></div>
|
|
|
<div class="drawer__panel" style="margin-bottom: 0 !important;" v-if="detailInfo">
|
|
|
- <el-input v-model="form.amount" size="small" placeholder="请填写文本" @blur="onSave"></el-input>
|
|
|
+ <div style="display:flex;justify-content: left" v-if="type == '编辑'">
|
|
|
+ <div style="width: 55px;">{{$t(`金额:`)}}</div><el-input v-model="form.amount" size="small" placeholder="请填写文本" @blur="onSave"></el-input>
|
|
|
+ </div>
|
|
|
+ <div style="display:flex;justify-content: left" v-else>
|
|
|
+ <div style="width: 55px;">{{$t(`金额:`)}}</div><div>{{tool.formatAmount(form.amount,2,'¥')}}</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="div-style-div"></div>
|
|
|
</div>
|
|
|
@@ -133,7 +143,7 @@
|
|
|
<div v-if="detailInfo && detailInfo.workpresetjson.signature != 0">
|
|
|
<div class="title-div-title">{{$t(`客户签字`)}}<span v-if="detailInfo.workpresetjson.signature == 11" style="color: #e13333">{{$t(`(必填)`)}}</span></div>
|
|
|
<div class="drawer__panel" style="margin-bottom: 0 !important;" v-if="detailInfo">
|
|
|
- <signature ref="signatureRef" :sa_workorder_nodeid="detailInfo.sa_workorder_nodeid" @signatureData=signatureData></signature>
|
|
|
+ <signature ref="signatureRef" :sa_workorder_nodeid="detailInfo.sa_workorder_nodeid" @signatureData=signatureData :type="type"></signature>
|
|
|
</div>
|
|
|
<div class="div-style-div"></div>
|
|
|
</div>
|
|
|
@@ -141,7 +151,7 @@
|
|
|
<div v-if="detailInfo && detailInfo.workpresetjson.addperson != 0">
|
|
|
<div class="title-div-title">{{$t(`培训人员`)}}<span v-if="detailInfo.workpresetjson.addperson == 11" style="color: #e13333">{{$t(`(必填)`)}}</span></div>
|
|
|
<div class="drawer__panel" style="margin-bottom: 0 !important;" v-if="detailInfo">
|
|
|
- <trainingPersonnel :data="trainers" @personnel="personnel"></trainingPersonnel>
|
|
|
+ <trainingPersonnel :data="trainers" @personnel="personnel" :type="type"></trainingPersonnel>
|
|
|
</div>
|
|
|
<div class="div-style-div"></div>
|
|
|
</div>
|
|
|
@@ -149,16 +159,17 @@
|
|
|
<div v-if="detailInfo && detailInfo.workpresetjson.additem != 0">
|
|
|
<div class="title-div-title">{{$t(`工单物料`)}}<span v-if="detailInfo.workpresetjson.additem == 11" style="color: #e13333">{{$t(`(必填)`)}}</span></div>
|
|
|
<div class="drawer__panel" style="margin-bottom: 0 !important;" v-if="detailInfo">
|
|
|
- <workMaterials :data="titems" @traintitems="traintitems" :itemtype="detailInfo.workpresetjson.itemtype" :sa_serviceorderid="mainData.sa_serviceorderid" :sa_workorderid="mainData.sa_workorderid"></workMaterials>
|
|
|
+ <workMaterials :data="titems" @traintitems="traintitems" :itemtype="detailInfo.workpresetjson.itemtype" :sa_serviceorderid="mainData.sa_serviceorderid" :sa_workorderid="mainData.sa_workorderid" :type="type"></workMaterials>
|
|
|
</div>
|
|
|
<div class="div-style-div"></div>
|
|
|
</div>
|
|
|
|
|
|
<div class="title-div-title">{{$t(`备注`)}}</div>
|
|
|
<div class="drawer__panel" v-if="detailInfo">
|
|
|
- <el-input v-model="form.remarks" size="small" placeholder="备注" @blur="onSave"></el-input>
|
|
|
+ <el-input v-model="form.remarks" size="small" placeholder="备注" @blur="onSave" v-if="type == '编辑'"></el-input>
|
|
|
+ <div v-else class="content-div">{{form.remarks || $t(`暂无数据`)}}</div>
|
|
|
</div>
|
|
|
- <div class="fixed__btn__panel">
|
|
|
+ <div class="fixed__btn__panel" v-if="type == '编辑'">
|
|
|
<el-button
|
|
|
size="small"
|
|
|
@click="drawerVisible = false"
|
|
|
@@ -195,7 +206,7 @@ import upload from '@/components/upload/hw_obs_upload.vue'
|
|
|
import previewImage from '@/components/previewImage/index.vue'
|
|
|
export default {
|
|
|
name: "edit",
|
|
|
- props:['data','mainData'],
|
|
|
+ props:['data','mainData','type'],
|
|
|
components:{addTeam,workMaterials,trainingPersonnel,signature,upload,previewImage},
|
|
|
data(){
|
|
|
return {
|
|
|
@@ -204,6 +215,7 @@ export default {
|
|
|
detailInfo:'',
|
|
|
teamList:[],
|
|
|
name:JSON.parse(sessionStorage.getItem('active_account')).name,
|
|
|
+ userid:JSON.parse(sessionStorage.getItem('active_account')).userid,
|
|
|
form:{
|
|
|
"sa_workorderid": 0,
|
|
|
"sa_workorder_nodeid": 0,
|
|
|
@@ -233,7 +245,8 @@ export default {
|
|
|
contractFile:[],
|
|
|
attachmentidsContract:[],
|
|
|
folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
|
|
|
- signatureLength:0
|
|
|
+ signatureLength:0,
|
|
|
+ selectTeam:[]
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
@@ -268,7 +281,13 @@ export default {
|
|
|
}
|
|
|
this.titems = this.detailInfo.titems
|
|
|
this.trainers = this.detailInfo.trainers
|
|
|
+ this.selectTeam = this.detailInfo.team
|
|
|
+ const index = this.detailInfo.team.findIndex(item => item.userid == this.userid);
|
|
|
+ if (index !== -1) {
|
|
|
+ this.detailInfo.team.splice(index, 1);
|
|
|
+ }
|
|
|
console.log(this.detailInfo,'detailInfo的数据输出')
|
|
|
+ console.log(this.detailInfo.team,'etailInfo.team输出333')
|
|
|
this.$nextTick(()=>{
|
|
|
if (this.detailInfo.workpresetjson.signature == 11 || this.detailInfo.workpresetjson.signature == 1){
|
|
|
this.$refs.signatureRef.getField()
|
|
|
@@ -332,7 +351,7 @@ export default {
|
|
|
itemid:item.itemid,
|
|
|
itemname:item.itemname,
|
|
|
model:item.model,
|
|
|
- qty:item.qty,
|
|
|
+ qty:item.qty?item.qty:1,
|
|
|
spec:item.spec
|
|
|
}
|
|
|
})
|
|
|
@@ -495,6 +514,30 @@ export default {
|
|
|
},
|
|
|
signatureData(val){
|
|
|
this.signatureLength = val
|
|
|
+ },
|
|
|
+ async tagClose(data){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: 20220930103803,
|
|
|
+ content: {
|
|
|
+ ownertable: 'sa_workorder_node',
|
|
|
+ ownerid: this.detailInfo.sa_workorder_nodeid,
|
|
|
+ userids: [data.userid]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (res.code == 0){
|
|
|
+ this.tool.showMessage(res,()=>{})
|
|
|
+ }else {
|
|
|
+ console.log(data,'tagData')
|
|
|
+ const index = this.detailInfo.team.findIndex(item => item.userid == data.userid);
|
|
|
+ if (index !== -1) {
|
|
|
+ this.detailInfo.team.splice(index, 1);
|
|
|
+ }
|
|
|
+ console.log(this.detailInfo.team)
|
|
|
+ const seletTeams = []
|
|
|
+ this.detailInfo.team.forEach((item,index) =>{
|
|
|
+ seletTeams[index] = item.userid
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|