Commit 5ef36e23 authored by 耿迪迪's avatar 耿迪迪

任务下发 gengdidi

parent d2426e87
......@@ -20,9 +20,10 @@
</el-form-item>
<el-form-item label="任务状态" prop="workStatus">
<el-select v-model="queryParams.workStatus" placeholder="请选择任务状态" clearable size="small">
<el-option label="派发中" value="1" />
<el-option label="反馈" value="2" />
<el-option label="归档" value="3" />
<el-option label="派发中" value="0" />
<el-option label="已接单" value="1" />
<el-option label="已反馈" value="2" />
<el-option label="已归档" value="3" />
</el-select>
</el-form-item>
<el-form-item>
......@@ -92,12 +93,13 @@
<!-- <el-table-column label="任务内容" align="center" prop="workContent" />-->
<el-table-column label="创建单位" align="center" prop="workCreateEnterpriseName" />
<el-table-column label="指派单位" align="center" prop="workAssignEnterproseName" />
<el-table-column label="指派人" align="center" prop="workAssignManId" />
<el-table-column label="指派人" align="center" prop="workAssignMan" />
<el-table-column label="任务状态" align="center" prop="workStatus">
<template slot-scope="scope">
<span v-if="scope.row.workStatus == 1">派发中</span>
<span v-if="scope.row.workStatus == 2">反馈</span>
<span v-if="scope.row.workStatus == 3">归档</span>
<span v-if="scope.row.workStatus == 0">派发中</span>
<span v-if="scope.row.workStatus == 1">已接单</span>
<span v-if="scope.row.workStatus == 2">已反馈</span>
<span v-if="scope.row.workStatus == 3">已归档</span>
</template>
</el-table-column>>
<!--<el-table-column label="巡检时间" align="center" prop="inspectionDate" width="180">
......@@ -145,25 +147,25 @@
@click="handleDelete(scope.row)"
v-hasPermi="['system:order:remove']"
>删除</el-button>
<el-button v-if="'inpector'!= roleType && (scope.row.workAssignManId == '' || scope.row.workAssignManId == null) && scope.row.workStatus == '1'"
<el-button v-if="'inpector'!= roleType && (scope.row.workAssignManId == '' || scope.row.workAssignManId == null) && scope.row.workStatus == '0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="workIssue(scope.row)"
>任务下发</el-button>
<el-button v-if=" 'inpector'== roleType && scope.row.workStatus == '1'"
<el-button v-if=" 'inpector'== roleType && scope.row.workStatus == '0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="takingOrder(scope.row)"
>接单</el-button>
<el-button v-if="'zhengfu'!= roleType && scope.row.workStatus == '2'"
<el-button v-if="'zhengfu'!= roleType && scope.row.workStatus == '1'"
size="mini"
type="text"
icon="el-icon-edit"
@click="feedbookWork(scope.row)"
>反馈</el-button>
<el-button v-if="'zhengfu'!= roleType && scope.row.workStatus == '3'"
<el-button v-if="'zhengfu'!= roleType && scope.row.workStatus == '2'"
size="mini"
type="text"
icon="el-icon-edit"
......@@ -182,7 +184,7 @@
/>
<!-- 添加或修改燃气任务对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="900px" @closed="dialogClose" @open="dialogOpen">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
......@@ -192,7 +194,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="任务类型" prop="workType">
<el-select v-model="form.workType" placeholder="请选择任务类型" style="width: 350px" @change="selectWorkType($event)" :disabled="isDetail">
<el-select v-model="form.workType" placeholder="请选择任务类型" style="width: 350px" :disabled="isDetail">
<el-option label="入户安检" value="1" />
<el-option label="巡检" value="2" />
<el-option label="报警巡查" value="3" />
......@@ -201,8 +203,10 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item label="任务内容">
<editor v-model="form.workContent" :min-height="192" :readOnly="isDetail"/>
<el-form-item label="任务内容" prop="workContent">
<!--<editor v-model="form.workContent" :min-height="192" :readOnly="!s"/>-->
<editor v-if="isOpen" v-model="form.workContent" :min-height="192" :readOnly="isDetail"/>
</el-form-item>
<el-row>
<el-col :span="12">
......@@ -219,9 +223,9 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="指派人" prop="workAssignManId">
<el-form-item label="指派人" prop="workAssignMan">
<!--<el-input v-model="form.workAssignManId" placeholder="请输入指派人" />-->
<el-select v-model="form.workAssignManId" placeholder="请输入指派人" style="width: 350px" @change="selectInspection($event)" :disabled="isDetail">
<el-select v-model="form.workAssignManId" placeholder="请输入指派人" style="width: 350px" @change="selectInspection($event,'edit')" :disabled="isDetail">
<el-option
v-for="item in inspectors"
:key="item.userId "
......@@ -239,7 +243,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="巡检时间" prop="inspectionDate" v-show=inspectorInfoIsShow>
<el-form-item label="巡检时间" prop="inspectionDate" v-show="form.workType=='2'">
<el-date-picker clearable size="small"
v-model="form.inspectionDate"
type="date"
......@@ -250,13 +254,16 @@
</el-col>
</el-row>
<el-form-item label="巡检路线" prop="inspectionRoute" v-show=inspectorInfoIsShow>
<el-form-item label="巡检路线" prop="inspectionRoute" v-show="form.workType=='2'">
<el-input v-model="form.inspectionRoute" type="textarea" placeholder="请输入巡检路线" :disabled="isDetail"/>
</el-form-item>
<el-form-item label="问题描述" prop="problemDescription">
<el-input v-model="form.problemDescription" type="textarea" placeholder="请输入问题描述" :disabled="isDetail"/>
</el-form-item>
<el-form-item label="问题图片" prop="iconUrl">
<el-form-item label="整改方案" prop="rectificationPlan" v-show="form.workType=='3' && isDetail && (form.workStatus =='2' || form.workStatus =='3')">
<el-input v-model="form.rectificationPlan" type="textarea" placeholder="请输入整改方案" :disabled="isDetail"/>
</el-form-item>
<el-form-item label="反馈图片" prop="iconUrl" v-show="isDetail && (form.workStatus =='2' || form.workStatus =='3')">
<MyFileUpload
listType="picture-card"
@resFun="getFileInfo"
......@@ -266,12 +273,9 @@
/>
<el-input v-show="false" disabled v-model="form.iconUrl"></el-input>
</el-form-item>
<!-- <el-form-item label="整改方案" prop="rectificationPlan">
<el-input v-model="form.rectificationPlan" type="textarea" placeholder="请输入整改方案" />
<el-form-item label="反馈信息" prop="rectificationResult" v-show="isDetail && (form.workStatus =='2' || form.workStatus =='3')">
<el-input v-model="form.rectificationResult" type="textarea" placeholder="请输入整改结果" :disabled="isDetail"/>
</el-form-item>
<el-form-item label="整改结果" prop="rectificationResult">
<el-input v-model="form.rectificationResult" type="textarea" placeholder="请输入整改结果" />
</el-form-item>-->
<el-row>
<el-col :span="12">
<el-form-item label="责任单位" prop="responsibleUnit">
......@@ -295,27 +299,26 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" @click="submitForm" v-show="!isDetail"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 任务下发 -->
<el-dialog :title="title" :visible.sync="workOpen" width="900px" append-to-body>
<el-form ref="workForm" :model="workForm" :rules="rules" label-width="80px">
<el-form ref="workForm" :model="workForm" :rules="workRules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="任务标题" prop="workTitle">
<el-input v-model="workForm.workTitle" placeholder="请输入任务标题"/>
<!-- <el-input v-model="workForm.workTitle" placeholder="请输入任务标题"/>-->
<span>{{ workForm.workTitle }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="任务类型" prop="workType">
<el-select v-model="workForm.workType" placeholder="请选择任务类型" style="width: 350px" @change="selectWorkType($event)">
<el-option label="入户安检" value="1" />
<el-option label="巡检" value="2" />
<el-option label="报警巡查" value="3" />
<el-option label="其他" value="4" />
</el-select>
<span v-if="workForm.workType == '1'">入户安检</span>
<span v-if="workForm.workType == '2'">巡检</span>
<span v-if="workForm.workType == '3'">报警巡查</span>
<span v-if="workForm.workType == '4'">其他</span>
</el-form-item>
</el-col>
</el-row>
......@@ -335,9 +338,9 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="指派人" prop="workAssignManId">
<el-form-item label="指派人" prop="workAssignMan">
<!--<el-input v-model="form.workAssignManId" placeholder="请输入指派人" />-->
<el-select v-model="workForm.workAssignManId" placeholder="请输入指派人" style="width: 350px" @change="selectInspection($event)">
<el-select v-model="workForm.workAssignManId" placeholder="请输入指派人" style="width: 350px" @change="selectInspection($event,'work')">
<el-option
v-for="item in inspectors"
:key="item.userId "
......@@ -350,31 +353,34 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submitWorkForm"> </el-button>
<el-button @click="cancelWorkForm"> </el-button>
</div>
</el-dialog>
<!-- 反馈 -->
<el-dialog :title="title" :visible.sync="feedBookOpen" width="900px" append-to-body>
<el-form ref="feedBookForm" :model="feedBookForm" :rules="rules" label-width="80px">
<el-form ref="feedBookForm" :model="feedBookForm" :rules="feedBookRules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="任务标题" prop="workTitle">
<el-input v-model="feedBookForm.workTitle" placeholder="请输入任务标题"/>
<!--<el-input v-model="feedBookForm.workTitle" placeholder="请输入任务标题"/>-->
<span>{{feedBookForm.workTitle}}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="任务类型" prop="workType">
<el-select v-model="feedBookForm.workType" placeholder="请选择任务类型" style="width: 350px" @change="selectWorkType($event)">
<el-option label="入户安检" value="1" />
<el-option label="巡检" value="2" />
<el-option label="报警巡查" value="3" />
<el-option label="其他" value="4" />
</el-select>
<span v-if="feedBookForm.workType == '1'">入户安检</span>
<span v-if="feedBookForm.workType == '2'">巡检</span>
<span v-if="feedBookForm.workType == '3'">报警巡查</span>
<span v-if="feedBookForm.workType == '4'">其他</span>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="整改方案" prop="rectificationPlan" v-show="feedBookForm.workType=='3'">
<el-input v-model="form.rectificationPlan" type="textarea" placeholder="请输入整改方案" />
</el-form-item>
<el-form-item label="反馈图片" prop="iconUrl">
<MyFileUpload
listType="picture-card"
......@@ -392,8 +398,8 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submitFeedBookForm"> </el-button>
<el-button @click="cancelFeedBook"> </el-button>
</div>
</el-dialog>
</div>
......@@ -405,14 +411,17 @@ import Editor from '@/components/Editor';
import MyFileUpload from '@/components/MyFileUpload';
import { enterpriseLists } from "@/api/regulation/info";
import { getInspectionUsers } from "@/api/system/user";
import ScrollPane from "../../../layout/components/TagsView/ScrollPane";
export default {
name: "Order",
components: {
ScrollPane,
Editor,
MyFileUpload
},
data() {
return {
isOpen:false,
// 遮罩层
loading: true,
// 导出遮罩层
......@@ -473,8 +482,40 @@ export default {
form: {},
// 表单校验
rules: {
workTitle: [
{ required: true, message: "任务标题", trigger: "blur" }
],
workType: [
{ required: true, message: "任务类型", trigger: "blur" }
],
workContent: [
{ required: true, message: "任务内容", trigger: "blur" }
],
workAssignEnterproseName: [
{ required: true, message: "指派单位", trigger: "blur" }
],
expiryDate: [
{ required: true, message: "截止时间", trigger: "blur" }
]
},
//任务下发表单校验
workRules: {
workAssignEnterproseName: [
{ required: true, message: "指派单位", trigger: "blur" }
],
workAssignMan: [
{ required: true, message: "指派人", trigger: "blur" }
]
},
//反馈校验
feedBookRules: {
iconUrl: [
{ required: true, message: "指派单位", trigger: "blur" }
],
rectificationResult: [
{ required: true, message: "指派人", trigger: "blur" }
]
},
inspectorInfoIsShow:false,
roleType: "zhengfu",
workForm:{},
workOpen: false,
......@@ -483,6 +524,9 @@ export default {
};
},
created() {
window.func=()=>{
this.isDetail =!this.isDetail;
}
this.getList();
let enterpriseId = this.$store.state.user.enterpriseId;
let post = this.$store.state.user.posts.find(item => item.postCode === "se");
......@@ -496,6 +540,13 @@ export default {
},
methods: {
dialogClose(){
this.isOpen=false;
},
dialogOpen(){
this.isOpen=true;
},
/** 查询燃气任务列表 */
getList() {
this.loading = true;
......@@ -562,6 +613,7 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.isDetail = false;
this.title = "添加燃气任务";
this.getEnterpriseLists();
},
......@@ -576,6 +628,7 @@ export default {
this.title = "修改燃气任务";
});
this.getEnterpriseLists();
this.getInspectionUserList(row.workAssignEnterproseId);
},
/** 提交按钮 */
submitForm() {
......@@ -657,32 +710,51 @@ export default {
this.form.workAssignEnterproseName = enterpriseName;
},
//获取指派人
selectInspection(userId){
selectInspection(userId,type){
let userName = this.inspectors.find(val=>val.userId == userId).userName;
if("edit" == type){
this.form.workAssignMan = userName;
}else{
this.workForm.workAssignMan = userName;
}
},
//选择任务类型
/*//选择任务类型
selectWorkType(workType){
if("2" == workType){
this.inspectorInfoIsShow = true;
}else{
this.inspectorInfoIsShow = false;
}
},
},*/
//详情
workDetail(row){
this.isDetail=true;
this.open = true;
this.title = "燃气任务详情";
this.isDetail=true;
this.form = row;
this.getEnterpriseLists();
},
//任务下发
workIssue(row){
this.title = "任务下发";
this.workForm = row;
this.workForm.workId = row.workId;
this.workForm.workTitle = row.workTitle;
this.workForm.workType = row.workType;
if(row.workAssignEnterproseId){
this.workForm.workAssignEnterproseId = row.workAssignEnterproseId;
this.workForm.workAssignEnterproseName = row.workAssignEnterproseName;
}
if(row.workAssignManId){
this.workForm.workAssignManId = row.workAssignManId;
this.workForm.workAssignMan = row.workAssignMan;
}
//this.workForm = row;
this.workForm.workStatus = '1';
this.workOpen = true;
this.getEnterpriseLists();
this.getInspectionUserList(row.workAssignEnterproseId);
},
//接单
takingOrder(row){
......@@ -691,18 +763,34 @@ export default {
cancelButtonText: "取消",
type: "warning"
}).then(() => {
/* this.exportLoading = true;
return exportOrder(queryParams);*/
this.workForm = {};
this.workForm.workId = row.workId;
this.workForm.workStatus = '1';
if (this.workForm.workId != null) {
updateOrder(this.workForm);
}
}).then(response => {
/* this.download(response.msg);
this.exportLoading = false;*/
this.getList();
this.msgSuccess("接单成功");
}).catch(() => {});
},
//反馈
feedbookWork(row){
this.title = "反馈信息";
this.feedBookOpen = true;
this.feedBookForm = row;
this.feedBookForm.workId = row.workId;
this.feedBookForm.workTitle = row.workTitle;
this.feedBookForm.workType = row.workType;
if(row.iconUrl){
this.feedBookForm.iconUrl = row.iconUrl;
}
if(row.rectificationPlan){
this.feedBookForm.rectificationPlan = row.rectificationPlan;
}
if(row.rectificationResult){
this.feedBookForm.rectificationResult = row.rectificationResult;
}
//this.feedBookForm = row;
this.getEnterpriseLists();
},
//归档
......@@ -712,13 +800,56 @@ export default {
cancelButtonText: "取消",
type: "warning"
}).then(() => {
/* this.exportLoading = true;
return exportOrder(queryParams);*/
this.workForm = {};
this.workForm.workId = row.workId;
this.workForm.workStatus = '3';
if (this.workForm.workId != null) {
updateOrder(this.workForm);
}
}).then(response => {
/* this.download(response.msg);
this.exportLoading = false;*/
this.getList();
this.msgSuccess("归档成功");
}).catch(() => {});
},
//任务下发提交
submitWorkForm() {
this.$refs["workForm"].validate(valid => {
if (valid) {
if (this.workForm.workId != null) {
updateOrder(this.workForm).then(response => {
this.msgSuccess("任务下发成功");
this.workOpen = false;
this.getList();
});
}
}
});
},
//任务下发取消
cancelWorkForm(){
this.workOpen = false;
this.workForm = {};
},
//反馈提交
submitFeedBookForm(){
this.$refs["feedBookForm"].validate(valid => {
if (valid) {
if (this.feedBookForm.workId != null) {
this.feedBookForm.workStatus = '2';
updateOrder(this.feedBookForm).then(response => {
this.msgSuccess("反馈成功");
this.feedBookOpen = false;
this.getList();
});
}
}
});
},
//反馈取消
cancelFeedBook(){
this.feedBookOpen = false;
this.feedBookForm = {};
},
}
};
</script>
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