Compare commits
No commits in common. "47866bb68f2f15222d22ad6e9470be1556f9edd9" and "8672012b06a764cabdd2dae35abb771e8840d06e" have entirely different histories.
47866bb68f
...
8672012b06
@ -288,6 +288,7 @@ export default {
|
|||||||
remark: item.remark
|
remark: item.remark
|
||||||
}
|
}
|
||||||
})]
|
})]
|
||||||
|
console.log(this.formData)
|
||||||
await auditTicketWares(this.formData)
|
await auditTicketWares(this.formData)
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.$modal.msgSuccess("审核成功")
|
this.$modal.msgSuccess("审核成功")
|
||||||
|
@ -1,30 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-dialog title="流程记录" :visible.sync="dialogVisible" width="60%" v-dialogDrag append-to-body>
|
<el-dialog title="流程记录" :visible.sync="dialogVisible" width="60%" v-dialogDrag append-to-body>
|
||||||
<el-row :gutter="1">
|
<el-form :model="formData" ref="formRef" :rules="formRules" :loading="formLoading" :inline="true" label-width="15rem">
|
||||||
<el-col :span="24">
|
|
||||||
<span class="notice">{{
|
|
||||||
projectList.length === 0
|
|
||||||
? (this.formData.recordType === 'kssg'
|
|
||||||
? "没有项目可以施工"
|
|
||||||
: (this.formData.recordType === 'sgz')
|
|
||||||
? "没有项目在施工中"
|
|
||||||
: (this.formData.recordType === 'sgwczj'
|
|
||||||
? "没有项目可以完成"
|
|
||||||
: ''
|
|
||||||
)
|
|
||||||
)
|
|
||||||
: ''
|
|
||||||
}}</span>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-form :model="formData" ref="formRef" :rules="formRules" :loading="formLoading" :inline="true"
|
|
||||||
label-width="15rem">
|
|
||||||
<el-row :gutter="1">
|
<el-row :gutter="1">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item v-if="formData.recordType !== 'zj'" label="维修项目" prop="item.id">
|
<el-form-item v-if="formData.recordType !== 'zj'" label="维修项目" prop="item.id">
|
||||||
<el-select style="width: 20rem" v-model="formData.item.id">
|
<el-select style="width: 20rem" v-model="formData.item.id" >
|
||||||
<el-option v-for="item in projectList" :key="item.id" :label="item.itemName" :value="item.id"/>
|
<el-option v-for="item in projectList" :key="item.id" :label="item.itemName" :value="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -32,41 +14,30 @@
|
|||||||
<el-row :gutter="1">
|
<el-row :gutter="1">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="描述" prop="remark">
|
<el-form-item label="描述" prop="remark">
|
||||||
<el-input style="width: 30rem" type="textarea" v-model="formData.remark"
|
<el-input style="width: 30rem" type="textarea" v-model="formData.remark" :autosize="{ minRows: 4, maxRows: 8}"/>
|
||||||
:autosize="{ minRows: 4, maxRows: 8}"/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="1">
|
<el-row :gutter="1">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="附件" prop="image">
|
<el-form-item label="附件" prop="image">
|
||||||
<!-- <FileUpload v-model="formData.image" />-->
|
<!-- <FileUpload v-model="formData.image" />-->
|
||||||
<ImageUpload v-model="formData.image"/>
|
<ImageUpload v-model="formData.image" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button v-if="formData.recordType !== 'sgwczj' && projectList.length > 0" type="primary" @click="doUpdate(null)">确
|
<el-button v-if="formData.recordType !== 'sgwczj'" type="primary" @click="doUpdate">确 定</el-button>
|
||||||
定
|
<el-button v-if="formData.recordType === 'sgwczj'" type="primary" @click="doUpdate">部分完成</el-button>
|
||||||
|
<el-button v-if="formData.recordType === 'sgwczj'" type="success" @click="doFinish">
|
||||||
|
{{isNext ? "整体完成并指派下一项目" : (isEndCheck ? "整体完成并移交总检" : "整体完成")}}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="formData.recordType === 'sgwczj' && projectList.length !== 0" type="primary" @click="doUpdate(null)">
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
部分完成
|
|
||||||
</el-button>
|
|
||||||
<el-button v-if="formData.recordType === 'sgwczj' && projectList.length !== 0" type="primary" @click="doFinish">
|
|
||||||
完成并移交下一班组
|
|
||||||
</el-button>
|
|
||||||
<el-button v-if="formData.recordType === 'sgwczj' && !isNext && projectList.length !== 0" type="primary"
|
|
||||||
@click="doFinish">
|
|
||||||
{{ isEndCheck ? "完成并移交总检" : "完成工单" }}
|
|
||||||
</el-button>
|
|
||||||
<!-- <el-button v-if="formData.recordType === 'sgwczj'" type="success" @click="doFinish">-->
|
|
||||||
<!-- {{isNext ? "整体完成并指派下一项目" : (isEndCheck ? "整体完成并移交总检" : "整体完成")}}-->
|
|
||||||
<!-- </el-button>-->
|
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<UpdateRepair ref="updateRepair" @success="doUpdate"/>
|
<UpdateRepair ref="updateRepair" @success="doUpdate" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -78,16 +49,16 @@ import UpdateRepair from "@/views/repair/tickets/form/UpdateRepair.vue";
|
|||||||
export default {
|
export default {
|
||||||
name: "UpdateRecord",
|
name: "UpdateRecord",
|
||||||
components: {UpdateRepair},
|
components: {UpdateRepair},
|
||||||
data() {
|
data(){
|
||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
formData: {
|
formData:{
|
||||||
// 主表信息
|
// 主表信息
|
||||||
id: null,
|
id: null,
|
||||||
ticketsWorkStatus: null,
|
ticketsWorkStatus: null,
|
||||||
remark: null,
|
remark: null,
|
||||||
// 子表信息
|
// 子表信息
|
||||||
item: {
|
item:{
|
||||||
id: null,
|
id: null,
|
||||||
itemStatus: null,
|
itemStatus: null,
|
||||||
},
|
},
|
||||||
@ -95,8 +66,8 @@ export default {
|
|||||||
image: null,
|
image: null,
|
||||||
recordType: null,
|
recordType: null,
|
||||||
},
|
},
|
||||||
formRules: {
|
formRules:{
|
||||||
'item.id': [{required: true, message: "维修项目不能为空", trigger: 'blur'}]
|
'item.id':[{required: true, message: "维修项目不能为空", trigger: 'blur'}]
|
||||||
},
|
},
|
||||||
formLoading: false,
|
formLoading: false,
|
||||||
projectList: [],
|
projectList: [],
|
||||||
@ -107,127 +78,104 @@ export default {
|
|||||||
clickRow: null
|
clickRow: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods:{
|
||||||
init() {
|
init(){
|
||||||
this.formData = {
|
this.formData = {
|
||||||
// 主表信息
|
// 主表信息
|
||||||
id: null,
|
id: null,
|
||||||
ticketsWorkStatus: null,
|
ticketsWorkStatus: null,
|
||||||
remark: null,
|
remark: null,
|
||||||
// 子表信息
|
// 子表信息
|
||||||
item: {
|
item:{
|
||||||
id: null,
|
id: null,
|
||||||
itemStatus: null,
|
itemStatus: null,
|
||||||
},
|
},
|
||||||
// 记录信息
|
// 记录信息
|
||||||
image: null,
|
image: null,
|
||||||
recordType: null,
|
recordType: null,
|
||||||
}
|
}
|
||||||
this.projectList = []
|
this.projectList = []
|
||||||
this.clickRow = null
|
this.clickRow = null
|
||||||
},
|
},
|
||||||
async open(row) {
|
async open(row){
|
||||||
this.init()
|
this.init()
|
||||||
this.clickRow = row
|
this.clickRow = row
|
||||||
// 是否需要总检
|
|
||||||
this.isEndCheck = row.endCheck === '1'
|
this.isEndCheck = row.endCheck === '1'
|
||||||
this.formData.id = row.id
|
this.formData.id = row.id
|
||||||
this.formData.recordType = row.clickType
|
this.formData.recordType = row.clickType
|
||||||
await this.listProject(row.id)
|
await this.listProject(row.id)
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
async listProject(ticketId) {
|
async listProject(ticketId){
|
||||||
try {
|
try {
|
||||||
this.formLoading = true
|
this.formLoading = true
|
||||||
const res = await getProjectList(ticketId)
|
const res = await getProjectList(ticketId)
|
||||||
this.projectList = res.data
|
this.projectList = res.data
|
||||||
this.formData.ticketsWorkStatus = "02"
|
this.formData.ticketsWorkStatus = "02"
|
||||||
this.formData.item.itemStatus = "02"
|
this.formData.item.itemStatus = "02"
|
||||||
// 下面 01:未派工、02:施工中、03:已完成
|
if (this.formData.recordType === 'kssg') {
|
||||||
// 开始施工展示所有的项目,方便返工
|
this.projectList = this.projectList.filter(item => item.itemStatus === '01')
|
||||||
// 施工中的项目只展示施工中的项目,一是没施工就有施工记录不合理,二是防止项目太多员工选错,三已完成的项目需要重新就重新开始施工
|
}else if (this.formData.recordType === 'sgz'){
|
||||||
// 施工完成同施工中
|
this.projectList = this.projectList.filter(item => item.itemStatus === '02')
|
||||||
if (this.formData.recordType !== 'kssg') {
|
}else {
|
||||||
|
// 因为自己手里有一个项目,所以是>1
|
||||||
|
this.isNext = this.projectList.filter(item => item.itemStatus !== '03').length > 1
|
||||||
this.projectList = this.projectList.filter(item => item.itemStatus === '02')
|
this.projectList = this.projectList.filter(item => item.itemStatus === '02')
|
||||||
// 施工完成需要特殊计算一些东西
|
|
||||||
// 项目全完成需要总检、项目全完成不需要总检、项目没有全完成
|
|
||||||
if (this.formData.recordType !== 'sgz') {
|
|
||||||
// 因为自己手里有一个项目,所以是>1
|
|
||||||
this.isNext = this.projectList.filter(item => item.itemStatus !== '03').length > 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} finally {
|
}finally {
|
||||||
this.formLoading = false
|
this.formLoading = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async doUpdate(nextName = null) {
|
async doUpdate(){
|
||||||
try {
|
try {
|
||||||
if (nextName){
|
if (this.formData.recordType === 'zj'){
|
||||||
this.formData['nextName'] = nextName
|
|
||||||
}
|
|
||||||
if (this.formData.recordType === 'zj') {
|
|
||||||
this.formData.ticketsWorkStatus = '03'
|
this.formData.ticketsWorkStatus = '03'
|
||||||
this.formData['isFinish'] = '1'
|
this.formData['isFinish'] = '1'
|
||||||
}
|
}
|
||||||
if (this.formData.recordType !== 'zj') {
|
if (this.formData.recordType !== 'zj'){
|
||||||
await this.$refs.formRef.validate()
|
await this.$refs.formRef.validate()
|
||||||
this.formLoading = true
|
this.formLoading = true
|
||||||
await updateStatus(this.formData)
|
await updateStatus(this.formData)
|
||||||
if (!nextName) {
|
this.$modal.msgSuccess("操作成功")
|
||||||
this.$modal.msgSuccess("操作成功")
|
|
||||||
}
|
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.$emit("success")
|
this.$emit("success")
|
||||||
} else {
|
}else {
|
||||||
this.formLoading = true
|
this.formLoading = true
|
||||||
await updateStatus(this.formData)
|
await updateStatus(this.formData)
|
||||||
if (nextName) {
|
this.$modal.msgSuccess("操作成功")
|
||||||
this.$modal.msgSuccess("操作成功")
|
|
||||||
}
|
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.$emit("success")
|
this.$emit("success")
|
||||||
}
|
}
|
||||||
} catch {
|
}catch {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async doFinish() {
|
async doFinish(){
|
||||||
try {
|
try{
|
||||||
await this.$refs.formRef.validate()
|
await this.$refs.formRef.validate()
|
||||||
this.formLoading = true
|
this.formLoading = true
|
||||||
// 不论是什么按钮,这个工单子项是完了的
|
// 不论是什么按钮,这个工单子项是完了的
|
||||||
this.formData.item.itemStatus = "03"
|
this.formData.item.itemStatus = "03"
|
||||||
// 整体完成并指派下一个人
|
// 整体完成并指派下一个人
|
||||||
if (this.isNext) {
|
if (this.isNext){
|
||||||
this.formData['finishType'] = "01"
|
|
||||||
await this.$refs.updateRepair.open(this.clickRow)
|
await this.$refs.updateRepair.open(this.clickRow)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 整体完成并移交总检
|
// 整体完成并移交总检
|
||||||
if (this.isEndCheck) {
|
if (this.isEndCheck){
|
||||||
this.formData['finishType'] = "02"
|
|
||||||
this.formData.ticketsWorkStatus = "05"
|
this.formData.ticketsWorkStatus = "05"
|
||||||
await this.doUpdate();
|
await this.doUpdate();
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 整体完成,只有没有项目,不需要总检,这个工单才是完了
|
// 整体完成,只有没有项目,不需要总检,这个工单才是完了
|
||||||
this.formData.ticketsWorkStatus = "03"
|
this.formData.ticketsWorkStatus = "03"
|
||||||
this.formData['finishType'] = "03"
|
|
||||||
this.formData['isFinish'] = '1'
|
this.formData['isFinish'] = '1'
|
||||||
await this.doUpdate()
|
await this.doUpdate()
|
||||||
} catch {
|
}catch{}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.notice {
|
|
||||||
display: inline-block;
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
margin: 1rem 0;
|
|
||||||
font-size: 18px;
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -208,7 +208,7 @@ export default {
|
|||||||
await updateRepair(this.formData)
|
await updateRepair(this.formData)
|
||||||
this.$modal.msgSuccess("指派成功")
|
this.$modal.msgSuccess("指派成功")
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.$emit("success", this.formData.nowRepairName)
|
this.$emit("success")
|
||||||
} catch {
|
} catch {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user