|
@@ -0,0 +1,183 @@
|
|
|
+<template>
|
|
|
+ <div class="hui-flex hui-content">
|
|
|
+ <div class="hui-flex">
|
|
|
+ <div class="hui-content-title">
|
|
|
+ <div class="hui-title-item active">巡查工单</div>
|
|
|
+ </div>
|
|
|
+ <div class="hui-flex-box hui-flex hui-table">
|
|
|
+ <list-filter type="order" @filter="filterInit"></list-filter>
|
|
|
+ <div class="hui-content-insert">
|
|
|
+ <el-button type="primary" size="medium" @click="insert">新增工单</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="hui-flex-box">
|
|
|
+ <el-table :data="tableData" row-key="id" border height="100%">
|
|
|
+ <el-table-column label="序号" width="50">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div style="text-align: center;">{{scope.$index + 1}}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="工单名称" prop="name"></el-table-column>
|
|
|
+ <el-table-column label="楼宇房号" prop="projectItemTargetRoomIds">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="hui-ellipsis">
|
|
|
+ <span v-for="(item,index) in scope.row.roomMap">
|
|
|
+ <span>{{item}}</span><span v-if="index<scope.row.roomMap.length-1">、</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="关联租客" prop="name">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.tenantType === 1 ? scope.row.merchantName: scope.row.clientName}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="跟进人" prop="followUpPersonName"></el-table-column>
|
|
|
+ <el-table-column label="服务方式">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{$field.findTypeName('patrolWorkWay',scope.row.workWay)}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="状态">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="hui-table-tag">
|
|
|
+ <div class="hui-tag hui-tag-info" v-if="!scope.row.status">待提交</div>
|
|
|
+ <div class="hui-tag" v-else-if="scope.row.status === 1">待处理</div>
|
|
|
+ <div class="hui-tag hui-tag-warning" v-else-if="scope.row.status === 2">处理中</div>
|
|
|
+ <div class="hui-tag hui-tag-success" v-else>已处理</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="hui-table-operation">
|
|
|
+ <span class="table-operation" @click="detailItem(scope.row)">
|
|
|
+ 详情
|
|
|
+ </span>
|
|
|
+ <span class="table-operation" v-if="!scope.row.status"
|
|
|
+ @click="updateItem(scope.row)">
|
|
|
+ 编辑
|
|
|
+ </span>
|
|
|
+ <span class="table-operation" v-if="!scope.row.status"
|
|
|
+ @click="deleteItem(scope.row)">
|
|
|
+ 删除
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <template slot="empty">
|
|
|
+ <empty description="暂无数据"></empty>
|
|
|
+ </template>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="hui-content-pagination">
|
|
|
+ <el-pagination :page-size="pageSize" :pager-count="9" layout="prev, pager, next" :total="totalCount"
|
|
|
+ @current-change="currentChange">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-dialog :close-on-click-modal="false" :title="isUpdate?'编辑':'新增'" :visible.sync="visible" width="900px"
|
|
|
+ :append-to-body="true">
|
|
|
+ <edit v-if="visible" @callback="callback" :isUpdate="isUpdate" :detailId="detailId" :type="type"></edit>
|
|
|
+ </el-dialog>
|
|
|
+ <el-drawer title="工单详情" :visible.sync="drawer" :size="400" :append-to-body="true">
|
|
|
+ <detail v-if="drawer" :detailId="detailId" @callback="callback"></detail>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import edit from '@/components/work/order/edit'
|
|
|
+ import detail from '@/components/work/order/detail'
|
|
|
+ import listFilter from '@/components/common/listFilter'
|
|
|
+
|
|
|
+ import {
|
|
|
+ getOrderPageListByQuery,
|
|
|
+ deleteOrder
|
|
|
+ } from '@/httpApi/order'
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableData: [],
|
|
|
+ currPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ totalCount: 0,
|
|
|
+ detailId: '',
|
|
|
+ filterOption: {},
|
|
|
+ isUpdate: false,
|
|
|
+ visible: false,
|
|
|
+ type: 4,
|
|
|
+ drawer: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ let postData = {
|
|
|
+ currPage: this.currPage,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ organizationId: this.$store.getters.organization.id,
|
|
|
+ projectId: this.$store.getters.project.id,
|
|
|
+ type: this.type
|
|
|
+ }
|
|
|
+ postData = Object.assign(postData, this.filterOption);
|
|
|
+ getOrderPageListByQuery(postData).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ this.tableData = res.data.dataList;
|
|
|
+ this.totalCount = res.data.totalCount;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ filterInit(option) {
|
|
|
+ this.filterOption = option;
|
|
|
+ this.currPage = 1;
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ insert() {
|
|
|
+ this.detailId = '';
|
|
|
+ this.isUpdate = false;
|
|
|
+ this.visible = true;
|
|
|
+ },
|
|
|
+ currentChange(currPage) {
|
|
|
+ this.currPage = currPage;
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ detailItem(item) {
|
|
|
+ this.detailId = item.id;
|
|
|
+ this.drawer = true;
|
|
|
+ },
|
|
|
+ updateItem(item) {
|
|
|
+ this.detailId = item.id;
|
|
|
+ this.isUpdate = true;
|
|
|
+ this.visible = true;
|
|
|
+ },
|
|
|
+ deleteItem(item) {
|
|
|
+ this.$confirm('确定要删除该工单?', () => {
|
|
|
+ deleteOrder(item.id).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '操作成功'
|
|
|
+ })
|
|
|
+ this.init();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ callback(type) {
|
|
|
+ if (type === 'init') this.init();
|
|
|
+ this.visible = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ edit,
|
|
|
+ detail,
|
|
|
+ listFilter
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+</style>
|