|
@@ -1,38 +1,38 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="list-container">
|
|
<div class="list-container">
|
|
|
- <el-row :gutter="10" style="margin-bottom: 10px">
|
|
|
|
|
- <el-col :span="4">
|
|
|
|
|
- <el-input v-model="queryForm.orderTypeDesc" placeholder="工单类型" />
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="4">
|
|
|
|
|
- <el-input v-model="queryForm.orderStatus" placeholder="工单状态" />
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="4">
|
|
|
|
|
- <el-input v-model="queryForm.assignUserName" placeholder="分派人员姓名" />
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-button icon="el-icon-plus" type="primary" @click="fetchData">查询</el-button>
|
|
|
|
|
- <el-button icon="el-icon-refresh-right" @click="reset">重置</el-button>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
<vab-query-form>
|
|
<vab-query-form>
|
|
|
|
|
+ <vab-query-form-top-panel>
|
|
|
|
|
+ <el-form ref="queryForm" :inline="true" :model="queryForm" @submit.native.prevent>
|
|
|
|
|
+ <el-form-item prop="name">
|
|
|
|
|
+ <el-input v-model="queryForm.name" placeholder="工单名称" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item prop="orderTypeName">
|
|
|
|
|
+ <el-input v-model="queryForm.orderTypeName" placeholder="工单类型" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item prop="orderStatus">
|
|
|
|
|
+ <el-select v-model="queryForm.orderStatus" clearable placeholder="工单状态" style="width: 100%">
|
|
|
|
|
+ <el-option v-for="item in orderStatusOptions" :key="item.key" :label="item.value" :value="item.key" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item prop="assignUserName">
|
|
|
|
|
+ <el-input v-model="queryForm.assignUserName" placeholder="分派人员姓名" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button icon="el-icon-search" type="primary" @click="fetchData">查询</el-button>
|
|
|
|
|
+ <el-button icon="el-icon-refresh-right" @click="reset">重置</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </vab-query-form-top-panel>
|
|
|
<vab-query-form-left-panel :span="12">
|
|
<vab-query-form-left-panel :span="12">
|
|
|
- <el-button
|
|
|
|
|
- v-permissions="['proj:business:edit']"
|
|
|
|
|
- icon="el-icon-plus"
|
|
|
|
|
- size="mini"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- @click="$refs.edit.init()">
|
|
|
|
|
- 新建
|
|
|
|
|
- </el-button>
|
|
|
|
|
|
|
+ <el-button icon="el-icon-plus" size="mini" type="primary" @click="handleEdit">新建</el-button>
|
|
|
</vab-query-form-left-panel>
|
|
</vab-query-form-left-panel>
|
|
|
<vab-query-form-right-panel :span="12">
|
|
<vab-query-form-right-panel :span="12">
|
|
|
- <el-button icon="el-icon-download" @click="exportData" />
|
|
|
|
|
<table-tool :check-list.sync="checkList" :columns="columns" />
|
|
<table-tool :check-list.sync="checkList" :columns="columns" />
|
|
|
</vab-query-form-right-panel>
|
|
</vab-query-form-right-panel>
|
|
|
</vab-query-form>
|
|
</vab-query-form>
|
|
|
|
|
|
|
|
- <el-table v-loading="listLoading" border :data="list" :height="height">
|
|
|
|
|
|
|
+ <el-table v-loading="listLoading" border :data="list" :height="$baseTableHeight(1)">
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
v-for="(item, index) in finallyColumns"
|
|
v-for="(item, index) in finallyColumns"
|
|
|
:key="index"
|
|
:key="index"
|
|
@@ -43,29 +43,21 @@
|
|
|
:sortable="item.sortable"
|
|
:sortable="item.sortable"
|
|
|
:width="item.width">
|
|
:width="item.width">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- <span v-if="item.prop === 'orderTypeDesc'">
|
|
|
|
|
- {{ row.orderTypeDesc }}
|
|
|
|
|
- </span>
|
|
|
|
|
- <span v-if="item.prop === 'orderStatus'">
|
|
|
|
|
- {{ row.orderStatus }}
|
|
|
|
|
- </span>
|
|
|
|
|
- <span v-if="item.prop === 'assignUserName'">
|
|
|
|
|
- {{ row.assignUserName }}
|
|
|
|
|
- </span>
|
|
|
|
|
- <span v-if="item.prop === 'feedBack'">
|
|
|
|
|
- {{ row.feedBack }}
|
|
|
|
|
- </span>
|
|
|
|
|
- <span v-if="item.prop === 'createName'">
|
|
|
|
|
- {{ row.createName }}
|
|
|
|
|
|
|
+ <el-button v-if="item.prop === 'name'" style="font-size: 14px" type="text" @click="handleDetail(row)">
|
|
|
|
|
+ {{ row.name }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <span v-else-if="item.prop === 'orderStatus'">
|
|
|
|
|
+ {{ selectDictLabel(orderStatusOptions, row.orderStatus) }}
|
|
|
</span>
|
|
</span>
|
|
|
- <span v-if="item.prop === 'createTime'">
|
|
|
|
|
- {{ row.createTime }}
|
|
|
|
|
|
|
+ <span v-else-if="item.prop === 'createdTime'">
|
|
|
|
|
+ {{ parseTime(row.createdTime, '{y}-{m}-{d}') }}
|
|
|
</span>
|
|
</span>
|
|
|
|
|
+ <span v-else>{{ row[item.prop] }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="操作" width="85">
|
|
<el-table-column align="center" label="操作" width="85">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- <el-button type="text" @click="handleDetail(row)">查看</el-button>
|
|
|
|
|
|
|
+ <el-button type="text" @click="handleFeedback(row)">反 馈</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<template #empty>
|
|
<template #empty>
|
|
@@ -81,24 +73,30 @@
|
|
|
:total="total"
|
|
:total="total"
|
|
|
@current-change="handleCurrentChange"
|
|
@current-change="handleCurrentChange"
|
|
|
@size-change="handleSizeChange" />
|
|
@size-change="handleSizeChange" />
|
|
|
|
|
+ <!--创建工单-->
|
|
|
|
|
+ <edit ref="edit" @fetch-data="fetchData" />
|
|
|
|
|
+ <!--反馈-->
|
|
|
|
|
+ <feedback ref="feedback" @fetch-data="fetchData" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import to from 'await-to-js'
|
|
import to from 'await-to-js'
|
|
|
import api from '@/api/work/index'
|
|
import api from '@/api/work/index'
|
|
|
- import downloadFileByByte from '@/utils/base64ToFile'
|
|
|
|
|
import TableTool from '@/components/table/TableTool'
|
|
import TableTool from '@/components/table/TableTool'
|
|
|
|
|
+ import Edit from './components/Edit'
|
|
|
|
|
+ import Feedback from './components/Feedback'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'WorkOrder',
|
|
name: 'WorkOrder',
|
|
|
- components: { TableTool },
|
|
|
|
|
|
|
+ components: { TableTool, Edit, Feedback },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
activeName: 'first',
|
|
activeName: 'first',
|
|
|
layout: 'total, sizes, prev, pager, next, jumper',
|
|
layout: 'total, sizes, prev, pager, next, jumper',
|
|
|
queryForm: {
|
|
queryForm: {
|
|
|
- orderTypeDesc: '',
|
|
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ orderTypeName: '',
|
|
|
orderStatus: '',
|
|
orderStatus: '',
|
|
|
assignUserName: '',
|
|
assignUserName: '',
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
@@ -110,50 +108,47 @@
|
|
|
selectRows: [],
|
|
selectRows: [],
|
|
|
checkList: [],
|
|
checkList: [],
|
|
|
columns: [
|
|
columns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '工单名称',
|
|
|
|
|
+ width: '300px',
|
|
|
|
|
+ prop: 'name',
|
|
|
|
|
+ disableCheck: true,
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
label: '工单类型',
|
|
label: '工单类型',
|
|
|
width: 'auto',
|
|
width: 'auto',
|
|
|
- prop: 'orderTypeDesc',
|
|
|
|
|
- sortable: true,
|
|
|
|
|
- disableCheck: true,
|
|
|
|
|
|
|
+ prop: 'orderTypeName',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '工单状态',
|
|
label: '工单状态',
|
|
|
width: 'auto',
|
|
width: 'auto',
|
|
|
prop: 'orderStatus',
|
|
prop: 'orderStatus',
|
|
|
- sortable: true,
|
|
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '分派人员',
|
|
label: '分派人员',
|
|
|
width: 'auto',
|
|
width: 'auto',
|
|
|
prop: 'assignUserName',
|
|
prop: 'assignUserName',
|
|
|
- sortable: true,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '反馈信息',
|
|
|
|
|
- width: 'auto',
|
|
|
|
|
- prop: 'feedBack',
|
|
|
|
|
- sortable: true,
|
|
|
|
|
},
|
|
},
|
|
|
|
|
+ // {
|
|
|
|
|
+ // label: '反馈信息',
|
|
|
|
|
+ // width: 'auto',
|
|
|
|
|
+ // prop: 'feedBack',
|
|
|
|
|
+ // },
|
|
|
{
|
|
{
|
|
|
label: '创建人',
|
|
label: '创建人',
|
|
|
width: 'auto',
|
|
width: 'auto',
|
|
|
- prop: 'createName',
|
|
|
|
|
- sortable: true,
|
|
|
|
|
|
|
+ prop: 'createdName',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '创建时间',
|
|
label: '创建时间',
|
|
|
width: 'auto',
|
|
width: 'auto',
|
|
|
- prop: 'createTime',
|
|
|
|
|
- sortable: true,
|
|
|
|
|
|
|
+ prop: 'createdTime',
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
|
|
+ orderStatusOptions: [],
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
- height() {
|
|
|
|
|
- return this.$baseTableHeight(1)
|
|
|
|
|
- },
|
|
|
|
|
finallyColumns() {
|
|
finallyColumns() {
|
|
|
return this.columns.filter((item) => this.checkList.includes(item.label))
|
|
return this.columns.filter((item) => this.checkList.includes(item.label))
|
|
|
},
|
|
},
|
|
@@ -163,9 +158,12 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
- handleClick(tab) {
|
|
|
|
|
- console.log(tab, 'tab')
|
|
|
|
|
- this.fetchData()
|
|
|
|
|
|
|
+ getOptions() {
|
|
|
|
|
+ Promise.all([this.getDicts('work_order_status')])
|
|
|
|
|
+ .then(([workOrderStatus]) => {
|
|
|
|
|
+ this.orderStatusOptions = workOrderStatus.data.values || []
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => console.log(err))
|
|
|
},
|
|
},
|
|
|
async fetchData() {
|
|
async fetchData() {
|
|
|
this.listLoading = true
|
|
this.listLoading = true
|
|
@@ -176,27 +174,23 @@
|
|
|
this.total = res.data.total
|
|
this.total = res.data.total
|
|
|
this.listLoading = false
|
|
this.listLoading = false
|
|
|
},
|
|
},
|
|
|
- exportData() {
|
|
|
|
|
- let exportFrom = JSON.parse(JSON.stringify(this.queryForm))
|
|
|
|
|
- exportFrom.columns = this.finallyColumns.map((item) => item.label)
|
|
|
|
|
- api
|
|
|
|
|
- .deriveList(exportFrom)
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- if (res.data.list.content) {
|
|
|
|
|
- downloadFileByByte(res.data.list.content, '工单数据.xlsx')
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .catch((err) => {
|
|
|
|
|
- console.error(err)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ handleEdit(row) {
|
|
|
|
|
+ if (row.id) {
|
|
|
|
|
+ this.$refs['edit'].showEdit(row)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$refs['edit'].showEdit()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ handleFeedback(row) {
|
|
|
|
|
+ row.orderId = row.id
|
|
|
|
|
+ this.$refs['feedback'].showEdit(row)
|
|
|
},
|
|
},
|
|
|
//详情
|
|
//详情
|
|
|
handleDetail(row) {
|
|
handleDetail(row) {
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
- path: './detail',
|
|
|
|
|
|
|
+ name: 'WorkOrderDetail',
|
|
|
query: {
|
|
query: {
|
|
|
id: row.id,
|
|
id: row.id,
|
|
|
- privateCus: 1,
|
|
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -204,7 +198,8 @@
|
|
|
this.queryForm = {
|
|
this.queryForm = {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
- orderTypeDesc: '',
|
|
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ orderTypeName: '',
|
|
|
orderStatus: '',
|
|
orderStatus: '',
|
|
|
assignUserName: '',
|
|
assignUserName: '',
|
|
|
}
|
|
}
|