接单上传图片
This commit is contained in:
parent
b1e6a559b9
commit
8cc46e3a28
@ -82,9 +82,9 @@ export function getUserRole(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 接单
|
// 接单
|
||||||
export function updateTake(id){
|
export function updateTake(id, image){
|
||||||
return request({
|
return request({
|
||||||
url: preUrl + "/take?id=" + id,
|
url: preUrl + "/take?id=" + id + "&image=" + image,
|
||||||
method: "get",
|
method: "get",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -44,16 +44,20 @@
|
|||||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
|
||||||
>查看
|
>查看
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-hasPermi="['repair:tkm:edit']" size="mini" type="text" icon="el-icon-setting" @click="handleEditTicket(scope.row)">
|
<el-button v-hasPermi="['repair:tkm:edit']" size="mini" type="text" icon="el-icon-setting"
|
||||||
|
@click="handleEditTicket(scope.row)">
|
||||||
编辑工单
|
编辑工单
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-hasPermi="['repair:tkm:remove']" size="mini" type="text" icon="el-icon-remove" @click="handleRemove(scope.row)">
|
<el-button v-hasPermi="['repair:tkm:remove']" size="mini" type="text" icon="el-icon-remove"
|
||||||
|
@click="handleRemove(scope.row)">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-hasPermi="['repair:tkm:void']" size="mini" type="text" icon="el-icon-delete" @click="handleVoid(scope.row)">
|
<el-button v-hasPermi="['repair:tkm:void']" size="mini" type="text" icon="el-icon-delete"
|
||||||
|
@click="handleVoid(scope.row)">
|
||||||
作废
|
作废
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="userRole === 'service_advisor' && isFinish" size="mini" type="text" icon="el-icon-refresh" @click="handleEditRecord(scope.row)">
|
<el-button v-if="userRole === 'service_advisor' && isFinish" size="mini" type="text" icon="el-icon-refresh"
|
||||||
|
@click="handleEditRecord(scope.row)">
|
||||||
维修记录设置
|
维修记录设置
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
@ -61,7 +65,8 @@
|
|||||||
size="mini" type="text" icon="el-icon-check" @click="handleTake(scope.row)">
|
size="mini" type="text" icon="el-icon-check" @click="handleTake(scope.row)">
|
||||||
接单
|
接单
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="userRole === 'service_advisor' && scope.row.ticketsWorkStatus === '01'" size="mini" type="text" icon="el-icon-check" @click="handleNotify(scope.row)">
|
<el-button v-if="userRole === 'service_advisor' && scope.row.ticketsWorkStatus === '01'" size="mini"
|
||||||
|
type="text" icon="el-icon-check" @click="handleNotify(scope.row)">
|
||||||
通知施工
|
通知施工
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="mini"
|
<el-button size="mini"
|
||||||
@ -86,7 +91,9 @@
|
|||||||
v-if="(userRole === 'repair_staff' ? (leader ? !isFinish : false) : false) && !(scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff' && !isFinish)">
|
v-if="(userRole === 'repair_staff' ? (leader ? !isFinish : false) : false) && !(scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff' && !isFinish)">
|
||||||
重新指派
|
重新指派
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="userRole === 'repair_staff' && !isFinish && scope.row.ticketsWorkStatus === '01' && !(nowUser.id === scope.row.nowRepairId)" @click="handleGet(scope.row)" size="mini" type="text" icon="el-icon-document-add">
|
<el-button
|
||||||
|
v-if="userRole === 'repair_staff' && !isFinish && scope.row.ticketsWorkStatus === '01' && !(nowUser.id === scope.row.nowRepairId)"
|
||||||
|
@click="handleGet(scope.row)" size="mini" type="text" icon="el-icon-document-add">
|
||||||
申请配件
|
申请配件
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-dropdown
|
<el-dropdown
|
||||||
@ -94,7 +101,8 @@
|
|||||||
@command="(command) => handleCommand(command, scope.$index, scope.row)">
|
@command="(command) => handleCommand(command, scope.$index, scope.row)">
|
||||||
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item v-if="!isFinish && scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff'" command="handleGet" size="mini" type="text" icon="el-icon-document-add"
|
<el-dropdown-item v-if="!isFinish && scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff'"
|
||||||
|
command="handleGet" size="mini" type="text" icon="el-icon-document-add"
|
||||||
>申请配件
|
>申请配件
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<!-- <el-dropdown-item v-if="scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff'" command="handleBack" size="mini" type="text" icon="el-icon-document-delete"-->
|
<!-- <el-dropdown-item v-if="scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff'" command="handleBack" size="mini" type="text" icon="el-icon-document-delete"-->
|
||||||
@ -161,6 +169,26 @@
|
|||||||
|
|
||||||
<RecordSetting ref="recordSet"/>
|
<RecordSetting ref="recordSet"/>
|
||||||
<EditTickets ref="editTickets" @success="listTickets"/>
|
<EditTickets ref="editTickets" @success="listTickets"/>
|
||||||
|
|
||||||
|
<el-dialog title="诊断维修单和车辆维修前照片" :visible.sync="beginDialog" width="60%" v-dialogDrag append-to-body>
|
||||||
|
<el-form v-model="beginData" :inline="true" label-width="15rem">
|
||||||
|
<el-row :gutter="1">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="附件" prop="image">
|
||||||
|
<ImageUpload v-model="beginData.image"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="doTake">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="beginDialog = false">
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -218,6 +246,11 @@ export default {
|
|||||||
remark: null,
|
remark: null,
|
||||||
leader: false,
|
leader: false,
|
||||||
nowUser: null,
|
nowUser: null,
|
||||||
|
beginDialog: false,
|
||||||
|
beginData: {
|
||||||
|
id: null,
|
||||||
|
image: null,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -270,11 +303,29 @@ export default {
|
|||||||
},
|
},
|
||||||
// 接单
|
// 接单
|
||||||
async handleTake(row) {
|
async handleTake(row) {
|
||||||
|
this.beginData.id = row.id
|
||||||
|
this.beginDialog = true
|
||||||
|
},
|
||||||
|
async doTake(){
|
||||||
try {
|
try {
|
||||||
|
if (!this.beginData.image){
|
||||||
|
this.$modal.msgError("附件不能为空")
|
||||||
|
return
|
||||||
|
}
|
||||||
this.loading = true
|
this.loading = true
|
||||||
await this.$modal.confirm("确认接单吗?")
|
if (this.beginData.image){
|
||||||
await updateTake(row.id)
|
const data = this.beginData.image.split(",")
|
||||||
|
this.beginData.image = data.map(item => {
|
||||||
|
return item.replace(process.env.VUE_APP_FILE_API, "")
|
||||||
|
}).join(",")
|
||||||
|
}
|
||||||
|
await updateTake(this.beginData.id, this.beginData.image)
|
||||||
|
this.beginDialog = false
|
||||||
this.$modal.msgSuccess("接单成功")
|
this.$modal.msgSuccess("接单成功")
|
||||||
|
this.beginData = {
|
||||||
|
id: null,
|
||||||
|
image: null
|
||||||
|
}
|
||||||
await this.listTickets()
|
await this.listTickets()
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
@ -424,7 +475,8 @@ export default {
|
|||||||
await this.listTickets()
|
await this.listTickets()
|
||||||
this.$modal.msgSuccess("删除成功")
|
this.$modal.msgSuccess("删除成功")
|
||||||
}
|
}
|
||||||
}catch{}
|
} catch {
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async handleVoid(row) {
|
async handleVoid(row) {
|
||||||
this.$prompt('作废备注', '提示', {
|
this.$prompt('作废备注', '提示', {
|
||||||
|
Loading…
Reference in New Issue
Block a user