|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<el-dialog v-loading.fullscreen.lock="fullscreenLoading" :close-on-click-modal = "false"
|
|
|
- v-model="outerVisible" title="任务进度" width="700" height="800">
|
|
|
+ v-model="outerVisible" title="任务进度" width="765" height="800">
|
|
|
<el-form v-if="recordStatu === 1 &&handlerId === useUserStore().user.userId" :model="sumbitForm" label-width="auto" ref="workDetailForm" style="max-width: 700px;">
|
|
|
<el-form-item label="记录日期">
|
|
|
<el-date-picker v-model="sumbitForm.recordDate" type="date" clearable
|
|
@@ -30,7 +30,7 @@
|
|
|
<el-table-column type="index" label="序号" width="50" />
|
|
|
<el-table-column property="recordDate" label="记录日期" width="120" >
|
|
|
<template #default="scope">
|
|
|
- <el-date-picker v-if="recordStatu === 1 &&handlerId === useUserStore().user.userId" v-model="scope.row.recordDate" type="date" clearable size="small"
|
|
|
+ <el-date-picker v-if="(recordStatu === 1 &&handlerId === useUserStore().user.userId)&& scope.row.inputHidden === 1" v-model="scope.row.recordDate" type="date" clearable size="small"
|
|
|
format="YYYY-MM-DD " value-format="YYYY-MM-DD"
|
|
|
:disabled="scope.row.inputdisabled"
|
|
|
style="width: 100%;">
|
|
@@ -41,24 +41,23 @@
|
|
|
<el-table-column property="recordDetail" label="进度描述" width="300" >
|
|
|
<template #default="scope">
|
|
|
|
|
|
- <el-input type="textarea" v-if="recordStatu === 1 &&handlerId === useUserStore().user.userId" class="no-scrollbar" v-model="scope.row.recordDetail" :disabled="scope.row.inputdisabled"/>
|
|
|
+ <el-input type="textarea" v-if="(recordStatu === 1 &&handlerId === useUserStore().user.userId)&& scope.row.inputHidden === 1" class="no-scrollbar" v-model="scope.row.recordDetail" :disabled="scope.row.inputdisabled"/>
|
|
|
<div v-else>{{scope.row.recordDetail}}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column property="userName" label="操作人" width="120" >
|
|
|
<template #default="scope">
|
|
|
-
|
|
|
- <el-input v-if="recordStatu === 1 &&handlerId === useUserStore().user.userId" v-model="scope.row.userName" disabled />
|
|
|
- <div v-else>
|
|
|
- {{scope.row.userName}}
|
|
|
- </div>
|
|
|
+ {{scope.row.userName}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" min-width="120" >
|
|
|
+ <el-table-column label="操作" align="center" min-width="150" >
|
|
|
<template #default="scope">
|
|
|
<el-button v-if="recordStatu === 1 && handlerId === useUserStore().user.userId" :disabled="scope.row.disabled" size="small" type="primary" @click="handleClick(scope.$index, scope.row,this)">
|
|
|
{{scope.row.buttonName}}
|
|
|
</el-button>
|
|
|
+ <el-button v-if="recordStatu === 1 && handlerId === useUserStore().user.userId" :disabled="scope.row.disabled" size="small" type="danger" @click="handleClickDel(scope.$index, scope.row,this)">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -77,7 +76,8 @@ import {defineProps, getCurrentInstance, reactive, toRefs} from "vue";
|
|
|
import {
|
|
|
getDetail,
|
|
|
updateDetail,
|
|
|
- addDetail
|
|
|
+ addDetail,
|
|
|
+ delDetail
|
|
|
} from "@/api/business/onWorkDetail";
|
|
|
import moment from 'moment'
|
|
|
const outerVisible = ref(false);
|
|
@@ -85,6 +85,7 @@ const onworkDetailData = ref<TFrom[]>([]);
|
|
|
const currentRow = ref();
|
|
|
const fullscreenLoading = ref<boolean>(false);
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
+const inputHidden = ref(0);
|
|
|
const props = defineProps({
|
|
|
getList: {
|
|
|
type: Function,
|
|
@@ -101,6 +102,7 @@ const form = reactive({
|
|
|
recordDetail: '',
|
|
|
userName: '',
|
|
|
workOrderId: null,
|
|
|
+ inputHidden:0,
|
|
|
});
|
|
|
type TFrom = typeof form;
|
|
|
const sumbitForm = reactive<TFrom>(form);
|
|
@@ -117,7 +119,7 @@ const handleCurrentChange = (val: any | undefined) => {
|
|
|
}
|
|
|
//点击处理,每次点击都要改变状态默认状态时修改
|
|
|
const handleClick = (index: number, row: TFrom, ele: ElButton) => {
|
|
|
- console.log(row)
|
|
|
+ row.inputHidden = 1;
|
|
|
if(!row.inputdisabled){
|
|
|
fullscreenLoading.value = true;
|
|
|
updateDetail(row).then(res => {
|
|
@@ -132,6 +134,7 @@ const handleClick = (index: number, row: TFrom, ele: ElButton) => {
|
|
|
,
|
|
|
{ dangerouslyUseHTMLString: true }
|
|
|
);
|
|
|
+ row.inputHidden = 0;
|
|
|
getList.value();
|
|
|
}).catch((error)=>{
|
|
|
fullscreenLoading.value = false;
|
|
@@ -140,7 +143,19 @@ const handleClick = (index: number, row: TFrom, ele: ElButton) => {
|
|
|
row.inputdisabled = false;
|
|
|
row.buttonName = '确认';
|
|
|
}
|
|
|
-
|
|
|
+}
|
|
|
+const handleClickDel = (index: number, row: TFrom, ele: ElButton) =>{
|
|
|
+ delDetail(row.id).then(res => {
|
|
|
+ proxy.$alert(
|
|
|
+ "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
|
|
+ "删除成功" +
|
|
|
+ "</div>"
|
|
|
+ ,
|
|
|
+ { dangerouslyUseHTMLString: true }
|
|
|
+ );
|
|
|
+ restDetail();
|
|
|
+ getList.value();
|
|
|
+ })
|
|
|
}
|
|
|
//重新获取数据
|
|
|
const restDetail = () =>{
|