Commit 9a4daf48 by 郑艺斌

2022/11/29

parent 57f6a1fd
......@@ -3,6 +3,7 @@ import qs from "qs";
import { Message } from "iview";
axios.defaults.baseURL = "https://emaint.meiqicloud.com";
// axios.defaults.baseURL = "http://172.16.4.29:8063";
// axios.defaults.baseURL='http://localhost:8063'
export function qsdata(data) {
return qs.parse(qs.stringify(data));
......
......@@ -2,100 +2,111 @@
<div class="page1">
<Row :gutter="10" class="mt10">
<Col span="24">
<Card>
<p slot="title">
<Icon type="navicon-round"></Icon>
问题类别
</p>
<div class="search-row">
<Row>
<Col></Col>
<Col>
<template>
<Tree :data="questionlis" @on-select-change="showchildren" :empty-text="'加载中...'"></Tree>
</template>
</Col>
</Row>
</div>
</Card>
<Card>
<p slot="title">
<Icon type="navicon-round"></Icon>
问题类别
</p>
<div class="search-row">
<Row>
<Col>
</Col>
<Col>
<template>
<Tree :data="questionlis" @on-select-change="showchildren" @on-toggle-expand="onToggleExpand"
:empty-text="'加载中...'"></Tree>
</template>
</Col>
</Row>
</div>
</Card>
</Col>
</Row>
<div style="width:100%;" class="mt11">
<Row :gutter="10">
<Col span="24">
<Card class="search-card">
<p slot="title">
{{$route.meta.title}}
<collapse-icon foldPart="search-body"></collapse-icon>
</p>
<div id="search-body">
<Form :model="formItem" :label-width="80">
<Row type="flex" justify="start">
<Col span="12">
<FormItem label="常见问题">
<Input v-model="formItem.problem" :maxlength="20" placeholder="请输入常见问题"></Input>
</FormItem>
</Col>
</Row>
</Form>
<div class="search-row">
<Col></Col>
<Col>
<Button type="primary" icon="search" @click="searchSubmit">搜索</Button>
<Button type="ghost" icon="refresh" @click="searchCancel">重置</Button>
<Card class="search-card">
<p slot="title">
{{ $route.meta.title }}
<collapse-icon foldPart="search-body"></collapse-icon>
</p>
<div id="search-body">
<Form :model="formItem" :label-width="80">
<Row type="flex" justify="start">
<Col span="12">
<FormItem label="常见问题">
<Input v-model="formItem.problem" :maxlength="20" placeholder="请输入常见问题"></Input>
</FormItem>
</Col>
</div>
</Row>
</Form>
<div class="search-row">
<Col>
</Col>
<Col>
<Button type="primary" icon="search" @click="searchSubmit">搜索</Button>
<Button type="ghost" icon="refresh" @click="searchCancel">重置</Button>
</Col>
</div>
</Card>
</div>
</Card>
</Col>
</Row>
<Row :gutter="10" class="mt10 lastmt10">
<Col span="24" class="TabsList">
<div v-for="(item, index) in tabsList" :class="{ tabsItem: true, 'tabsActive': tabActive === item.value }"
@click="onTabs(item.value)">{{ item.label }}
</div>
</Col>
</Row>
<Row :gutter="10" class="lastmt10">
<Col span="24">
<Card>
<div class="search-row">
<Row>
<Col>
<Button type="primary" icon="plus-round" @click="addProject">新增</Button>
</Col>
<Col></Col>
</Row>
</div>
<Row class="searchable-table-con">
<m-table
:config="tableConfig"
:searchParams="formItem"
ref="table"
:searchTime="searchTime"
:isFirst="isFirst"
></m-table>
<Card dis-hover>
<div class="search-row">
<Row>
<Col>
<Button type="primary" icon="plus-round" @click="addProject">新增</Button>
</Col>
</Row>
</Card>
</div>
<Row class="searchable-table-con">
<m-table :config="tableConfig" :searchParams="formItem" ref="table" :searchTime="searchTime"
:isFirst="isFirst"></m-table>
</Row>
</Card>
</Col>
</Row>
</div>
<Modal v-model="addModal" title="常见问题新增" width="800" @on-cancel="addCancel">
<Modal v-model="addModal" title="分类标签" width="800" @on-cancel="addCancel">
<Form ref="addForm" :model="addForm" :label-width="100" :rules="ruleAdd">
<Row>
<Col span="20">
<FormItem label="常见问题" prop="problem">
<Input v-model="addForm.problem" placeholder="请输入常见问题"></Input>
</FormItem>
<FormItem label="标签分类" prop="problem">
<RadioGroup v-model="addForm.label">
<Radio label="常见问题"></Radio>
<Radio label="解决办法"></Radio>
</RadioGroup>
</FormItem>
</Col>
<Col span="20">
<FormItem label="常见问题" prop="problem">
<Input v-model="addForm.problem" placeholder="请输入常见问题"></Input>
</FormItem>
</Col>
<Col span="20">
<FormItem label="优先级">
<div>
<Select v-model="addForm.priority" placeholder="请选择优先级">
<Option :value="item.value" v-for="(item,index) in yxj" :key="index">{{item.name}}</Option>
</Select>
</div>
</FormItem>
<FormItem label="优先级">
<div>
<Select v-model="addForm.priority" placeholder="请选择优先级">
<Option :value="item.value" v-for="(item, index) in yxj" :key="index">{{ item.name }}</Option>
</Select>
</div>
</FormItem>
</Col>
<Col span="20">
<Form-item label="父级类目">
<Input v-model="parentname" readonly></Input>
</Form-item>
<Form-item label="父级类目">
<Input v-model="parentname" readonly></Input>
</Form-item>
</Col>
</Row>
</Form>
......@@ -109,40 +120,31 @@
<Form ref="updateForm" :model="updateForm" :label-width="100" :rules="ruleAdd">
<Row>
<Col span="20">
<FormItem label="常见问题" prop="problem">
<Input v-model="updateForm.problem" placeholder="请输入常见问题"></Input>
</FormItem>
<FormItem label="常见问题" prop="problem">
<Input v-model="updateForm.problem" placeholder="请输入常见问题"></Input>
</FormItem>
</Col>
<Col span="20">
<FormItem label="优先级">
<div>
<Select v-model="updateForm.priority" placeholder="请选择优先级">
<Option :value="item.value" v-for="(item,index) in yxj" :key="index">{{item.name}}</Option>
</Select>
</div>
</FormItem>
<FormItem label="优先级">
<div>
<Select v-model="updateForm.priority" placeholder="请选择优先级">
<Option :value="item.value" v-for="(item, index) in yxj" :key="index">{{ item.name }}</Option>
</Select>
</div>
</FormItem>
</Col>
<Col span="20">
<Form-item label="父级类目">
<i-select placeholder="请选择父级" v-model="updateForm.parentId" style="text-align:left">
<i-option
:value="item.id"
v-for="(item,index) in fjlm"
:key="index"
>{{item.problem}}</i-option>
</i-select>
</Form-item>
<Form-item label="父级类目">
<i-select placeholder="请选择父级" v-model="updateForm.parentId" style="text-align:left">
<i-option :value="item.id" v-for="(item, index) in fjlm" :key="index">{{ item.problem }}</i-option>
</i-select>
</Form-item>
</Col>
</Row>
</Form>
<div slot="footer" style="text-align: right;">
<Button type="ghost" size="default" @click="addCancel">取消</Button>
<Button
type="primary"
size="default"
@click="addSubmit('update')"
:loading="modal_loading"
>确定</Button>
<Button type="primary" size="default" @click="addSubmit('update')" :loading="modal_loading">确定</Button>
</div>
</Modal>
......@@ -158,7 +160,7 @@
import qs from "qs";
import util from "@/assets/js/util";
export default {
data() {
data () {
return {
auth: JSON.parse(sessionStorage.auth), //登录用户的角色权限
updateModel: false,
......@@ -181,7 +183,8 @@ export default {
formItem: {
parentId: "null",
problem: "",
watch: true
watch: true,
label: ""
},
//表格
tableConfig: {
......@@ -214,6 +217,7 @@ export default {
qs.stringify({ id: params.row.id }),
res => {
this.updateForm = res.responseResult;
return
this.$request.post(
"/api/emaint/problem-base/view",
qs.stringify({ id: this.updateForm.parentId }),
......@@ -277,11 +281,35 @@ export default {
type: params.row.priority === '一级' ? 'error' : (params.row.priority === '二级' ? 'warning' : (params.row.priority === '三级' ? 'success' : 'info')),
size: 'small'
}
}, !params.row.priority ? '未设置' : params.row.priority)
}, !params.row.priority ? '未设置' : params.row.priority)
])
}
},
{
title: "标题分类",
key: "label",
width: 200,
align: "center",
render: (h, params) => {
if (params.row.label == '0') {
return h(
'span',
'常见问题'
)
} else if (params.row.label == '1') {
return h(
'span',
'解决问题'
)
} else {
return h(
'span',
''
)
}
}
},
{
title: "常见问题",
key: "problem",
width: 200,
......@@ -294,6 +322,7 @@ export default {
parentId: ""
},
questionlis: [],
questionlis1: [],
//新增表单
addForm: {
problem: "",
......@@ -306,25 +335,38 @@ export default {
problem: [
{ required: true, message: "请输入常见问题", trigger: "blur" }
]
}
},
tabsList: [
{ label: '全部', value: '' },
{ label: '常见问题', value: '0' },
{ label: '解决办法', value: '1' },
],
tabActive: ''
};
},
computed: {
// 被选择的列表数据条数
selected_count() {
selected_count () {
return this.$refs.table.selected_count;
},
// 被选择的列表数据
selection() {
selection () {
return this.$refs.table.selection;
}
},
mounted() {
mounted () {
//获取楼栋
},
methods: {
showchildren(v) {
if(v.length > 0){
onToggleExpand (v) {
console.log(v);
if (v.expand && v.childList.length > 0) {
this.fjlm = v.childList
return
}
},
showchildren (v) {
if (v.length > 0) {
if (v[0].childList) {
return;
} else {
......@@ -334,16 +376,16 @@ export default {
}
},
//开始时间
getStartDate(startDate) {
getStartDate (startDate) {
this.formItem.startUpdateTime = startDate;
},
//结束时间
getEndDate(endDate) {
getEndDate (endDate) {
this.formItem.endUpdateTime = endDate;
},
//新增
addProject() {
addProject () {
if (this.activeli.id == "") {
this.$Message.info("请先选中一条二级记录");
return;
......@@ -351,7 +393,7 @@ export default {
this.addModal = true;
this.addForm.parentId = this.activeli.id;
this.questionlis.forEach(v => {
this.questionlis1.forEach(v => {
if (v.parentId == this.activeli.parentId) {
v.childList.forEach(v1 => {
if (v1.id == this.activeli.id) {
......@@ -363,12 +405,12 @@ export default {
// this.getIndex()
},
//新增表格选项
select(selection) {
select (selection) {
this.addForm.dataId = selection
.map(item => item.id)
},
//新增确定
addSubmit(type) {
addSubmit (type) {
this.modal_loading = true;
var ref = this.$refs.addForm;
type == "update"
......@@ -399,14 +441,14 @@ export default {
});
},
//新增取消
addCancel() {
addCancel () {
this.addModal = false;
this.updateModel = false;
(this.modal_loading = false), this.$Message.info("你取消了操作");
this.$refs.addForm.resetFields();
},
//删除
deleteProject(id) {
deleteProject (id) {
this.$Modal.confirm({
title: "操作提示",
content: "确认删除?",
......@@ -430,7 +472,7 @@ export default {
});
},
//搜索
searchSubmit() {
searchSubmit () {
this.isFirst = true;
this.$request.post(
"/api/emaint/problem-base/list",
......@@ -445,7 +487,7 @@ export default {
);
},
//重置
searchCancel() {
searchCancel () {
this.formItem = {
parentId: "",
problem: ""
......@@ -461,40 +503,57 @@ export default {
}, 200);
},
//提示窗关闭
closes() {
closes () {
this.noteModal = false;
},
getlist() {
getlist () {
// 查询一级问题
this.$request.post(
"/api/emaint/problem-base/treeList",
"/api/emaint/problem-base/a/treeList",
{},
data => {
data.responseResult.forEach((v, i) => {
v.title = v.parentProblem;
data.responseResult.forEach(v => {
if (v.dataSource == '0') {
v.title = '特房集团'
} else if (v.dataSource == '1') {
v.title = '塔楼客户'
} else if (v.dataSource == '2') {
v.title = '轨道集团'
}
v.children = v.childList;
v.disabled = true
v.expand = true
if (v.children.length > 0) {
if (i == 0) {
v.expand = true;
} else v.expand = false;
v.children.forEach((v1, i1) => {
if (i1 == 0 && i == 0) {
v1.selected = true;
this.formItem.parentId = v1.id;
v.children.forEach(v1 => {
v1.title = v1.parentProblem;
v1.children = v1.childList;
if (v1.children.length > 0) {
v1.children.forEach(v2 => {
v2.title = v2.problem;
})
}
v1.title = v1.problem;
v1.expand = false;
});
}
});
this.questionlis = data.responseResult;
data.responseResult.forEach(item => {
if (item.childList.length) {
item.childList.forEach(item1 => {
this.questionlis1.push(item1)
})
}
})
},
data => {
}
);
},
onTabs (value) {
this.tabActive = value
this.formItem.label = value
}
},
created() {
created () {
this.getlist();
this.$request.post(
"/api/dictionary/optionsByGroupCode",
......@@ -508,7 +567,7 @@ export default {
},
watch: {
activeli: {
handler(newValue, oldValue) {
handler (newValue, oldValue) {
var id = newValue.id;
this.formItem.parentId = id;
},
......@@ -522,27 +581,33 @@ div.page1 {
width: 100%;
display: flex;
}
div.page1 > div {
div.page1>div {
margin-top: 0px;
margin-right: 5px !important;
margin-left: 0px !important;
}
div.page1 > div:first-of-type {
div.page1>div:first-of-type {
width: 30% !important;
}
div.page1 > div.mt10 div.ivu-row > div.ivu-col:first-of-type {
div.page1>div.mt10 div.ivu-row>div.ivu-col:first-of-type {
margin-left: 80px;
}
div.page1 > div.mt10 div.ivu-row > div.ivu-col:last-of-type {
div.page1>div.mt10 div.ivu-row>div.ivu-col:last-of-type {
margin-top: 10px;
/* border: 1px solid #eee; */
/* background-color: rgba(240, 240, 240, 1); */
padding-left: 15%;
text-align: left;
}
div.page1 div.ivu-card-body {
padding: 0px;
}
div.page1 div.ivu-row {
width: 100%;
}
......@@ -551,15 +616,19 @@ div.page1 div.first,
div.two {
line-height: 30px;
}
div.page1 div.first {
background-color: rgba(204, 204, 204, 1);
}
div.page1 div.two {
background-color: rgba(240, 240, 240, 1);
}
div.page1 div.lastmt10 div.ivu-row {
width: unset;
}
.mt11 div.ivu-card {
padding-bottom: 10px;
padding-right: 10px;
......@@ -569,5 +638,26 @@ div.page1 div.lastmt10 div.ivu-row {
.ivu-tree-title {
font-size: 14px;
}
.TabsList {
display: flex;
}
.TabsList .tabsItem {
width: 200px;
padding: 15px 0;
margin-left: 1px;
position: relative;
bottom: -3px;
z-index: 99;
text-align: center;
border-radius: 5px 5px 0 0;
cursor: pointer;
}
.TabsList .tabsActive {
background: #fff;
font-weight: bold;
}
</style>
......@@ -2,28 +2,38 @@
<div>
<Row :gutter="10">
<Col span="24">
<Card class="search-card">
<p slot="title">
{{$route.meta.title}}
<collapse-icon foldPart="search-body"></collapse-icon>
</p>
<div id="search-body">
<Form :label-width="80">
<Row>
<Card class="search-card">
<p slot="title">
{{ $route.meta.title }}
<collapse-icon foldPart="search-body"></collapse-icon>
</p>
<div id="search-body">
<Form :label-width="80">
<Row>
<Col span="6">
<FormItem label="时间">
<DatePicker type="daterange" v-model="createdTime" split-panels placeholder="请选择起始时间" style="width: 200px" @on-change="getcreatedTime"></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
<Col span="6">
<FormItem label="时间">
<DatePicker type="daterange" v-model="createdTime" split-panels placeholder="请选择起始时间"
style="width: 200px" @on-change="getcreatedTime"></DatePicker>
</FormItem>
</Col>
<Col span="6">
<FormItem label="组织">
<Select v-model="formItem.dataSource">
<Option v-for="item in organization" :value="item.dataSource" :key="item.dataSource">{{
item.label
}}</Option>
</Select>
</FormItem>
</Col>
</Row>
</Form>
<div class="search-row">
<Col>
</Col>
<Col>
<Button type="primary" @click="searchSubmit" icon="search">检索</Button>
<Button type="ghost" @click="searchCancel" icon="refresh">重置</Button>
<Button type="primary" @click="searchSubmit" icon="search">检索</Button>
<Button type="ghost" @click="searchCancel" icon="refresh">重置</Button>
</Col>
</div>
</div>
......@@ -33,19 +43,20 @@
<Row :gutter="10" class="mt10">
<Col span="24">
<Card>
<div class="search-row">
<Row>
<Col>
<Button type="primary" icon="ios-redo" v-if="auth.tf_company_problem_data_export" @click="exportTabel()">导出</Button>
</Col>
<Col>
</Col>
</Row>
</div>
<Row class="searchable-table-con">
<m-table :config="tableConfig" :searchParams="formItem" ref="table" :isFirst="isFirst"></m-table>
<Card>
<div class="search-row">
<Row>
<Col>
<Button type="primary" icon="ios-redo" v-if="auth.tf_company_problem_data_export"
@click="exportTabel()">导出</Button>
</Col>
<Col>
</Col>
</Row>
</div>
<Row class="searchable-table-con">
<m-table :config="tableConfig" :searchParams="formItem" ref="table" :isFirst="isFirst"></m-table>
</Row>
</Card>
</Col>
</Row>
......@@ -54,231 +65,266 @@
</div>
</template>
<style>
textarea{
resize:none;
}
.test{
display: inline-block;
width:50px;
height:30px;
text-align: center;
line-height: 30px;
margin-right: 5px;
margin-bottom: 5px;
color: white;
position: relative;
}
.house{
width:40px;
height:30px;
text-align: center;
line-height: 30px;
color: white;
margin: 0 3px 9px 3px;
}
.bg-gray{
background-color: #808080;
color: white;
}
.bg-green{
background-color: #1cad1f;
color: white;
}
.bg-red{
background-color: #e42a2d;
color: white;
}
.img-position{
position: absolute;
top: 2px;
right: 3px;
}
.batch-house-tips{
display: inline-block;
font-size: 12px;
margin-right: 10px;
margin-bottom: 10px;
}
.batch-house-red{
background-color: #e42a2d;
padding: 5px;
color: #ffffff;
}
.batch-house-green{
background-color: #1cad1f;
padding: 5px;
color: #ffffff;
justify-content: center;
}
.batch-house-gray{
background-color: #808080;
padding: 5px;
color: #ffffff;
}
textarea {
resize: none;
}
.test {
display: inline-block;
width: 50px;
height: 30px;
text-align: center;
line-height: 30px;
margin-right: 5px;
margin-bottom: 5px;
color: white;
position: relative;
}
.house {
width: 40px;
height: 30px;
text-align: center;
line-height: 30px;
color: white;
margin: 0 3px 9px 3px;
}
.bg-gray {
background-color: #808080;
color: white;
}
.bg-green {
background-color: #1cad1f;
color: white;
}
.bg-red {
background-color: #e42a2d;
color: white;
}
.img-position {
position: absolute;
top: 2px;
right: 3px;
}
.batch-house-tips {
display: inline-block;
font-size: 12px;
margin-right: 10px;
margin-bottom: 10px;
}
.batch-house-red {
background-color: #e42a2d;
padding: 5px;
color: #ffffff;
}
.batch-house-green {
background-color: #1cad1f;
padding: 5px;
color: #ffffff;
justify-content: center;
}
.batch-house-gray {
background-color: #808080;
padding: 5px;
color: #ffffff;
}
</style>
<script type="text/ecmascript-6">
import qs from "qs";
import axios from 'axios'
import index from "../../router"
export default {
data () {
return {
auth:JSON.parse(sessionStorage.auth),//登录用户的角色权限
isFirst: false, //首页.
loading: true, //加载
//表单
formItem: {
beginDate:"",
endDate:"",
},
endDate:"",
beginDate:"",
// 设置结束时间大于开始时间
end:{
disabledDate :(function(date){
return date.valueOf() < new Date( this.formItem.beginDate)
}).bind(this)
},
createdTime:[],
//表格
tableConfig:{
url:"/api/emaint/repairProblem/totalComapnyCountList",
columns:[
{
title: '操作',
width:70,
align:"center",
render:(h,params)=>{
return h('Button', {
props: {
type: 'primary',
size: 'small'
},
on: {
click: () => {
sessionStorage.setItem("companyName",params.row.companyName)
sessionStorage.setItem("beginDate",this.formItem.beginDate)
sessionStorage.setItem("endDate",this.formItem.endDate)
this.$router.push({name:"reportDetail",params:{companyName:params.row.companyName}})
}
}
},"详情")
}
},
{
title: '公司',
key: 'companyName',
width:120,
align:"center"
},
{
title: '硬件单数',
key: 'yjCount',
width:70,
align:"center"
},
{
title: '软件单数',
key: 'rjCount',
width:70,
align:"center"
},
{
title: '其他',
key: 'otherCount',
width:70,
align:"center"
},
{
title: '总数',
key: 'totalCount',
width:70,
align:"center"
},
{
title: '已完成单数',
key: 'completeCount',
width:70,
align:"center"
import qs from "qs";
import axios from 'axios'
import index from "../../router"
export default {
data () {
return {
auth: JSON.parse(sessionStorage.auth),//登录用户的角色权限
isFirst: false, //首页.
loading: true, //加载
//表单
formItem: {
beginDate: "",
endDate: "",
dataSource: ""
},
endDate: "",
beginDate: "",
// 设置结束时间大于开始时间
end: {
disabledDate: (function (date) {
return date.valueOf() < new Date(this.formItem.beginDate)
}).bind(this)
},
createdTime: [],
//表格
tableConfig: {
url: "/api/emaint/repairProblem/totalComapnyCountList",
columns: [
{
title: '操作',
width: 70,
align: "center",
render: (h, params) => {
return h('Button', {
props: {
type: 'primary',
size: 'small'
},
{
title: '待维修单数',
key: 'uncompleteCount',
width:70,
align:"center"
on: {
click: () => {
sessionStorage.setItem("companyName", params.row.companyName)
sessionStorage.setItem("beginDate", this.formItem.beginDate)
sessionStorage.setItem("endDate", this.formItem.endDate)
this.$router.push({ name: "reportDetail", params: { companyName: params.row.companyName } })
}
}
],
}
}
},
created(){
var dd=new Date()
var ff=new Date()
var week = dd.getDay(); //获取时间的星期数
var minus = week ? week - 1 : 6;
dd.setDate(dd.getDate() - minus); //获取minus天前的日期
var y = dd.getFullYear();
var m = (dd.getMonth()+1) < 10 ? "0"+(dd.getMonth() + 1):(dd.getMonth()+1); //获取月份
var d = dd.getDate() < 10 ?( '0' + dd.getDate()):dd.getDate()
this.formItem.beginDate=(y + "-" + m + "-" + d)
this.beginDate=this.formItem.beginDate
this.createdTime.push(this.beginDate)
}, "详情")
}
},
{
title: '组织',
key: 'groupName',
width: 120,
align: "center"
},
{
title: '公司',
key: 'companyName',
width: 120,
align: "center"
},
{
title: '硬件单数',
key: 'yjCount',
width: 70,
align: "center"
},
{
title: '软件单数',
key: 'rjCount',
width: 70,
align: "center"
},
{
title: '其他',
key: 'otherCount',
width: 70,
align: "center"
},
{
title: '总数',
key: 'totalCount',
width: 70,
align: "center"
},
{
title: '已完成单数',
key: 'completeCount',
width: 70,
align: "center"
},
{
title: '待维修单数',
key: 'uncompleteCount',
width: 70,
align: "center"
}
],
},
organization: []
}
},
created () {
this.getOrganization()
var dd = new Date()
var ff = new Date()
var week = dd.getDay(); //获取时间的星期数
var minus = week ? week - 1 : 6;
dd.setDate(dd.getDate() - minus); //获取minus天前的日期
var y = dd.getFullYear();
var m = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1); //获取月份
var d = dd.getDate() < 10 ? ('0' + dd.getDate()) : dd.getDate()
this.formItem.beginDate = (y + "-" + m + "-" + d)
this.beginDate = this.formItem.beginDate
this.createdTime.push(this.beginDate)
var week = ff.getDay(); //获取时间的星期数
var maxus = week ? 7 - week : 0;
ff.setDate(ff.getDate() + maxus); //获取minus天前的日期
var a = ff.getFullYear();
var b = (ff.getMonth()+1) < 10 ? "0"+(ff.getMonth() + 1):(ff.getMonth()+1); //获取月份
var c = ff.getDate() < 10 ?( '0' + ff.getDate()):ff.getDate()
this.formItem.endDate=(a + "-" + b + "-" + c)
this.endDate=this.formItem.endDate
this.createdTime.push(this.endDate)
var week = ff.getDay(); //获取时间的星期数
var maxus = week ? 7 - week : 0;
ff.setDate(ff.getDate() + maxus); //获取minus天前的日期
var a = ff.getFullYear();
var b = (ff.getMonth() + 1) < 10 ? "0" + (ff.getMonth() + 1) : (ff.getMonth() + 1); //获取月份
var c = ff.getDate() < 10 ? ('0' + ff.getDate()) : ff.getDate()
this.formItem.endDate = (a + "-" + b + "-" + c)
this.endDate = this.formItem.endDate
this.createdTime.push(this.endDate)
},
methods: {
// 导出
exportTabel () {
let begin = new Date(this.formItem.beginDate)
let beginM = begin.getMonth() + 1
begin = begin.getFullYear() + "-" + beginM + "-" + begin.getDate()
let end = new Date(this.formItem.endDate)
let endM = end.getMonth() + 1
end = end.getFullYear() + "-" + endM + "-" + end.getDate()
let url = axios.defaults.baseURL + "/api/emaint/repairProblem/exportCompanyProblemData?beginDate=" + begin + "&endDate=" + end + "&accessToken=" + sessionStorage.token
location.href = url
},
methods: {
// 导出
exportTabel(){
let begin=new Date(this.formItem.beginDate)
let beginM=begin.getMonth()+1
begin=begin.getFullYear()+"-"+beginM+"-"+begin.getDate()
let end=new Date(this.formItem.endDate)
let endM=end.getMonth()+1
end=end.getFullYear()+"-"+endM+"-"+end.getDate()
let url=axios.defaults.baseURL+"/api/emaint/repairProblem/exportCompanyProblemData?beginDate="+begin+"&endDate="+end+"&accessToken="+sessionStorage.token
location.href=url
},
//搜索
searchSubmit () {
if(this.formItem.beginDate!="" && this.formItem.endDate !=""){
this.isFirst = true
setTimeout(()=>{
this.$refs.table.init()
this.isFirst = false
},200)
}else{
this.$Modal.error({title: '提示信息', content: "请输入进行检索的完整起始时间"})
}
},
//重置
searchCancel(){
this.formItem.beginDate=""
this.formItem.endDate=""
this.beginDate=""
this.endDate=""
//搜索
searchSubmit () {
if (this.formItem.beginDate != "" && this.formItem.endDate != "") {
this.isFirst = true
this.createdTime=[]
setTimeout(()=>{
setTimeout(() => {
this.$refs.table.init()
this.isFirst = false
},200)
},
}, 200)
} else {
this.$Modal.error({ title: '提示信息', content: "请输入进行检索的完整起始时间" })
}
getcreatedTime(createdTime) {
this.formItem.beginDate=createdTime[0]
this.formItem.endDate=createdTime[1]
},
},
//重置
searchCancel () {
this.formItem.beginDate = ""
this.formItem.endDate = ""
this.formItem.dataSource = ""
this.beginDate = ""
this.endDate = ""
this.isFirst = true
this.createdTime = []
setTimeout(() => {
this.$refs.table.init()
this.isFirst = false
}, 200)
},
getcreatedTime (createdTime) {
this.formItem.beginDate = createdTime[0]
this.formItem.endDate = createdTime[1]
},
getOrganization () {
this.$request.post(
"/api/emaint/group/getGroup",
{},
res => {
this.organization = res.responseResult.map(item => {
if (item.dataSource == 1) {
item.label = '塔楼客户'
} else {
item.label = item.parentName
}
return item
})
})
}
}
}
</script>
......@@ -2,27 +2,37 @@
<div>
<Row :gutter="10">
<Col span="24">
<Card class="search-card">
<p slot="title">
{{$route.meta.title}}
<collapse-icon foldPart="search-body"></collapse-icon>
</p>
<div id="search-body">
<Form :label-width="80">
<Row>
<Col span="6">
<FormItem label="时间">
<DatePicker type="daterange" v-model="createdTime" split-panels placeholder="请选择起始时间" style="width: 200px" @on-change="getcreatedTime"></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
<Card class="search-card">
<p slot="title">
{{ $route.meta.title }}
<collapse-icon foldPart="search-body"></collapse-icon>
</p>
<div id="search-body">
<Form :label-width="80">
<Row>
<Col span="6">
<FormItem label="时间">
<DatePicker type="daterange" v-model="createdTime" split-panels placeholder="请选择起始时间"
style="width: 200px" @on-change="getcreatedTime"></DatePicker>
</FormItem>
</Col>
<Col span="6">
<FormItem label="组织">
<Select v-model="formItem.dataSource">
<Option v-for="item in organization" :value="item.dataSource" :key="item.dataSource">{{
item.label
}}</Option>
</Select>
</FormItem>
</Col>
</Row>
</Form>
<div class="search-row">
<Col>
</Col>
<Col>
<Button type="primary" @click="searchSubmit" icon="search">检索</Button>
<Button type="ghost" @click="searchCancel" icon="refresh">重置</Button>
<Button type="primary" @click="searchSubmit" icon="search">检索</Button>
<Button type="ghost" @click="searchCancel" icon="refresh">重置</Button>
</Col>
</div>
</div>
......@@ -32,19 +42,20 @@
<Row :gutter="10" class="mt10">
<Col span="24">
<Card>
<div class="search-row">
<Row>
<Col>
<Button type="primary" icon="ios-redo" v-if="auth.tf_user_problem_data_list_export" @click="exportTabel()">导出</Button>
</Col>
<Col>
</Col>
</Row>
</div>
<Row class="searchable-table-con">
<m-table :config="tableConfig" :searchParams="formItem" ref="table" :isFirst="isFirst"></m-table>
<Card>
<div class="search-row">
<Row>
<Col>
<Button type="primary" icon="ios-redo" v-if="auth.tf_user_problem_data_list_export"
@click="exportTabel()">导出</Button>
</Col>
<Col>
</Col>
</Row>
</div>
<Row class="searchable-table-con">
<m-table :config="tableConfig" :searchParams="formItem" ref="table" :isFirst="isFirst"></m-table>
</Row>
</Card>
</Col>
</Row>
......@@ -53,229 +64,258 @@
</div>
</template>
<style>
textarea{
resize:none;
}
.test{
display: inline-block;
width:50px;
height:30px;
text-align: center;
line-height: 30px;
margin-right: 5px;
margin-bottom: 5px;
color: white;
position: relative;
}
.house{
width:40px;
height:30px;
text-align: center;
line-height: 30px;
color: white;
margin: 0 3px 9px 3px;
}
.bg-gray{
background-color: #808080;
color: white;
}
.bg-green{
background-color: #1cad1f;
color: white;
}
.bg-red{
background-color: #e42a2d;
color: white;
}
.img-position{
position: absolute;
top: 2px;
right: 3px;
}
.batch-house-tips{
display: inline-block;
font-size: 12px;
margin-right: 10px;
margin-bottom: 10px;
}
.batch-house-red{
background-color: #e42a2d;
padding: 5px;
color: #ffffff;
}
.batch-house-green{
background-color: #1cad1f;
padding: 5px;
color: #ffffff;
justify-content: center;
}
.batch-house-gray{
background-color: #808080;
padding: 5px;
color: #ffffff;
}
</style>
<script type="text/ecmascript-6">
import qs from "qs";
import axios from 'axios'
import index from "../../router"
export default {
data () {
return {
auth:JSON.parse(sessionStorage.auth),//登录用户的角色权限
isFirst: false, //首页.
//表单
formItem: {
beginDate:"",
endDate:"",
},
endDate:"",
beginDate:"",
// 设置结束时间大于开始时间
end:{
disabledDate :(function(date){
return date.valueOf() < new Date( this.formItem.beginDate)
}).bind(this)
},
createdTime:[],
//表格
tableConfig:{
url:"/api/emaint/repairProblem/totalUserCountList",
columns:[
{
title: '操作',
width:70,
align:"center",
render:(h,params)=>{
return h('Button', {
props: {
type: 'primary',
size: 'small',
disabled: !this.auth.tf_user_problem_data_details_list
},
style:{
width:"60px"
},
on: {
click: () => {
sessionStorage.setItem("beginDate",this.formItem.beginDate)
sessionStorage.setItem("endDate",this.formItem.endDate)
sessionStorage.setItem("operationDetailUserId",params.row.userId)
this.$router.push({name: "operationDetail"})
textarea {
resize: none;
}
}
}
},"详情")
}
},
{
title:'姓名',
key: 'userName',
width:90,
},
{
title: '执行总数',
key: 'totalCount',
width:70,
},
.test {
display: inline-block;
width: 50px;
height: 30px;
text-align: center;
line-height: 30px;
margin-right: 5px;
margin-bottom: 5px;
color: white;
position: relative;
}
{
title: '执行已完成',
key: 'completeCount',
width:70,
},
{
title: '执行待维修',
key: 'uncompleteCount',
width:70,
},
{
title: '参与总数',
key: 'cyTotalCount',
width:70,
},
{
title: '参与已完成',
key: 'cyCompleteCount',
width:70,
.house {
width: 40px;
height: 30px;
text-align: center;
line-height: 30px;
color: white;
margin: 0 3px 9px 3px;
}
.bg-gray {
background-color: #808080;
color: white;
}
.bg-green {
background-color: #1cad1f;
color: white;
}
.bg-red {
background-color: #e42a2d;
color: white;
}
.img-position {
position: absolute;
top: 2px;
right: 3px;
}
.batch-house-tips {
display: inline-block;
font-size: 12px;
margin-right: 10px;
margin-bottom: 10px;
}
.batch-house-red {
background-color: #e42a2d;
padding: 5px;
color: #ffffff;
}
.batch-house-green {
background-color: #1cad1f;
padding: 5px;
color: #ffffff;
justify-content: center;
}
.batch-house-gray {
background-color: #808080;
padding: 5px;
color: #ffffff;
}
</style>
<script type="text/ecmascript-6">
import qs from "qs";
import axios from 'axios'
import index from "../../router"
export default {
data () {
return {
auth: JSON.parse(sessionStorage.auth),//登录用户的角色权限
isFirst: false, //首页.
//表单
formItem: {
beginDate: "",
endDate: "",
dataSource: ""
},
endDate: "",
beginDate: "",
// 设置结束时间大于开始时间
end: {
disabledDate: (function (date) {
return date.valueOf() < new Date(this.formItem.beginDate)
}).bind(this)
},
createdTime: [],
//表格
tableConfig: {
url: "/api/emaint/repairProblem/totalUserCountList",
columns: [
{
title: '操作',
width: 70,
align: "center",
render: (h, params) => {
return h('Button', {
props: {
type: 'primary',
size: 'small',
disabled: !this.auth.tf_user_problem_data_details_list
},
{
title: '参与待维修',
key: 'cyUncompleteCount',
width:70,
style: {
width: "60px"
},
],
}
}
},
created(){
var dd=new Date()
var ff=new Date()
var week = dd.getDay(); //获取时间的星期数
var minus = week ? week - 1 : 6;
dd.setDate(dd.getDate() - minus); //获取minus天前的日期
var y = dd.getFullYear();
var m = (dd.getMonth()+1) < 10 ? "0"+(dd.getMonth() + 1):(dd.getMonth()+1); //获取月份
var d = dd.getDate() < 10 ?( '0' + dd.getDate()):dd.getDate()
this.formItem.beginDate=(y + "-" + m + "-" + d)
this.beginDate=this.formItem.beginDate
this.createdTime.push(this.beginDate)
on: {
click: () => {
sessionStorage.setItem("beginDate", this.formItem.beginDate)
sessionStorage.setItem("endDate", this.formItem.endDate)
sessionStorage.setItem("operationDetailUserId", params.row.userId)
this.$router.push({ name: "operationDetail" })
var week = ff.getDay(); //获取时间的星期数
var maxus = week ? 7 - week : 0;
ff.setDate(ff.getDate() + maxus); //获取minus天前的日期
var a = ff.getFullYear();
var b = (ff.getMonth()+1) < 10 ? "0"+(ff.getMonth() + 1):(ff.getMonth()+1); //获取月份
var c = ff.getDate() < 10 ?( '0' + ff.getDate()):ff.getDate()
this.formItem.endDate=(a + "-" + b + "-" + c)
// console.log(this.formItem.endDate)
this.endDate=this.formItem.endDate
this.createdTime.push(this.endDate)
}
}
}, "详情")
}
},
{
title: '姓名',
key: 'userName',
width: 90,
},
{
title: '执行总数',
key: 'totalCount',
width: 70,
},
},
methods: {
// 导出
exportTabel(){
let begin=new Date(this.formItem.beginDate)
let beginM=begin.getMonth()+1
begin=begin.getFullYear()+"-"+beginM+"-"+begin.getDate()
let end=new Date(this.formItem.endDate)
let endM=end.getMonth()+1
end=end.getFullYear()+"-"+endM+"-"+end.getDate()
let url=axios.defaults.baseURL+"/api/emaint/repairProblem/exportUserProblemData?beginDate="+begin+"&endDate="+end+"&accessToken="+sessionStorage.token
location.href=url
{
title: '执行已完成',
key: 'completeCount',
width: 70,
},
{
title: '执行待维修',
key: 'uncompleteCount',
width: 70,
},
{
title: '参与总数',
key: 'cyTotalCount',
width: 70,
},
{
title: '参与已完成',
key: 'cyCompleteCount',
width: 70,
},
{
title: '参与待维修',
key: 'cyUncompleteCount',
width: 70,
},
],
},
//搜索
searchSubmit () {
if(this.formItem.beginDate!="" && this.formItem.endDate !=""){
this.isFirst = true
setTimeout(()=>{
this.$refs.table.init()
this.isFirst = false
},200)
}else{
this.$Modal.error({title: '提示信息', content: "请输入进行检索的完整起始时间"})
}
organization: []
}
},
created () {
this.getOrganization()
var dd = new Date()
var ff = new Date()
var week = dd.getDay(); //获取时间的星期数
var minus = week ? week - 1 : 6;
dd.setDate(dd.getDate() - minus); //获取minus天前的日期
var y = dd.getFullYear();
var m = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1); //获取月份
var d = dd.getDate() < 10 ? ('0' + dd.getDate()) : dd.getDate()
this.formItem.beginDate = (y + "-" + m + "-" + d)
this.beginDate = this.formItem.beginDate
this.createdTime.push(this.beginDate)
},
//重置
searchCancel(){
this.formItem.beginDate=""
this.formItem.endDate=""
this.beginDate=""
this.endDate=""
var week = ff.getDay(); //获取时间的星期数
var maxus = week ? 7 - week : 0;
ff.setDate(ff.getDate() + maxus); //获取minus天前的日期
var a = ff.getFullYear();
var b = (ff.getMonth() + 1) < 10 ? "0" + (ff.getMonth() + 1) : (ff.getMonth() + 1); //获取月份
var c = ff.getDate() < 10 ? ('0' + ff.getDate()) : ff.getDate()
this.formItem.endDate = (a + "-" + b + "-" + c)
// console.log(this.formItem.endDate)
this.endDate = this.formItem.endDate
this.createdTime.push(this.endDate)
},
methods: {
// 导出
exportTabel () {
let begin = new Date(this.formItem.beginDate)
let beginM = begin.getMonth() + 1
begin = begin.getFullYear() + "-" + beginM + "-" + begin.getDate()
let end = new Date(this.formItem.endDate)
let endM = end.getMonth() + 1
end = end.getFullYear() + "-" + endM + "-" + end.getDate()
let url = axios.defaults.baseURL + "/api/emaint/repairProblem/exportUserProblemData?beginDate=" + begin + "&endDate=" + end + "&accessToken=" + sessionStorage.token
location.href = url
},
//搜索
searchSubmit () {
if (this.formItem.beginDate != "" && this.formItem.endDate != "") {
this.isFirst = true
this.createdTime=[]
setTimeout(()=>{
setTimeout(() => {
this.$refs.table.init()
this.isFirst = false
},200)
},
getcreatedTime(createdTime) {
this.formItem.beginDate=createdTime[0]
this.formItem.endDate=createdTime[1]
},
}, 200)
} else {
this.$Modal.error({ title: '提示信息', content: "请输入进行检索的完整起始时间" })
}
},
//重置
searchCancel () {
this.formItem.beginDate = ""
this.formItem.endDate = ""
this.formItem.dataSource = ""
this.beginDate = ""
this.endDate = ""
this.isFirst = true
this.createdTime = []
setTimeout(() => {
this.$refs.table.init()
this.isFirst = false
}, 200)
},
getcreatedTime (createdTime) {
this.formItem.beginDate = createdTime[0]
this.formItem.endDate = createdTime[1]
},
getOrganization () {
this.$request.post(
"/api/emaint/group/getGroup",
{},
res => {
this.organization = res.responseResult.map(item => {
if (item.dataSource == 1) {
item.label = '塔楼客户'
} else {
item.label = item.parentName
}
return item
})
})
}
}
}
</script>
......@@ -27,7 +27,8 @@
<Card>
<div class="search-row">
<Row>
<Col>
</Col>
<Col>
<template>
<Tree :data="questionlis" @on-select-change="showchildren" :empty-text="'暂无数据'"></Tree>
......@@ -35,7 +36,6 @@
</Col>
</Row>
</div>
</Card>
</Col>
</Row>
......@@ -47,7 +47,12 @@
<p slot="title">
问题新增
</p>
<i-form :model="addformdata" :rules="ruleValidate" :label-width="90" class="addform">
<i-form ref="formValidate" :model="addformdata" :rules="ruleValidate" :label-width="100" class="addform">
<Form-item label="问题分类分组" prop="dataSource">
<RadioGroup v-model="addformdata.dataSource" @on-change="getParent">
<Radio :label="item.value" v-for="item in mechanism" :key="item.value">{{ item.label }}</Radio>
</RadioGroup>
</Form-item>
<Form-item label="类型名称" prop="problem">
<i-input placeholder="请输入类型名称" v-model="addformdata.problem"></i-input>
</Form-item>
......@@ -55,7 +60,7 @@
<Form-item label="父级类目">
<i-select placeholder="请选择父级" v-model="addformdata.parentId" style="text-align:left">
<i-option value=""></i-option>
<i-option :value="item.parentId" v-for="(item, index) in questionlis" :key="index">{{ item.parentProblem
<i-option :value="item.parentId" v-for="(item, index) in questionlis1" :key="index">{{ item.parentProblem
}}
</i-option>
......@@ -96,9 +101,8 @@
</template>
</div>
<Upload v-if="!uploadList.length || uploadList.length < 1" ref="upload" :show-upload-list="false"
:on-success="handleSuccess" :format="['jpg', 'png']" :max-size="2048" type="drag"
:action="uploadUrl" :before-upload="handleBeforeUpload"
style="display: inline-block;width:58px;">
:on-success="handleSuccess" :format="['jpg', 'png']" :max-size="2048" type="drag" :action="uploadUrl"
:before-upload="handleBeforeUpload" style="display: inline-block;width:58px;">
<div style="width: 58px;height:58px;line-height: 58px;">
<Icon type="ios-plus-empty" size="20"></Icon>
</div>
......@@ -125,7 +129,12 @@
<p slot="title">
问题编辑
</p>
<i-form :model="updatedata" :rules="ruleValidate" :label-width="90" class="addform">
<i-form ref="formValidate" :model="updatedata" :rules="ruleValidate" :label-width="100" class="addform">
<Form-item label="问题分类分组" prop="dataSource">
<RadioGroup v-model="updatedata.dataSource" @on-change="getParent">
<Radio :label="item.value" v-for="item in mechanism" :key="item.value">{{ item.label }}</Radio>
</RadioGroup>
</Form-item>
<Form-item label="类型名称" prop="problem">
<i-input placeholder="请输入类型名称" v-model="updatedata.problem"></i-input>
</Form-item>
......@@ -134,7 +143,7 @@
<i-select :placeholder="updatedata.treeLevel == 1 ? '已属于顶级类目' : '请选择父级类目'" style="text-align:left"
v-model="updatedata.parentId" :disabled="updatedata.treeLevel == 1 ? true : false">
<i-option value=""></i-option>
<i-option :value="item.parentId" v-for="(item, index) in questionlis" :key="index">{{ item.parentProblem
<i-option :value="item.parentId" v-for="(item, index) in questionlis1" :key="index">{{ item.parentProblem
}}
</i-option>
</i-select>
......@@ -171,9 +180,8 @@
</template>
</div>
<Upload v-if="!uploadList.length || uploadList.length < 1" ref="upload" :show-upload-list="false"
:on-success="handleSuccess" :format="['jpg', 'png']" :max-size="2048" type="drag"
:action="uploadUrl" :before-upload="handleBeforeUpload"
style="display: inline-block;width:58px;">
:on-success="handleSuccess" :format="['jpg', 'png']" :max-size="2048" type="drag" :action="uploadUrl"
:before-upload="handleBeforeUpload" style="display: inline-block;width:58px;">
<div style="width: 58px;height:58px;line-height: 58px;">
<Icon type="ios-plus-empty" size="20"></Icon>
</div>
......@@ -220,6 +228,12 @@ export default {
defaultExecutorName: '',
},
ruleValidate: {
dataSource: [
{ required: true, message: "请选择问题分类分组", trigger: "change" }
],
parent: [
{ required: true, message: "请选择组织机构", trigger: "change" }
],
problem: [
{ required: true, message: "类型名称不能为空", trigger: "blur" }
]
......@@ -230,7 +244,8 @@ export default {
},
updatedata: {},
questionlis: [],
questionlis1: [],
mechanism: [],
//新增-表单
addForm: {
areaId: "",
......@@ -252,8 +267,9 @@ export default {
deliveryDate: "",
actualDate: "",
orgId: "",
projectId: ""
}
projectId: "",
},
projectList: []
};
},
computed: {
......@@ -299,7 +315,7 @@ export default {
this.uploadList.splice(fileList.indexOf(item), 1);
},
async handleBeforeUpload (res) {
return this.checkImageWH(res, 64, 64)
// return this.checkImageWH(res, 64, 64)
},
handleSuccess (res, file) {
this.seriesImage = res.responseResult
......@@ -373,29 +389,36 @@ export default {
}
},
save (type) {
if (type == "add") {
this.$request.post(
"/api/emaint/problem-base/save",
{ ...this.addformdata, iconImgs: this.seriesImage },
data => {
this.$Message.success("添加成功");
this.getlist();
},
data => {
}
);
} else {
this.$request.post(
"/api/emaint/problem-base/save",
{ ...this.updatedata, iconImgs: this.seriesImage },
data => {
this.$Message.success("修改成功");
this.getlist();
},
data => {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
if (type == "add") {
this.$request.post(
"/api/emaint/problem-base/save",
{ ...this.addformdata, iconImgs: this.seriesImage },
data => {
this.$Message.success("添加成功");
this.getlist();
},
data => {
}
);
} else {
this.$request.post(
"/api/emaint/problem-base/save",
{ ...this.updatedata, iconImgs: this.seriesImage },
data => {
this.$Message.success("修改成功");
this.getlist();
},
data => {
}
);
}
);
}
} else {
this.$Message.error('请输入必填项!');
}
})
return
},
addquestion () {
this.addformdata.parentId = this.activeli.id;
......@@ -418,10 +441,10 @@ export default {
res => {
this.$set(this.$data, 'updatedata', {})
this.uploadList = []
let obj = {
status: 'finished',
}
if (res.responseResult.iconImgs !== null) {
if (res.responseResult.iconImgs !== null && res.responseResult.iconImgs !== "") {
let obj = {
}
obj.status = 'finished'
obj.url = res.responseResult.iconImgs
this.uploadList.push(obj)
}
......@@ -449,26 +472,54 @@ export default {
getlist () {
// 查询一级问题
this.$request.post(
"/api/emaint/problem-base/treeList",
"/api/emaint/problem-base/a/treeList",
{},
data => {
let mechanism = []
data.responseResult.forEach(v => {
v.title = v.parentProblem;
if (v.dataSource == '0') {
v.title = '特房集团'
mechanism.push({ label: '特房集团', value: v.dataSource })
} else if (v.dataSource == '1') {
v.title = '塔楼客户'
mechanism.push({ label: '塔楼客户', value: v.dataSource })
} else if (v.dataSource == '2') {
v.title = '轨道集团'
mechanism.push({ label: '轨道集团', value: v.dataSource })
}
v.children = v.childList;
v.disabled = true
v.expand = true
if (v.children.length > 0) {
v.expand = false;
v.children.forEach(v1 => {
v1.title = v1.problem;
v.expand = false;
v1.title = v1.parentProblem;
v1.children = v1.childList;
if (v1.children.length > 0) {
v1.children.forEach(v2 => {
v2.title = v2.problem;
})
}
});
}
});
this.questionlis = data.responseResult;
this.mechanism = mechanism
data.responseResult.forEach(item => {
if (item.childList.length) {
item.childList.forEach(item1 => {
this.questionlis1.push(item1)
})
}
})
},
data => {
}
);
},
getParent (value) {
let arr = this.questionlis.filter(item => item.dataSource == value)
this.questionlis1 = arr[0].childList
},
// 删除问题
delquestion () {
if (this.activeli.id == "") {
......@@ -612,6 +663,10 @@ div.controlbutton button {
cursor: pointer;
margin: 0 2px;
}
.search-row .title {
padding: 8px 0;
}
</style>
......@@ -2,28 +2,29 @@
<div>
<Row :gutter="10">
<Col span="24">
<Card class="search-card">
<p slot="title">
{{$route.meta.title}}
<collapse-icon foldPart="search-body"></collapse-icon>
</p>
<div id="search-body">
<Form :label-width="80">
<Row>
<Card class="search-card">
<p slot="title">
{{ $route.meta.title }}
<collapse-icon foldPart="search-body"></collapse-icon>
</p>
<div id="search-body">
<Form :label-width="80">
<Row>
<Col span="6">
<FormItem label="时间">
<DatePicker type="daterange" v-model="createdTime" split-panels placeholder="请选择起始时间" style="width: 200px" @on-change="getcreatedTime"></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
<Col span="6">
<FormItem label="时间">
<DatePicker type="daterange" v-model="createdTime" split-panels placeholder="请选择起始时间"
style="width: 200px" @on-change="getcreatedTime"></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
<div class="search-row">
<Col>
</Col>
<Col>
<Button type="primary" @click="searchSubmit" icon="search">检索</Button>
<Button type="ghost" @click="searchCancel" icon="refresh">重置</Button>
<Button type="primary" @click="searchSubmit" icon="search">检索</Button>
<Button type="ghost" @click="searchCancel" icon="refresh">重置</Button>
</Col>
</div>
</div>
......@@ -33,19 +34,19 @@
<Row :gutter="10" class="mt10">
<Col span="24">
<Card>
<!--<div class="search-row">-->
<!--<Row>-->
<!--<Col>-->
<!--<Button type="primary" icon="ios-redo" v-if="auth.tf_company_problem_data_export" @click="exportTabel()">导出</Button>-->
<!--</Col>-->
<!--<Col>-->
<!--</Col>-->
<!--</Row>-->
<!--</div>-->
<Row class="searchable-table-con">
<Table :loading="tableLoading" :columns="columns" :data="tableData" ref="table"></Table>
</Row>
<Card>
<!--<div class="search-row">-->
<!--<Row>-->
<!--<Col>-->
<!--<Button type="primary" icon="ios-redo" v-if="auth.tf_company_problem_data_export" @click="exportTabel()">导出</Button>-->
<!--</Col>-->
<!--<Col>-->
<!--</Col>-->
<!--</Row>-->
<!--</div>-->
<Row class="searchable-table-con">
<Table :loading="tableLoading" :columns="columns" :data="tableData" ref="table"></Table>
</Row>
</Card>
</Col>
</Row>
......@@ -54,269 +55,279 @@
</div>
</template>
<style>
textarea{
resize:none;
}
.test{
display: inline-block;
width:50px;
height:30px;
text-align: center;
line-height: 30px;
margin-right: 5px;
margin-bottom: 5px;
color: white;
position: relative;
}
.house{
width:40px;
height:30px;
text-align: center;
line-height: 30px;
color: white;
margin: 0 3px 9px 3px;
}
.bg-gray{
background-color: #808080;
color: white;
}
.bg-green{
background-color: #1cad1f;
color: white;
}
.bg-red{
background-color: #e42a2d;
color: white;
}
.img-position{
position: absolute;
top: 2px;
right: 3px;
}
.batch-house-tips{
display: inline-block;
font-size: 12px;
margin-right: 10px;
margin-bottom: 10px;
}
.batch-house-red{
background-color: #e42a2d;
padding: 5px;
color: #ffffff;
}
.batch-house-green{
background-color: #1cad1f;
padding: 5px;
color: #ffffff;
justify-content: center;
}
.batch-house-gray{
background-color: #808080;
padding: 5px;
color: #ffffff;
}
textarea {
resize: none;
}
.test {
display: inline-block;
width: 50px;
height: 30px;
text-align: center;
line-height: 30px;
margin-right: 5px;
margin-bottom: 5px;
color: white;
position: relative;
}
.house {
width: 40px;
height: 30px;
text-align: center;
line-height: 30px;
color: white;
margin: 0 3px 9px 3px;
}
.bg-gray {
background-color: #808080;
color: white;
}
.bg-green {
background-color: #1cad1f;
color: white;
}
.bg-red {
background-color: #e42a2d;
color: white;
}
.img-position {
position: absolute;
top: 2px;
right: 3px;
}
.batch-house-tips {
display: inline-block;
font-size: 12px;
margin-right: 10px;
margin-bottom: 10px;
}
.batch-house-red {
background-color: #e42a2d;
padding: 5px;
color: #ffffff;
}
.batch-house-green {
background-color: #1cad1f;
padding: 5px;
color: #ffffff;
justify-content: center;
}
.batch-house-gray {
background-color: #808080;
padding: 5px;
color: #ffffff;
}
</style>
<script type="text/ecmascript-6">
import qs from "qs";
import axios from 'axios'
import index from "@/router"
export default {
data () {
return {
auth:JSON.parse(sessionStorage.auth),//登录用户的角色权限
isFirst: false, //首页.
tableLoading: false,
maintUsers: [],
//表单
formItem: {
beginDate:"",
endDate:"",
},
endDate:"",
beginDate:"",
// 设置结束时间大于开始时间
end:{
disabledDate :(function(date){
return date.valueOf() < new Date( this.formItem.beginDate)
}).bind(this)
},
createdTime:[],
columns:[],
//表格
tableData: []
}
},
created(){
var dd=new Date()
var ff=new Date()
var week = dd.getDay(); //获取时间的星期数
var minus = week ? week - 1 : 6;
dd.setDate(dd.getDate() - minus); //获取minus天前的日期
var y = dd.getFullYear();
var m = (dd.getMonth()+1) < 10 ? "0"+(dd.getMonth() + 1):(dd.getMonth()+1); //获取月份
var d = dd.getDate() < 10 ?( '0' + dd.getDate()):dd.getDate()
this.formItem.beginDate=(y + "-" + m + "-" + d)
this.beginDate=this.formItem.beginDate
this.createdTime.push(this.beginDate)
import qs from "qs";
import axios from 'axios'
import index from "@/router"
export default {
data () {
return {
auth: JSON.parse(sessionStorage.auth),//登录用户的角色权限
isFirst: false, //首页.
tableLoading: false,
maintUsers: [],
//表单
formItem: {
beginDate: "",
endDate: "",
},
endDate: "",
beginDate: "",
// 设置结束时间大于开始时间
end: {
disabledDate: (function (date) {
return date.valueOf() < new Date(this.formItem.beginDate)
}).bind(this)
},
createdTime: [],
columns: [],
//表格
tableData: []
}
},
created () {
var dd = new Date()
var ff = new Date()
var week = dd.getDay(); //获取时间的星期数
var minus = week ? week - 1 : 6;
dd.setDate(dd.getDate() - minus); //获取minus天前的日期
var y = dd.getFullYear();
var m = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1); //获取月份
var d = dd.getDate() < 10 ? ('0' + dd.getDate()) : dd.getDate()
this.formItem.beginDate = (y + "-" + m + "-" + d)
this.beginDate = this.formItem.beginDate
this.createdTime.push(this.beginDate)
var week = ff.getDay(); //获取时间的星期数
var maxus = week ? 7 - week : 0;
ff.setDate(ff.getDate() + maxus); //获取minus天前的日期
var a = ff.getFullYear();
var b = (ff.getMonth()+1) < 10 ? "0"+(ff.getMonth() + 1):(ff.getMonth()+1); //获取月份
var c = ff.getDate() < 10 ?( '0' + ff.getDate()):ff.getDate()
this.formItem.endDate=(a + "-" + b + "-" + c)
this.endDate=this.formItem.endDate
this.createdTime.push(this.endDate)
var week = ff.getDay(); //获取时间的星期数
var maxus = week ? 7 - week : 0;
ff.setDate(ff.getDate() + maxus); //获取minus天前的日期
var a = ff.getFullYear();
var b = (ff.getMonth() + 1) < 10 ? "0" + (ff.getMonth() + 1) : (ff.getMonth() + 1); //获取月份
var c = ff.getDate() < 10 ? ('0' + ff.getDate()) : ff.getDate()
this.formItem.endDate = (a + "-" + b + "-" + c)
this.endDate = this.formItem.endDate
this.createdTime.push(this.endDate)
// 获取运维人员构建表头
this.createTable()
// 获取运维人员构建表头
this.createTable()
},
methods: {
createTable(){
let self = this
this.$request.get(
"/api/user/getMaintainUser",
{},
res => {
if (res.responseResult) {
self.maintUsers = res.responseResult;
self.columns = [{
title: '公司',
key: 'companyName',
width:120,
align:"center"
}]
self.maintUsers.forEach(v => {
self.columns.push({
title: v.name,
},
methods: {
createTable () {
let self = this
this.$request.get(
"/api/user/getMaintainUser",
{},
res => {
if (res.responseResult) {
self.maintUsers = res.responseResult;
self.columns = [{
title: '公司',
key: 'companyName',
width: 120,
align: "center"
}]
self.maintUsers.forEach(v => {
self.columns.push({
title: v.name,
align: 'center',
width: 320,
children: [{
title: '硬件',
key: v.id + '_hardware_count',
align: 'center',
width: 320,
children: [{
title: '硬件',
key: v.id + '_hardware_count',
align: 'center',
width: 80
},
{
title: '软件',
key: v.id + '_software_count',
align: 'center',
width: 80
},
{
title: '支持',
key: v.id + '_maint_count',
align: 'center',
width: 80
},
{
title: '合计',
key: v.id + '_total_count',
align: 'center',
width: 80
}]
})
});
this.loadData()
} else {
self.$Message.error("加载表头失败");
}
},
res => {
width: 80
},
{
title: '软件',
key: v.id + '_software_count',
align: 'center',
width: 80
},
{
title: '支持',
key: v.id + '_maint_count',
align: 'center',
width: 80
},
{
title: '合计',
key: v.id + '_total_count',
align: 'center',
width: 80
}]
})
});
this.loadData()
} else {
self.$Message.error("加载表头失败");
}
);
},
res => {
self.$Message.error("加载表头失败");
}
);
},
},
// 导出
loadData(){
let self = this
this.tableLoading = true
this.$request.post(
"/api/emaint/repairProblem/overviewCountList",
self.formItem,
res => {
if (res.responseResult && res.responseResult.length > 0) {
self.tableData = res.responseResult;
self.tableData.forEach(v => {
self.maintUsers.forEach(v2 => {
let key = v2.id + '_total_count'
v[key] = 0
let key1 = v2.id + '_hardware_count'
v[key1] = 0
let key2 = v2.id + '_software_count'
v[key2] = 0
let key3 = v2.id + '_maint_count'
v[key3] = 0
})
});
// 导出
loadData () {
let self = this
this.tableLoading = true
this.$request.post(
"/api/emaint/repairProblem/overviewCountList",
self.formItem,
res => {
if (res.responseResult && res.responseResult.length > 0) {
self.tableData = res.responseResult;
self.tableData.forEach(v => {
self.maintUsers.forEach(v2 => {
let key = v2.id + '_total_count'
v[key] = 0
let key1 = v2.id + '_hardware_count'
v[key1] = 0
let key2 = v2.id + '_software_count'
v[key2] = 0
let key3 = v2.id + '_maint_count'
v[key3] = 0
})
});
self.tableData.forEach(v => {
v.maintUserCount.forEach(v2 => {
let key = v2.userId + '_total_count'
v[key] = 0
let key1 = v2.userId + '_hardware_count'
v[key1] = v2.hardwareCount
v[key] += v[key1]
self.tableData.forEach(v => {
v.maintUserCount.forEach(v2 => {
let key = v2.userId + '_total_count'
v[key] = 0
let key1 = v2.userId + '_hardware_count'
v[key1] = v2.hardwareCount
v[key] += v[key1]
let key2 = v2.userId + '_software_count'
v[key2] = v2.softwareCount
v[key] += v[key2]
let key2 = v2.userId + '_software_count'
v[key2] = v2.softwareCount
v[key] += v[key2]
let key3 = v2.userId + '_maint_count'
v[key3] = v2.maintCount
v[key] += v[key3]
});
let key3 = v2.userId + '_maint_count'
v[key3] = v2.maintCount
v[key] += v[key3]
});
}
self.tableLoading = false
},
res => {
self.$Message.error("加载数据失败");
self.tableLoading = false
});
}
);
},
// 导出
exportTabel(){
this.$refs.table.exportCsv({
filename: '运维统计报表'
});
},
//搜索
searchSubmit () {
if(this.formItem.beginDate!="" && this.formItem.endDate !=""){
this.isFirst = true
this.loadData()
}else{
this.$Modal.error({title: '提示信息', content: "请输入进行检索的完整起始时间"})
self.tableLoading = false
},
res => {
self.$Message.error("加载数据失败");
self.tableLoading = false
}
);
},
},
//重置
searchCancel(){
this.formItem.beginDate=""
this.formItem.endDate=""
this.beginDate=""
this.endDate=""
// 导出
exportTabel () {
this.$refs.table.exportCsv({
filename: '运维统计报表'
});
},
//搜索
searchSubmit () {
if (this.formItem.beginDate != "" && this.formItem.endDate != "") {
this.isFirst = true
this.createdTime=[]
setTimeout(()=>{
this.$refs.table.init()
this.isFirst = false
},200)
},
this.loadData()
} else {
this.$Modal.error({ title: '提示信息', content: "请输入进行检索的完整起始时间" })
}
getcreatedTime(createdTime) {
this.formItem.beginDate=createdTime[0]
this.formItem.endDate=createdTime[1]
},
}
},
//重置
searchCancel () {
this.formItem.beginDate = ""
this.formItem.endDate = ""
this.beginDate = ""
this.endDate = ""
this.isFirst = true
this.createdTime = []
setTimeout(() => {
this.$refs.table.init()
this.isFirst = false
}, 200)
},
getcreatedTime (createdTime) {
this.formItem.beginDate = createdTime[0]
this.formItem.endDate = createdTime[1]
},
}
}
</script>
......@@ -4,301 +4,203 @@
<!-- 检索框 -->
<Row :gutter="10">
<Col span="24">
<Card class="search-card">
<p slot="title" id="labels">
<template>
<label @click="setstate('')" :style="{color:!formItem.state?'#57a3f3':''}">全部工单</label>
<label
@click="setstate('待派单')"
:style="{color:formItem.state=='待派单'?'#57a3f3':''}"
>待派单</label>
<label
@click="setstate('待维修')"
:style="{color:formItem.state=='待维修'?'#57a3f3':''}"
>待维修</label>
<label
@click="setstate('待评价')"
:style="{color:formItem.state=='待评价'?'#57a3f3':''}"
>待评价</label>
<label
@click="setstate('已评价')"
:style="{color:formItem.state=='已评价'?'#57a3f3':''}"
>已评价</label>
</template>
<collapse-icon foldPart="search-body"></collapse-icon>
</p>
<div id="search-body">
<Form :model="formItem" :label-width="80" :rules="ruleAdd">
<Row type="flex" justify="start">
<Col span="6">
<FormItem label="检索条件">
<Input
v-model="formItem.keyword"
:maxlength="20"
placeholder="工单号 / 姓名 / 状态 / 联系电话 / 执行人 / 问题类别"
></Input>
</FormItem>
</Col>
<Col span="6">
<FormItem label="工单号">
<Input v-model="formItem.workOrderNo" :maxlength="20" placeholder="请输入工单号"></Input>
</FormItem>
</Col>
<Col span="6">
<FormItem label="报修人">
<Input v-model="formItem.name" :maxlength="30" placeholder="请输入报修人姓名" />
</FormItem>
</Col>
<Col span="6">
<FormItem label="联系人">
<Input v-model="formItem.contactName" :maxlength="30" placeholder="请输入联系人姓名" />
</FormItem>
</Col>
<Col span="6">
<FormItem label="手机号" prop="phone">
<Input v-model="formItem.contactPhone" :maxlength="20" placeholder="请输入手机号" />
</FormItem>
</Col>
<Col span="6">
<FormItem label="执行人">
<Input v-model="formItem.userName" :maxlength="20" placeholder="请输入执行人" />
</FormItem>
</Col>
<Col span="8">
<FormItem label="创建时间">
<DatePicker
type="datetimerange"
v-model="createdTime"
split-panels
placeholder="请选择起始时间"
style="width:100%!important"
@on-change="getCreatedTime"
></DatePicker>
</FormItem>
</Col>
<Col span="8">
<FormItem label="完成时间">
<DatePicker
type="datetimerange"
v-model="completionTime"
split-panels
placeholder="请选择完成时间"
style="width:100%!important"
@on-change="getCompletionTime"
></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
<div class="search-row">
<Col></Col>
<Col>
<Button type="primary" icon="search" @click="searchSubmit">搜索</Button>
<Button type="ghost" icon="refresh" @click="searchCancel">重置</Button>
<Card class="search-card">
<p slot="title" id="labels">
<template>
<label @click="setstate('')" :style="{ color: !formItem.state ? '#57a3f3' : '' }">全部工单</label>
<label @click="setstate('待派单')" :style="{ color: formItem.state == '待派单' ? '#57a3f3' : '' }">待派单</label>
<label @click="setstate('待维修')" :style="{ color: formItem.state == '待维修' ? '#57a3f3' : '' }">待维修</label>
<label @click="setstate('待评价')" :style="{ color: formItem.state == '待评价' ? '#57a3f3' : '' }">待评价</label>
<label @click="setstate('已评价')" :style="{ color: formItem.state == '已评价' ? '#57a3f3' : '' }">已评价</label>
</template>
<collapse-icon foldPart="search-body"></collapse-icon>
</p>
<div id="search-body">
<Form :model="formItem" :label-width="80" :rules="ruleAdd">
<Row type="flex" justify="start">
<Col span="6">
<FormItem label="检索条件">
<Input v-model="formItem.keyword" :maxlength="20"
placeholder="工单号 / 姓名 / 状态 / 联系电话 / 执行人 / 问题类别"></Input>
</FormItem>
</Col>
</div>
<Col span="6">
<FormItem label="工单来源">
<Select v-model="formItem.dataSource">
<Option v-for="(item, index) in optionList" :key="index" :value="item.value">{{ item.label }}</Option>
</Select>
</FormItem>
</Col>
<Col span="6">
<FormItem label="工单号">
<Input v-model="formItem.workOrderNo" :maxlength="20" placeholder="请输入工单号"></Input>
</FormItem>
</Col>
<Col span="6">
<FormItem label="报修人">
<Input v-model="formItem.name" :maxlength="30" placeholder="请输入报修人姓名" />
</FormItem>
</Col>
<Col span="6">
<FormItem label="联系人">
<Input v-model="formItem.contactName" :maxlength="30" placeholder="请输入联系人姓名" />
</FormItem>
</Col>
<Col span="6">
<FormItem label="手机号" prop="phone">
<Input v-model="formItem.contactPhone" :maxlength="20" placeholder="请输入手机号" />
</FormItem>
</Col>
<Col span="6">
<FormItem label="执行人">
<Input v-model="formItem.userName" :maxlength="20" placeholder="请输入执行人" />
</FormItem>
</Col>
<Col span="8">
<FormItem label="创建时间">
<DatePicker type="datetimerange" v-model="createdTime" split-panels placeholder="请选择起始时间"
style="width:100%!important" @on-change="getCreatedTime"></DatePicker>
</FormItem>
</Col>
<Col span="8">
<FormItem label="完成时间">
<DatePicker type="datetimerange" v-model="completionTime" split-panels placeholder="请选择完成时间"
style="width:100%!important" @on-change="getCompletionTime"></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
<div class="search-row">
<Col>
</Col>
<Col>
<Button type="primary" icon="search" @click="searchSubmit">搜索</Button>
<Button type="ghost" icon="refresh" @click="searchCancel">重置</Button>
</Col>
</div>
</Card>
</div>
</Card>
</Col>
</Row>
<!-- 操作按钮 -->
<Row :gutter="10" class="mt10">
<Col span="24">
<Card>
<div class="search-row">
<Row>
<Col>
<Button
type="primary"
icon="plus-round"
@click="addProject"
v-if="auth.tf_repair_problem_edit"
>新增</Button>
<!--TODO 权限名称-->
<Button
type="primary"
icon="ios-copy-outline"
@click="copyWorkOrder"
v-if="auth.tf_repair_problem_edit"
>复制</Button>
<Button
type="primary"
icon="close"
@click="delModal"
v-if="auth.tf_repair_problem_delete"
>删除</Button>
<Button
type="primary"
icon="ios-redo"
@click="exportProject"
v-if="auth.tf_repair_problem_data_export"
>导出工单明细表</Button>
<Button
type="primary"
icon="ios-redo"
@click="exportProject_1"
v-if="auth.tf_repair_problem_data_export"
>导出客户回访表</Button>
</Col>
<Col></Col>
</Row>
</div>
<Row class="searchable-table-con">
<m-table
:config="tableConfig"
:searchParams="formItem"
ref="table"
:searchTime="searchTime"
:isFirst="isFirst"
></m-table>
<Card>
<div class="search-row">
<Row>
<Col>
<Button type="primary" icon="plus-round" @click="addProject" v-if="auth.tf_repair_problem_edit">新增</Button>
<!--TODO 权限名称-->
<Button type="primary" icon="ios-copy-outline" @click="copyWorkOrder"
v-if="auth.tf_repair_problem_edit">复制</Button>
<Button type="primary" icon="close" @click="delModal" v-if="auth.tf_repair_problem_delete">删除</Button>
<Button type="primary" icon="ios-redo" @click="exportProject"
v-if="auth.tf_repair_problem_data_export">导出工单明细表</Button>
<Button type="primary" icon="ios-redo" @click="exportProject_1"
v-if="auth.tf_repair_problem_data_export">导出客户回访表</Button>
</Col>
<Col>
</Col>
</Row>
</Card>
</div>
<Row class="searchable-table-con">
<m-table :config="tableConfig" :searchParams="formItem" ref="table" :searchTime="searchTime"
:isFirst="isFirst"></m-table>
</Row>
</Card>
</Col>
</Row>
<Modal v-model="deleteAllModal" width="300" title="删除工单提示">
<Input v-model="delRemarks" type="textarea" :rows="4" placeholder="请填写删除该工单原因"></Input>
<div slot="footer" style="text-align:center;margin:0 auto;">
<Button type="ghost" size="default" @click="deleteAllModal=false">取消</Button>
<Button type="ghost" size="default" @click="deleteAllModal = false">取消</Button>
<Button type="primary" size="default" @click="delAll()">确定</Button>
</div>
</Modal>
<!-- 备注 -->
<Modal
v-model="msgModal"
width="800"
title="备注"
@on-ok="msgOk"
@on-cancel="viewCancel('remark')"
>
<Modal v-model="msgModal" width="800" title="备注" @on-ok="msgOk" @on-cancel="viewCancel('remark')">
<Form :model="viewForm" :label-width="80">
<Row>
<Col span="24">
<FormItem label="图片描述" style="margin-top: 12px;">
<div
class="addimg"
:style="{'left':(index)*63+'px'}"
v-for="(item,index) in imglist"
:key="index"
>
<img :src="item" alt v-if="item!=''" @click="showtheimg(index)" />
<i class="ivu-icon ivu-icon-ios-plus-empty" v-else @click="uploadfile(index)"></i>
</div>
</FormItem>
<input type="file" name id="upfile" style="display:none;" @change="changefile" />
<FormItem label="图片描述" style="margin-top: 12px;">
<div class="addimg" :style="{ 'left': (index) * 63 + 'px' }" v-for="(item, index) in imglist" :key="index">
<img :src="item" alt v-if="item != ''" @click="showtheimg(index)" />
<i class="ivu-icon ivu-icon-ios-plus-empty" v-else @click="uploadfile(index)"></i>
</div>
</FormItem>
<input type="file" name id="upfile" style="display:none;" @change="changefile" />
</Col>
<Col span="24">
<FormItem label="备注">
<Input
v-model="viewForm.remark"
type="textarea"
:autosize="{minRows: 4,maxRows: 5}"
placeholder="请输入备注信息"
></Input>
</FormItem>
<FormItem label="备注">
<Input v-model="viewForm.remark" type="textarea" :autosize="{ minRows: 4, maxRows: 5 }"
placeholder="请输入备注信息"></Input>
</FormItem>
</Col>
</Row>
</Form>
<div slot="footer" style="text-align:right;">
<Row>
<Col span="24" v-if="this.viewTabs === 'remark'">
<Button size="default" @click="viewCancel('remark')">取消</Button>
<Button type="primary" size="default" @click="msgOk" :loading="modal_loading">确定</Button>
<Button size="default" @click="viewCancel('remark')">取消</Button>
<Button type="primary" size="default" @click="msgOk" :loading="modal_loading">确定</Button>
</Col>
</Row>
</div>
</Modal>
<!-- 图片幻灯 -->
<Modal
class="showtheimg"
title="图片查看"
v-model="visible"
@on-cancel="imgcancel"
:closable="false"
:mask-closable="false"
>
<Modal class="showtheimg" title="图片查看" v-model="visible" @on-cancel="imgcancel" :closable="false"
:mask-closable="false">
<img :src="imglist[showimg]" v-if="visible" style="width: 100%;" />
</Modal>
<!-- 变更执行人 -->
<Modal
v-model="choosemodel"
title="执行人选择"
width="500"
style="z-index:1001 !important;position:relative !important"
@on-cancel="choosemodel=false"
>
<RadioGroup
v-model="userindex"
style="width:100%;height:300px;overflow:auto;overflow-x:hidden;overflow-y:scroll"
>
<Radio
style="clear:both;width:100%;font-size:13px;padding:10px 5px"
:label="index"
v-for="(item,index) in userlist"
:key="index"
>
<span style="margin-left:15px;">{{item.name}}</span>
<span style="float:right;">{{item.problemNum==null?0:item.problemNum}}单</span>
<Modal v-model="choosemodel" title="执行人选择" width="500" style="z-index:1001 !important;position:relative !important"
@on-cancel="choosemodel = false">
<RadioGroup v-model="userindex" style="width:100%;height:300px;overflow:auto;overflow-x:hidden;overflow-y:scroll">
<Radio style="clear:both;width:100%;font-size:13px;padding:10px 5px" :label="index"
v-for="(item, index) in userlist" :key="index">
<span style="margin-left:15px;">{{ item.name }}</span>
<span style="float:right;">{{ item.problemNum == null ? 0 : item.problemNum }}单</span>
</Radio>
</RadioGroup>
<div slot="footer" style="text-align: right;">
<!-- @click="bgzxr" -->
<Button
type="primary"
size="default"
@click="dispatchItem.userName=userlist[userindex].name;dispatchItem.userId=userlist[userindex].id;choosemodel=false;"
:loading="modal_loading"
>确定</Button>
<Button type="primary" size="default"
@click="dispatchItem.userName = userlist[userindex].name; dispatchItem.userId = userlist[userindex].id; choosemodel = false;"
:loading="modal_loading">确定</Button>
</div>
</Modal>
<!-- 派单 -->
<Modal
v-model="dispatchModel"
title="派单信息"
width="500"
@on-ok="repairSubmit"
@on-cancel="dispatchModel=false"
>
<Modal v-model="dispatchModel" title="派单信息" width="500" @on-ok="repairSubmit" @on-cancel="dispatchModel = false">
<Form :model="dispatchItem" :label-width="80" :rules="ruleValidate">
<Row type="flex" style="margin-top:20px;margin-bottom:20px" justify="start">
<Col span="13">
<FormItem label="执行人" prop="executor">
<Input
class="buttoninput"
@on-click="choosemodel=true"
readonly
v-model="dispatchItem.userName"
icon="search"
:maxlength="20"
placeholder="点击搜索图标选择"
></Input>
</FormItem>
<FormItem label="执行人" prop="executor">
<Input class="buttoninput" @on-click="choosemodel = true" readonly v-model="dispatchItem.userName"
icon="search" :maxlength="20" placeholder="点击搜索图标选择"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="参与者">
<!-- <Input v-model="formItem.participators" ></Input> -->
<Select v-model="dispatchItem.participatorids" multiple style="width:100%;">
<Option
:value="item.id"
:label="item.name"
v-for="(item,index) in userlist"
:key="index"
>
<span
style="float: left;max-width: 120px;min-width: 120px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"
>{{item.name}}</span>
<span>{{item.problemNum==null?0:item.problemNum}}单</span>
</Option>
</Select>
</FormItem>
<FormItem label="参与者">
<!-- <Input v-model="formItem.participators" ></Input> -->
<Select v-model="dispatchItem.participatorids" multiple style="width:100%;">
<Option :value="item.id" :label="item.name" v-for="(item, index) in userlist" :key="index">
<span
style="float: left;max-width: 120px;min-width: 120px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">{{
item.name
}}</span>
<span>{{ item.problemNum == null ? 0 : item.problemNum }}单</span>
</Option>
</Select>
</FormItem>
</Col>
</Row>
</Form>
......@@ -309,7 +211,7 @@
import qs from "qs";
import axios from "axios";
export default {
data() {
data () {
return {
isok: false,
auth: JSON.parse(sessionStorage.auth), //登录用户的角色权限
......@@ -342,14 +244,15 @@ export default {
keyword: "",
state: "",
name: "",
contactName:"",
contactName: "",
phone: "",
isChange: "",
userName: "",
endTime: "",
beginTime: "",
completionBeginTime: "",
completionEndTime: ""
completionEndTime: "",
dataSource: ''
// watch: true
},
// 派单表单
......@@ -359,7 +262,7 @@ export default {
},
// 设置结束时间大于开始时间
end: {
disabledDate: function(date) {
disabledDate: function (date) {
return date.valueOf() < new Date(this.formItem.beginTime);
}.bind(this)
},
......@@ -401,6 +304,31 @@ export default {
}
},
{
title: "工单来源",
key: "dataSource",
width: 100,
render: (h, params) => {
if (params.row.dataSource == '0') {
return h(
'span',
'特房集团'
)
} else if (params.row.dataSource == '1') {
return h(
'span',
'塔楼客户'
)
} else if (params.row.dataSource == '2') {
return h(
'span',
'轨道集团'
)
} else {
return
}
}
},
{
title: "执行人",
key: "userName",
width: 80
......@@ -455,7 +383,7 @@ export default {
type: params.row.priority === '一级' ? 'error' : (params.row.priority === '二级' ? 'warning' : (params.row.priority === '三级' ? 'success' : 'info')),
size: 'small'
}
}, !params.row.priority ? '未设置' : params.row.priority)
}, !params.row.priority ? '未设置' : params.row.priority)
])
}
},
......@@ -548,7 +476,7 @@ export default {
required: false,
message: "请输入正确的手机号",
trigger: "blur",
transform(value) {
transform (value) {
if (value == null || value == "") return " ";
var reg = /[0-9]/;
if (!reg.test(value)) {
......@@ -571,16 +499,22 @@ export default {
viewForm: {
id: "",
remark: ""
}
},
optionList: [
{ label: '不限', value: '' },
{ label: '特房集团', value: '0' },
{ label: '轨道集团', value: '2' },
{ label: '塔楼客户', value: '1' },
]
};
},
computed: {
// 被选择的列表数据
selection() {
selection () {
return this.$refs.table.selection;
}
},
beforeCreate() {
beforeCreate () {
this.$request.post(
"/api/user/searchUserProblemNum",
qs.stringify({ limit: 1000, page: 1, keyword: "" }),
......@@ -591,37 +525,37 @@ export default {
}
);
},
created() {
created () {
// console.log(this.$route.params.status)
if (sessionStorage.getItem("paramsstatus")) {
this.formItem.state = sessionStorage.getItem("paramsstatus");
}
},
mounted() {
mounted () {
window.addEventListener("mousewheel", this.handleScroll, true) ||
window.addEventListener("DOMMouseScroll", this.handleScroll, false);
},
methods: {
handleScroll(e) {
handleScroll (e) {
console.log("页面应该发生滚动");
},
setstate(value) {
setstate (value) {
// console.log(value)
this.formItem.state = value;
sessionStorage.setItem("paramsstatus", value);
this.$refs.table.init();
},
// 选择文件
uploadfile(index) {
uploadfile (index) {
document.querySelector("#upfile").click();
this.upindex = index;
},
// 图片幻灯
showtheimg(index) {
showtheimg (index) {
this.showimg = index;
this.visible = true;
},
imgcancel() {
imgcancel () {
if (this.imglist.indexOf("") == -1) this.imglist.push("");
this.imglist.splice(this.showimg, 1);
this.files.splice(this.showimg, 1);
......@@ -629,13 +563,13 @@ export default {
this.imglist.push("");
this.imglist.pop("");
},
changefile(e) {
changefile (e) {
var file = e.target.files[0];
var reader = new FileReader();
reader.readAsDataURL(file);
var that = this;
reader.onload = function() {
reader.onload = function () {
that.imglist[that.upindex] = this.result;
that.files.push(file);
......@@ -647,7 +581,7 @@ export default {
};
},
// 变更执行人
bgzxr() {
bgzxr () {
this.choosemodel = false;
// console.log(this.userlist[this.userindex].id)
this.$request.post(
......@@ -669,7 +603,7 @@ export default {
);
},
repairSubmit() {
repairSubmit () {
if (this.isok) {
return;
} else this.isok = true;
......@@ -714,25 +648,25 @@ export default {
// getEndDate(endDate) {
// this.formItem.endTime = endDate;
// },
getCreatedTime(createdTime) {
getCreatedTime (createdTime) {
// Array [ "2019-07-20", "2019-08-14" ]
this.formItem.beginTime = createdTime[0];
this.formItem.endTime = createdTime[1];
},
getCompletionTime(completionTime) {
getCompletionTime (completionTime) {
// Array [ "2019-07-20", "2019-08-14" ]
this.formItem.completionBeginTime = completionTime[0];
this.formItem.completionEndTime = completionTime[1];
},
//新增
addProject() {
addProject () {
this.$router.push({
name: "workOrderManage"
});
},
// 导出
exportProject() {
exportProject () {
var beginTime = this.formItem.beginTime || "";
var endTime = this.formItem.endTime || "";
var completionBeginTime = this.formItem.completionBeginTime || "";
......@@ -752,7 +686,7 @@ export default {
},
// 导出
exportProject_1() {
exportProject_1 () {
var beginTime = this.formItem.beginTime || "";
var endTime = this.formItem.endTime || "";
var completionBeginTime = this.formItem.completionBeginTime || "";
......@@ -772,18 +706,18 @@ export default {
},
//搜索
searchSubmit() {
searchSubmit () {
this.isFirst = true;
this.$refs.table.init();
this.isFirst = false;
},
//重置
searchCancel() {
searchCancel () {
this.formItem = {
workOrderNo: "",
state: sessionStorage.getItem("paramsstatus"),
name: "",
contactName:"",
contactName: "",
phone: "",
isChange: "",
userName: "",
......@@ -802,7 +736,7 @@ export default {
},
// 备注提交
msgOk() {
msgOk () {
this.modal_loading = true;
if (this.isok) {
return;
......@@ -850,7 +784,7 @@ export default {
}
},
//取消操作
viewCancel(arg) {
viewCancel (arg) {
this.msgModal = false;
this.modal_loading = false;
this.$Message.info("你取消了操作");
......@@ -863,11 +797,11 @@ export default {
},
// 批量删除弹出框处理
delModal() {
delModal () {
// console.log(this.selection);
if (this.selection.length > 1) {
this.$Modal.error({ title: "提示信息", content: "请逐条删除数据!" });
}else if (this.selection.length > 0) {
} else if (this.selection.length > 0) {
this.deleteAllModal = true;
} else {
this.$Modal.error({ title: "提示信息", content: "请选择删除数据!" });
......@@ -875,7 +809,7 @@ export default {
},
// 批量删除
delAll() {
delAll () {
let _self = this
// console.log(this.selection)
if (!this.delRemarks) {
......@@ -902,7 +836,7 @@ export default {
}
);
},
copyWorkOrder(){
copyWorkOrder () {
let _self = this
let copyList = [];
this.selection.map(item => {
......@@ -938,31 +872,39 @@ div.addimg {
text-align: center;
top: -15px;
}
div.addimg img {
width: 100%;
height: 100%;
}
div.addimg .ivu-icon {
font-size: 40px;
line-height: 1.5;
}
div.showtheimg .ivu-modal-mask {
z-index: 800;
}
div.showtheimg .ivu-modal-wrap {
z-index: 1200;
}
div.showtheimg .ivu-modal {
top: 30px;
}
div.showtheimg .ivu-modal-body {
text-align: center;
}
div.showtheimg .ivu-modal-body img {
height: 22rem;
width: 74%;
}
p#labels > label {
p#labels>label {
cursor: pointer;
margin: 0px 10px;
}
......
<template>
<div>
<Card>
<!--<p slot="title">工单详情</p>-->
<div slot="title">
<!--工具栏-->
<Button :disabled="workOrder.state==='待评价'?true:workOrder.state==='已评价'?true:!auth.tf_repair_problem_edit" type="primary" @click="submit" >
提交修改
</Button>
<Button :disabled="workOrder.state==='待评价'?true:workOrder.state==='已评价'?true:!auth.tf_repair_problem_add_user" type="primary" style="margin-left: 10px" @click="openChangeUserModal">
{{workOrder.state=="待维修"?'变更执行人':'派单'}}
</Button>
<Button :disabled="workOrder.state==='待评价'?true:workOrder.state==='已评价'?true:!auth.tf_repair_problem_complete" type="primary" style="margin-left: 10px" @click="openCompleteModal">
完成工单
</Button>
<Button type="primary" style="margin-left: 10px" @click="openRemarkModal">
备注
</Button>
<Button style="margin-left: 10px" @click="goBack">
返回
</Button>
</div>
<!-- 编辑工单 -->
<Row :gutter="20">
<Col span="10">
<Card>
<p slot="title">单号: <span>{{workOrder.workOrderNo}}</span><span style="margin-left: 10px"><Tag color="blue">{{workOrder.state}}</Tag></span></p>
<Form ref="kfxx" :model="formItem" :label-width="120" :rules="ruleValidate">
<Row type="flex" justify="start">
<Col span="20">
<FormItem label="报修人">
<Select
v-model="custQuery"
filterable
ref="callidselect"
remote
:remote-method="custSearch"
icon="search"
:blur="callIDblur"
@on-change="custChange"
:maxlength="20"
placeholder="客户姓名 / 手机号 / 座机 / 内线号码 "
>
<Option
v-for="(option, index) in callIDOptions"
:value="option.name"
:key="index"
:label="option.label"
>{{option.name}}</Option>
</Select>
</FormItem>
</Col>
<Col span="4">
<div style="margin-top: 1px"><Button icon="plus-round" @click="handleAddCust" ></Button></div>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="代报修" style="width: 100%;text-align: left;" prop="replacementRepair">
<RadioGroup v-model="formItem.replacementRepair">
<Radio label="1">
<span></span>
</Radio>
<Radio label="0">
<span></span>
</Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
<!-- 联系人姓名 -->
<Row type="flex" justify="start">
<Col span="20">
<FormItem label="联系人" prop="contactName">
<Input type="text" v-model="formItem.contactName" :disabled="formItem.replacementRepair==='1'?false:true" v-show="formItem.replacementRepair!=='1'"></Input>
<Select
v-model="formItem.contactClient"
filterable
ref="contactSelect"
remote
:remote-method="contactCustSearch"
icon="search"
@on-change="contactCustChange"
:maxlength="20"
placeholder="客户姓名 / 手机号 / 座机 / 内线号码 "
:disabled="formItem.replacementRepair==='1'?false:true"
v-show="formItem.replacementRepair==='1'"
>
<Option
v-for="(option, index) in contactOptions"
:value="option.name"
:key="index"
:label="option.label"
>{{option.name}}</Option>
</Select>
</FormItem>
</Col>
<Col span="4">
<div style="margin-top: 1px"><Button icon="plus-round" @click="handleAddCust" v-show="formItem.replacementRepair==='1'"></Button></div>
</Col>
</Row>
<!-- 联系人号码 -->
<Row type="flex" justify="start">
<Col span="20">
<FormItem label="联系电话" prop="contactNumber">
<Input type="text" v-model="formItem.contactNumber"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="位置" prop="officeLocation">
<AutoComplete
v-model="formItem.officeLocation"
placeholder="请输入位置"
@on-search="officeLocationSearch"
>
<option class="location"
@click="locationChange(item)"
:value="item"
v-for="item in officeLocations"
:key="item"
>{{item}}</option>
</AutoComplete>
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="优先级">
<Select
v-model="formItem.priority"
style="text-align: left"
placeholder="请选择优先级"
>
<Option
v-for="(item,index) in priorityList"
:value="item.value"
:key="index"
style="text-align: left;"
>{{item.name}}</Option>
</Select>
</FormItem>
</Col>
</Row>
<!--<p slot="title">工单详情</p>-->
<div slot="title">
<!--工具栏-->
<Button
:disabled="workOrder.state === '待评价' ? true : workOrder.state === '已评价' ? true : !auth.tf_repair_problem_edit"
type="primary" @click="submit">
提交修改
</Button>
<Button
:disabled="workOrder.state === '待评价' ? true : workOrder.state === '已评价' ? true : !auth.tf_repair_problem_add_user"
type="primary" style="margin-left: 10px" @click="openChangeUserModal">
{{ workOrder.state == "待维修" ? '变更执行人' : '派单' }}
</Button>
<Button
:disabled="workOrder.state === '待评价' ? true : workOrder.state === '已评价' ? true : !auth.tf_repair_problem_complete"
type="primary" style="margin-left: 10px" @click="openCompleteModal">
完成工单
</Button>
<Button type="primary" style="margin-left: 10px" @click="openRemarkModal">
备注
</Button>
<Button style="margin-left: 10px" @click="goBack">
返回
</Button>
</div>
<!-- 编辑工单 -->
<Row :gutter="20">
<Col span="10">
<Card>
<p slot="title">单号: <span>{{ workOrder.workOrderNo }}</span><span style="margin-left: 10px">
<Tag color="blue">{{ workOrder.state }}</Tag>
</span></p>
<Form ref="kfxx" :model="formItem" :label-width="120" :rules="ruleValidate">
<Row type="flex" justify="start">
<Col span="20">
<FormItem label="报修人">
<Select v-model="custQuery" filterable ref="callidselect" remote :remote-method="custSearch"
icon="search" :blur="callIDblur" @on-change="custChange" :maxlength="20"
placeholder="客户姓名 / 手机号 / 座机 / 内线号码 ">
<Option v-for="(option, index) in callIDOptions" :value="option.name" :key="index"
:label="option.label">{{ option.name }}</Option>
</Select>
</FormItem>
</Col>
<Col span="4">
<div style="margin-top: 1px"><Button icon="plus-round" @click="handleAddCust"></Button></div>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="代报修" style="width: 100%;text-align: left;" prop="replacementRepair">
<RadioGroup v-model="formItem.replacementRepair">
<Radio label="1">
<span></span>
</Radio>
<Radio label="0">
<span></span>
</Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
<!-- 联系人姓名 -->
<Row type="flex" justify="start">
<Col span="20">
<FormItem label="联系人" prop="contactName">
<Input type="text" v-model="formItem.contactName"
:disabled="formItem.replacementRepair === '1' ? false : true"
v-show="formItem.replacementRepair !== '1'"></Input>
<Select v-model="formItem.contactClient" filterable ref="contactSelect" remote
:remote-method="contactCustSearch" icon="search" @on-change="contactCustChange" :maxlength="20"
placeholder="客户姓名 / 手机号 / 座机 / 内线号码 " :disabled="formItem.replacementRepair === '1' ? false : true"
v-show="formItem.replacementRepair === '1'">
<Option v-for="(option, index) in contactOptions" :value="option.name" :key="index"
:label="option.label">{{ option.name }}</Option>
</Select>
</FormItem>
</Col>
<Col span="4">
<div style="margin-top: 1px"><Button icon="plus-round" @click="handleAddCust"
v-show="formItem.replacementRepair === '1'"></Button></div>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="工单来源">
<Input type="text" disabled v-model="formItem.dataSourceName"></Input>
</FormItem>
</Col>
</Row>
<!-- 联系人号码 -->
<Row type="flex" justify="start">
<Col span="20">
<FormItem label="联系电话" prop="contactNumber">
<Input type="text" v-model="formItem.contactNumber"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="位置" prop="officeLocation">
<AutoComplete v-model="formItem.officeLocation" placeholder="请输入位置" @on-search="officeLocationSearch">
<option class="location" @click="locationChange(item)" :value="item" v-for="item in officeLocations"
:key="item">{{ item }}</option>
</AutoComplete>
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="优先级">
<Select v-model="formItem.priority" style="text-align: left" placeholder="请选择优先级">
<Option v-for="(item, index) in priorityList" :value="item.value" :key="index"
style="text-align: left;">{{ item.name }}</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row type="flex" justify="start">
<Col span="12">
<FormItem
label="预约单"
prop="reservation_type"
style="width: 100%;text-align: left;"
>
<Row type="flex" justify="start">
<Col span="12">
<FormItem label="预约单" prop="reservation_type" style="width: 100%;text-align: left;">
<RadioGroup v-model="formItem.reservations" @on-change="reservationChange">
<Radio label="1"><span></span></Radio>
<Radio label="0"><span></span></Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
<Row v-show="isReservation">
<Col span="12" style="margin-right:10px;">
<FormItem
label="预约时间"
prop="appointmentTime"
style="width: 100%;text-align: left;"
>
<DatePicker
type="datetime"
@on-change="changeDate"
v-model="formItem.appointmentTime"
placeholder="选择预约时间"
style="width: 180px"
></DatePicker>
</Col>
</Row>
<Row v-show="isReservation">
<Col span="12" style="margin-right:10px;">
<FormItem label="预约时间" prop="appointmentTime" style="width: 100%;text-align: left;">
<DatePicker type="datetime" @on-change="changeDate" v-model="formItem.appointmentTime"
placeholder="选择预约时间" style="width: 180px"></DatePicker>
</FormItem>
</Col>
</Row>
<Row>
<Col span="12">
</Col>
</Row>
<Row>
<Col span="12">
<FormItem label="报修类型" prop="one_type">
<Select
v-model="formItem.problemClass"
@on-change="getProblemList"
style="text-align: left"
>
<Option
v-for="(item,index) in treeList"
:value="item.parentProblem"
:key="index"
style="text-align: left;"
>{{ item.parentProblem}}</Option>
<Select v-model="formItem.problemClass" @on-change="getProblemList" style="text-align: left">
<Option v-for="(item, index) in parentList" :value="item.parentProblem" :key="item.parentId"
style="text-align: left;">{{ item.parentProblem }}</Option>
</Select>
</FormItem>
</Col>
</Col>
<Col span="7">
<Col span="7">
<FormItem :label-width="5">
<Select
v-model="formItem.problemType"
@on-change="getQuestionList"
style="text-align: left"
>
<Option
v-for="(item,i) in problemTypeList"
:value="item.problem"
:key="i"
style="text-align: left;"
>{{ item.problem}}</Option>
<Select v-model="formItem.problemType" @on-change="getQuestionList" style="text-align: left">
<Option v-for="(item, i) in sublevelList" :value="item.problem" :key="item.id"
style="text-align: left;">
{{ item.problem }}</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="问题项" style="text-align:left">
<CheckboxGroup v-model="formItem.problem" @on-change="checkProblem">
<Checkbox :key="index" :label="item.problem" v-for="(item,index) in questionList"><span>{{item.problem}}</span></Checkbox>
<Checkbox :key="index" :label="item.problem" v-for="(item, index) in questionList">
<span>{{ item.problem }}</span>
</Checkbox>
<Checkbox key="other" label="其他"><span>其他</span></Checkbox>
</CheckboxGroup>
</FormItem>
</Col>
</Row>
<Row v-show="isOtherProblem">
<Col span="20">
<FormItem
label="其他问题项"
prop="otherProblem"
>
<Input
type="text"
v-model="formItem.otherProblem"
placeholder="请简短描述"
></Input>
</Col>
</Row>
<Row v-show="isOtherProblem">
<Col span="20">
<FormItem label="其他问题项" prop="otherProblem">
<Input type="text" v-model="formItem.otherProblem" placeholder="请简短描述"></Input>
</FormItem>
</Col>
</Row>
<Row style="margin-bottom:30px;">
<Col span="24">
</Col>
</Row>
<Row style="margin-bottom:30px;">
<Col span="24">
<FormItem label="图片描述">
<Modal
title="图片查看"
v-model="visible"
:closable="true"
:mask-closable="false"
>
<Modal title="图片查看" v-model="visible" :closable="true" :mask-closable="false">
<img :src="imgList[showImg]" v-if="visible" style="width: 100%" />
</Modal>
<div
class="addimg demo-upload-list"
:style="{'left':(index)*63+'px'}"
v-for="(item,index) in imgList"
:key="index"
>
<img
:src="item"
alt
v-if="item!=''"
style="pointer-events: all"
@click="handleView(index)"
/>
<div class="demo-upload-list-cover" v-if="item!=''">
<Icon type="ios-eye-outline" @click.native="handleView(index)" style="font-size: 20px;" ></Icon>
<div class="addimg demo-upload-list" :style="{ 'left': (index) * 63 + 'px' }"
v-for="(item, index) in imgList" :key="index">
<img :src="item" alt v-if="item != ''" style="pointer-events: all" @click="handleView(index)" />
<div class="demo-upload-list-cover" v-if="item != ''">
<Icon type="ios-eye-outline" @click.native="handleView(index)" style="font-size: 20px;"></Icon>
<Icon type="ios-trash-outline" @click.native="handleRemove(index)" style="font-size: 20px;"></Icon>
</div>
</div>
<div class="addimg demo-upload-list" :style="{'left':imgList.length*63+'px'}">
<i class="ivu-icon ivu-icon-ios-plus-empty"
@click="uploadImg()"
></i>
<div class="addimg demo-upload-list" :style="{ 'left': imgList.length * 63 + 'px' }">
<i class="ivu-icon ivu-icon-ios-plus-empty" @click="uploadImg()"></i>
</div>
</FormItem>
</Col>
<input
type="file"
name
id="uploadImg"
style="display:none;"
@change="changeImg"
/>
</Row>
<Row>
<Col span="24">
</Col>
<input type="file" name id="uploadImg" style="display:none;" @change="changeImg" />
</Row>
<Row>
<Col span="24">
<FormItem label="备注">
<Input
type="textarea"
:rows="3"
v-model="formItem.remark"
placeholder="300字以内"
></Input>
<Input type="textarea" :rows="3" v-model="formItem.remark" placeholder="300字以内"></Input>
</FormItem>
</Col>
</Row>
</Form>
</Card>
</Col>
<Col span="14">
<Tabs type = 'card' @on-click="clientRepairList" v-model="activeTab">
</Col>
</Row>
</Form>
</Card>
</Col>
<Col span="14">
<Tabs type='card' @on-click="clientRepairList" v-model="activeTab">
<TabPane label="报修详情">
<Collapse v-model="openPanel">
<Collapse v-model="openPanel">
<Panel>
报修人
<div slot="content">
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">姓名:</label><div style="display: inline-block">{{formItem.name}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">姓名:</label>
<div style="display: inline-block">{{ formItem.name }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div style="color: red"><label style="text-align: right;padding: 10px 12px 10px 0;">职务:</label><div style="display: inline-block">{{formItem.jobTitle}}</div></div>
<div style="color: red"><label style="text-align: right;padding: 10px 12px 10px 0;">职务:</label>
<div style="display: inline-block">{{ formItem.jobTitle }}</div>
</div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">公司:</label><div style="display: inline-block">{{formItem.companyName}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">公司:</label>
<div style="display: inline-block">{{ formItem.companyName }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">部门:</label><div style="display: inline-block">{{formItem.deptName}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">部门:</label>
<div style="display: inline-block">{{ formItem.deptName }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">手机:</label><div style="display: inline-block">{{formItem.phone}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">手机:</label>
<div style="display: inline-block">{{ formItem.phone }}</div>
</div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black;">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">内线:</label><div style="display: inline-block">{{formItem.undef}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">内线:</label>
<div style="display: inline-block">{{ formItem.undef }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">座机:</label><div style="display: inline-block">{{formItem.tel}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">座机:</label>
<div style="display: inline-block">{{ formItem.tel }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">性别:</label><div style="display: inline-block">{{formItem.sex}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">性别:</label>
<div style="display: inline-block">{{ formItem.sex }}</div>
</div>
</Col>
</Row>
</div>
</Panel>
<Panel v-show="formItem.replacementRepair=='1'">
<Panel v-show="formItem.replacementRepair == '1'">
联系人
<div slot="content">
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">姓名:</label><div style="display: inline-block">{{formItem.contactName}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">姓名:</label>
<div style="display: inline-block">{{ formItem.contactName }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div style="color: red"><label style="text-align: right;padding: 10px 12px 10px 0;">职务:</label><div style="display: inline-block">{{formItem.contactJobTitle}}</div></div>
<div style="color: red"><label style="text-align: right;padding: 10px 12px 10px 0;">职务:</label>
<div style="display: inline-block">{{ formItem.contactJobTitle }}</div>
</div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">公司:</label><div style="display: inline-block">{{formItem.contactCompanyName}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">公司:</label>
<div style="display: inline-block">{{ formItem.contactCompanyName }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">部门:</label><div style="display: inline-block">{{formItem.contactDeptName}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">部门:</label>
<div style="display: inline-block">{{ formItem.contactDeptName }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">手机:</label><div style="display: inline-block">{{formItem.contactPhone}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">手机:</label>
<div style="display: inline-block">{{ formItem.contactPhone }}</div>
</div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black;">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">内线:</label><div style="display: inline-block">{{formItem.contactUndef}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">内线:</label>
<div style="display: inline-block">{{ formItem.contactUndef }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">座机:</label><div style="display: inline-block">{{formItem.contactTel}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">座机:</label>
<div style="display: inline-block">{{ formItem.contactTel }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">性别:</label><div style="display: inline-block">{{formItem.contactSex}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">性别:</label>
<div style="display: inline-block">{{ formItem.contactSex }}</div>
</div>
</Col>
</Row>
</div>
......@@ -377,10 +323,75 @@
<div slot="content">
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">执行人:</label><div style="display: inline-block">{{formItem.userName}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">执行人:</label>
<div style="display: inline-block">{{ formItem.userName }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">参与者:</label>
<div style="display: inline-block">{{ formItem.participators }}</div>
</div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="24" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">解决方法标签:</label>
<div class="solveTabs" style="display: inline-block" v-for="(item, index) in formItem.repairLabel"
:key="index">
{{ item }}
</div>
</div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="24" style="padding: 16px">
<div style="display: flex;">
<label
style="text-align: right;padding: 10px 12px 10px 0;width: 80px;flex-shrink: 0;">验收图片:</label>
<div class="verificationImgList">
<img class="verificationImg" v-for="item in formItem.repairImgs" :src="item" alt=""
@click="getImg(item)">
</div>
<Modal title="View Image" v-model="visible">
<img :src="imgUrl" v-if="visible" style="width: 100%">
</Modal>
</div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="24" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">备注:</label>
<div style="display: inline-block">{{ formItem.finishRemark }}</div>
</div>
</Col>
</Row>
</div>
</Panel>
<Panel>
用户评价
<div slot="content">
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">参与者:</label><div style="display: inline-block">{{formItem.participators}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">评价星级:</label>
<div style="display: inline-block">
<Rate disabled v-model="formItem.repairEstimate.star"></Rate>
</div>
</div>
</Col>
<Col span="16" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">评价标签:</label>
<div class="solveTabs" style="display: inline-block"
v-for="(item, index) in formItem.estimateLabel" :key="index">
{{ item }}
</div>
</div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="24" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">评价内容:</label>
<div style="display: inline-block">{{ formItem.repairEstimate.remark }}</div>
</div>
</Col>
</Row>
</div>
......@@ -390,15 +401,21 @@
<div slot="content">
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">报修来源:</label><div style="display: inline-block">{{formItem.repairSource}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">报修来源:</label>
<div style="display: inline-block">{{ formItem.repairSource }}</div>
</div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">创建时间:</label><div style="display: inline-block">{{workOrder.gmtCreate}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">创建时间:</label>
<div style="display: inline-block">{{ workOrder.gmtCreate }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">最后修改时间:</label><div style="display: inline-block">{{workOrder.gmtModified}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">最后修改时间:</label>
<div style="display: inline-block">{{ workOrder.gmtModified }}</div>
</div>
</Col>
</Row>
</div>
......@@ -409,343 +426,207 @@
<div class="tabBox" style="background-color:white;border:1px solid #dddee1;border-top:none;padding:10px;">
<Row :gutter="10" style="margin:0px 10px;">
<Col span="24" style="margin:20px 0px 0px;">
<template>
<Timeline style="text-align:left">
<TimelineItem
v-for="(item,index) in recordEntityList"
:color="item.state?'#2d8cf0':'#2c3e50'"
:style="{color:item.state?'#2d8cf0':''}"
:key="index"
>
<p class="time">{{item.gmtCreate}}</p>
<p class="content">{{item.subject}}</p>
<p class="content">{{item.title}}</p>
<div style="max-height: 110px;">
<div
style="display:inline-block;width:80px;height:70px;overflow:hidden;margin: 0 10px;"
v-for="(item1,index1) in item.progress_img"
:key="index1"
>
<img
style="width:80px;height:80px"
:src="item1"
alt
v-if="item1!=''"
@click="showtheimg1(item1,index,index1)"
/>
</div>
<template>
<Timeline style="text-align:left">
<TimelineItem v-for="(item, index) in recordEntityList" :color="item.state ? '#2d8cf0' : '#2c3e50'"
:style="{ color: item.state ? '#2d8cf0' : '' }" :key="index">
<p class="time">{{ item.gmtCreate }}</p>
<p class="content">{{ item.subject }}</p>
<p class="content">{{ item.title }}</p>
<div style="max-height: 110px;">
<div style="display:inline-block;width:80px;height:70px;overflow:hidden;margin: 0 10px;"
v-for="(item1, index1) in item.progress_img" :key="index1">
<img style="width:80px;height:80px" :src="item1" alt v-if="item1 != ''"
@click="showtheimg1(item1, index, index1)" />
</div>
</TimelineItem>
<Modal title="图片查看" v-model="visible1" :closable="false">
<img :src="progressary[showimg1]" v-if="visible1" style="width: 100%" />
</Modal>
</Timeline>
</template>
<!-- </Card> -->
</div>
</TimelineItem>
<Modal title="图片查看" v-model="visible1" :closable="false">
<img :src="progressary[showimg1]" v-if="visible1" style="width: 100%" />
</Modal>
</Timeline>
</template>
<!-- </Card> -->
</Col>
</Row>
</div>
</TabPane>
<TabPane label="历史报修">
<div style="background-color:white;border:1px solid #dddee1;border-top:none;padding:10px;">
<m-table :config="tableConfig" :searchParams="repairHistoryForm" ref="repairHistoryTable" :isFirst="isFirst"></m-table>
<m-table :config="tableConfig" :searchParams="repairHistoryForm" ref="repairHistoryTable"
:isFirst="isFirst"></m-table>
</div>
</TabPane>
</Tabs>
</Col>
</Row>
</Card>
<!-- 派单 -->
<Modal
v-model="changeUserModal"
:title="workOrder.state=='待维修'?'变更执行人':'派单信息'"
width="500"
@on-ok="changeUserSumbit"
@on-cancel="changeUserModal=false"
>
<Form :model="dispatchItem" :label-width="80" :rules="ruleValidate">
<Row type="flex" style="margin-top:20px;margin-bottom:20px" justify="start">
<Col span="20">
</Col>
</Row>
</Card>
<!-- 派单 -->
<Modal v-model="changeUserModal" :title="workOrder.state == '待维修' ? '变更执行人' : '派单信息'" width="500"
@on-ok="changeUserSumbit" @on-cancel="changeUserModal = false">
<Form :model="dispatchItem" :label-width="80" :rules="ruleValidate">
<Row type="flex" style="margin-top:20px;margin-bottom:20px" justify="start">
<Col span="20">
<FormItem label="执行人" prop="executor">
<Select
:v-model="dispatchItem.userName"
filterable
@on-change="changeUser"
placeholder="请选择执行人"
>
<Option
v-for="(item, index) in userlist"
:label="item.name"
:value="index"
:key="index"
>
<span
style="float: left;max-width: 120px;min-width: 120px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"
>{{item.name}}</span>
<span>{{item.problemNum==null?0:item.problemNum}}单</span>
<Select :v-model="dispatchItem.userName" filterable @on-change="changeUser" placeholder="请选择执行人">
<Option v-for="(item, index) in userlist" :label="item.name" :value="index" :key="index">
<span
style="float: left;max-width: 120px;min-width: 120px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">{{
item.name
}}</span>
<span>{{ item.problemNum == null ? 0 : item.problemNum }}单</span>
</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row style="margin:20px 0px">
<Col span="20">
</Col>
</Row>
<Row style="margin:20px 0px">
<Col span="20">
<FormItem label="参与者">
<Select v-model="dispatchItem.participatorids" multiple style="width:100%;">
<Option
:value="item.id"
:label="item.name"
v-for="(item,index) in userlist"
:key="index"
>
<span
style="float: left;max-width: 120px;min-width: 120px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"
>{{item.name}}</span>
<span>{{item.problemNum==null?0:item.problemNum}}单</span>
<Option :value="item.id" :label="item.name" v-for="(item, index) in userlist" :key="index">
<span
style="float: left;max-width: 120px;min-width: 120px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">{{
item.name
}}</span>
<span>{{ item.problemNum == null ? 0 : item.problemNum }}单</span>
</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row v-if="workOrder.state=='待维修'">
<Col span="20">
</Col>
</Row>
<Row v-if="workOrder.state == '待维修'">
<Col span="20">
<FormItem label="变更说明">
<Input
v-model="dispatchItem.changeDescription"
type="textarea"
:autosize="{minRows: 4,maxRows: 5}"
placeholder="请输入备注信息"
></Input>
<Input v-model="dispatchItem.changeDescription" type="textarea" :autosize="{ minRows: 4, maxRows: 5 }"
placeholder="请输入备注信息"></Input>
</FormItem>
</Col>
</Row>
</Form>
</Modal>
<!--完成工单确认-->
<Modal v-model="completeModal" width="300" title="提示">
<p id="note-info">确认完成工单?</p>
<div slot="footer" style="text-align:center;margin:0 auto;">
<Button type="ghost" size="default" @click="completeModal=false">取消</Button>
<Button type="primary" size="default" @click="complete()">确定</Button>
</div>
</Modal>
<!-- 备注 -->
<Modal
v-model="remarkModal"
width="800"
title="备注"
@on-ok="remarkCommit"
@on-cancel="remarkModal = false"
>
<Form :model="remarkForm" :label-width="80">
<Row>
<Col span="24" style="margin:15px 0">
</Col>
</Row>
</Form>
</Modal>
<!--完成工单确认-->
<Modal v-model="completeModal" width="300" title="提示">
<p id="note-info">确认完成工单?</p>
<div slot="footer" style="text-align:center;margin:0 auto;">
<Button type="ghost" size="default" @click="completeModal = false">取消</Button>
<Button type="primary" size="default" @click="complete()">确定</Button>
</div>
</Modal>
<!-- 备注 -->
<Modal v-model="remarkModal" width="800" title="备注" @on-ok="remarkCommit" @on-cancel="remarkModal = false">
<Form :model="remarkForm" :label-width="80">
<Row>
<Col span="24" style="margin:15px 0">
<FormItem label="图片描述">
<Modal
title="图片查看"
v-model="visibleRemarkImg"
:closable="true"
:mask-closable="false"
>
<Modal title="图片查看" v-model="visibleRemarkImg" :closable="true" :mask-closable="false">
<img :src="remarkImgList[showRemarkImg]" v-if="visibleRemarkImg" style="width: 100%" />
</Modal>
<div
class="addimg demo-upload-list"
:style="{'left':(index)*63+'px'}"
v-for="(item,index) in remarkImgList"
:key="index"
>
<img
:src="item"
alt
v-if="item!=''"
style="pointer-events: all"
/>
<div class="demo-upload-list-cover" v-if="item!=''">
<Icon type="ios-trash-outline" @click.native="handleRemoveRemarkImg(index)" style="font-size: 20px;"></Icon>
<div class="addimg demo-upload-list" :style="{ 'left': (index) * 63 + 'px' }"
v-for="(item, index) in remarkImgList" :key="index">
<img :src="item" alt v-if="item != ''" style="pointer-events: all" />
<div class="demo-upload-list-cover" v-if="item != ''">
<Icon type="ios-trash-outline" @click.native="handleRemoveRemarkImg(index)" style="font-size: 20px;">
</Icon>
</div>
</div>
<div class="addimg demo-upload-list" :style="{'left':remarkImgList.length*63+'px'}">
<i class="ivu-icon ivu-icon-ios-plus-empty"
@click="uploadRemarkImg()"
></i>
<div class="addimg demo-upload-list" :style="{ 'left': remarkImgList.length * 63 + 'px' }">
<i class="ivu-icon ivu-icon-ios-plus-empty" @click="uploadRemarkImg()"></i>
</div>
</FormItem>
<input type="file" name id="uploadRemarkImg" style="display:none;" @change="changeRemarkImg" />
</Col>
<Col span="20">
</Col>
<Col span="20">
<FormItem label="备注">
<Input
v-model="remarkForm.remark"
type="textarea"
:autosize="{minRows: 4,maxRows: 5}"
placeholder="请输入备注信息"
></Input>
<Input v-model="remarkForm.remark" type="textarea" :autosize="{ minRows: 4, maxRows: 5 }"
placeholder="请输入备注信息"></Input>
</FormItem>
</Col>
</Row>
</Form>
<div slot="footer" style="text-align:right;">
<Row>
<Col span="24">
</Col>
</Row>
</Form>
<div slot="footer" style="text-align:right;">
<Row>
<Col span="24">
<Button size="default" @click="remarkModal = false">取消</Button>
<Button type="primary" size="default" @click="remarkCommit" :loading="modal_loading">确定</Button>
</Col>
</Row>
</div>
</Modal>
</Col>
</Row>
</div>
</Modal>
<!-- 客户新增 -->
<Modal
v-model="addCustModal"
title="客户新增"
@on-ok="addCustSumbit"
:loading="addCustLoading"
>
<Form
ref="addCustRef"
:model="addCustForm"
:label-width="100"
:rules="addCustRule"
>
<Modal v-model="addCustModal" title="客户新增" @on-ok="addCustSumbit" :loading="addCustLoading">
<Form ref="addCustRef" :model="addCustForm" :label-width="100" :rules="addCustRule">
<Row>
<Col span="16">
<FormItem
label="公司"
prop="companyCode"
>
<Select
v-model="addCustForm.companyCode"
style="text-align: left"
ref="companySelect"
filterable
@on-change="getDept"
clearable
>
<Option
v-for="item in companyList"
:value="item.groupNo"
:key="item.groupNo"
style="text-align: left;"
>{{ item.groupName}}</Option>
<!-- <Option value="">硬件问题</Option>
<FormItem label="公司" prop="companyCode">
<Select v-model="addCustForm.companyCode" style="text-align: left" ref="companySelect" filterable
@on-change="getDept" clearable>
<Option v-for="item in companyList" :value="item.groupNo" :key="item.groupNo" style="text-align: left;">{{
item.groupName
}}</Option>
<!-- <Option value="">硬件问题</Option>
<Option value="-1">软件问题</Option>-->
</Select>
</FormItem>
</Select>
</FormItem>
</Col>
<Col span="16">
<FormItem
label="部门"
prop="deptCode"
>
<Select
v-model="addCustForm.deptCode"
style="text-align: left"
ref="deptSelect"
filterable
clearable
>
<Option
v-for="item in deptList"
:value="item.groupNo"
:key="item.groupNo"
style="text-align: left;"
>{{ item.groupName}}</Option>
<!-- <Option value="">硬件问题</Option>
<FormItem label="部门" prop="deptCode">
<Select v-model="addCustForm.deptCode" style="text-align: left" ref="deptSelect" filterable clearable>
<Option v-for="item in deptList" :value="item.groupNo" :key="item.groupNo" style="text-align: left;">{{
item.groupName
}}</Option>
<!-- <Option value="">硬件问题</Option>
<Option value="-1">软件问题</Option>-->
</Select>
</FormItem>
</Select>
</FormItem>
</Col>
<Col span="16">
<FormItem
label="姓名"
prop="name"
>
<Input
v-model="addCustForm.name"
:maxlength="20"
placeholder="请输入姓名"
></Input>
</FormItem>
<FormItem label="姓名" prop="name">
<Input v-model="addCustForm.name" :maxlength="20" placeholder="请输入姓名"></Input>
</FormItem>
</Col>
<Col span="16">
<FormItem
label="优先级"
prop="priority"
>
<Select
v-model="addCustForm.priority"
placeholder="请选择优先级"
>
<Option
v-for="(item,index) in priority"
:value="item.value"
:key="index"
>{{item.name}}</Option>
<!-- <Option value="待派单">高</Option>
<FormItem label="优先级" prop="priority">
<Select v-model="addCustForm.priority" placeholder="请选择优先级">
<Option v-for="(item, index) in priority" :value="item.value" :key="index">{{ item.name }}</Option>
<!-- <Option value="待派单">高</Option>
<Option value="待维修">很高</Option> -->
</Select>
</FormItem>
</Select>
</FormItem>
</Col>
<Col span="16">
<FormItem
label="手机号"
prop="phone"
>
<Input
v-model="addCustForm.phone"
:maxlength="20"
placeholder="请输入手机号"
></Input>
</FormItem>
<FormItem label="手机号" prop="phone">
<Input v-model="addCustForm.phone" :maxlength="20" placeholder="请输入手机号"></Input>
</FormItem>
</Col>
<Col span="16">
<FormItem
label="座机"
prop="tel"
>
<Input
v-model="addCustForm.tel"
:maxlength="12"
placeholder="请输入座机号码"
></Input>
</FormItem>
<FormItem label="座机" prop="tel">
<Input v-model="addCustForm.tel" :maxlength="12" placeholder="请输入座机号码"></Input>
</FormItem>
</Col>
<Col span="16">
<FormItem
label="内线号码"
prop="undef"
>
<Input
v-model="addCustForm.undef"
:maxlength="12"
placeholder="请输入内线号码"
></Input>
</FormItem>
<FormItem label="内线号码" prop="undef">
<Input v-model="addCustForm.undef" :maxlength="12" placeholder="请输入内线号码"></Input>
</FormItem>
</Col>
<Col span="16">
<FormItem label="位置">
<Input
v-model="addCustForm.officeLocation"
:maxlength="30"
placeholder="请输入位置"
></Input>
</FormItem>
<FormItem label="位置">
<Input v-model="addCustForm.officeLocation" :maxlength="30" placeholder="请输入位置"></Input>
</FormItem>
</Col>
<Col span="16">
<FormItem label="性别">
<RadioGroup
v-model="addCustForm.sex"
>
<Radio label="男">
<span></span>
</Radio>
<Radio label="女">
<span></span>
</Radio>
</RadioGroup>
</FormItem>
<FormItem label="性别">
<RadioGroup v-model="addCustForm.sex">
<Radio label="男">
<span></span>
</Radio>
<Radio label="女">
<span></span>
</Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
</Form>
......@@ -759,10 +640,11 @@ import util from "@/assets/js/util";
import { validateMobile, validateNumber } from "@/assets/js/validate";
import { initCustSearchOption, getCustOrgInfo, getCustSex, getCustContactNumber } from "@/utils/workOrder"
import Bus from "@/bus";
import { async } from "q";
export default {
name: 'workOrderEdit',
data() {
data () {
return {
isOtherProblem: false,
companyList: [],
......@@ -784,8 +666,8 @@ export default {
{
message: "请输入正确的手机号",
trigger: "blur",
transform(value) {
var reg= /^[1][3,4,5,7,8,9][0-9]{9}$/;
transform (value) {
var reg = /^[1][3,4,5,7,8,9][0-9]{9}$/;
if (!value) {
return value;
} else if (!reg.test(value)) {
......@@ -800,7 +682,7 @@ export default {
{
message: "请输入正确的座机号码",
trigger: "blur",
transform(value) {
transform (value) {
if (!value) return '';
var reg = /[0-9\-]/;
// var reg=/0\d{2,3}\-\d{7,8}/
......@@ -816,7 +698,7 @@ export default {
{
message: "请输入正确的内线号码",
trigger: "blur",
transform(value) {
transform (value) {
if (!value) return '';
var reg = /^\d+$/;
if (!reg.test(value)) {
......@@ -832,7 +714,7 @@ export default {
]
},
priority: [],
openPanel: ['0','1','2','3'],
openPanel: ['0', '1', '2', '3'],
// 派单表单
dispatchItem: {
userId: "",
......@@ -924,8 +806,8 @@ export default {
contactName: [
{ required: true, message: "请填写联系人姓名", trigger: "blur" }
],
replacementRepair:[
{ required: true, }
replacementRepair: [
{ required: true, }
],
reservation_type: [
{ required: true, message: "该选项不能为空", trigger: "blur" }
......@@ -953,7 +835,7 @@ export default {
},
// 设置结束时间大于开始时间
end: {
disabledDate: function(date) {
disabledDate: function (date) {
return date.valueOf() < new Date(this.formItem.startUpdateTime);
}.bind(this)
},
......@@ -992,10 +874,10 @@ export default {
params.row.priority === "一级"
? "error"
: params.row.priority === "二级"
? "warning"
: params.row.priority === "三级"
? "success"
: "info",
? "warning"
: params.row.priority === "三级"
? "success"
: "info",
size: "small"
}
},
......@@ -1072,19 +954,22 @@ export default {
},
repairHistoryForm: {
clientId: ""
}
},
parentList: [],
sublevelList: [],
visible: false,
imgUrl: ''
};
},
mounted() {
mounted () {
// console.log(this.$route.params)
},
created() {
created () {
let self = this
self.firstLoad()
},
beforeCreate() {
beforeCreate () {
this.$request.post(
"/api/user/searchUserProblemNum",
......@@ -1093,10 +978,34 @@ export default {
this.userlist = res.responseResult.list;
this.userlist.sort(util.compare1("problemNum"));
},
res => {}
res => { }
);
},
methods: {
getImg (item) {
this.visible = true;
this.imgUrl = item
},
getTreeList () {
const that = this
this.$request.post(
"/api/emaint/problem-base/getTreeList",
qs.stringify({ dataSource: that.formItem.dataSource }),
async res => {
this.parentList = await res.responseResult.map(item => {
item.parentId = `${item.parentId}`
return item
})
let arr = await res.responseResult.filter(item => item.parentProblem == that.formItem.problemClass)
if (arr.length && arr[0].childList) {
this.sublevelList = arr[0].childList.map(item => {
item.id = `${item.id}`
return item
})
}
}
);
},
firstLoad () {
this.activeTab = 0
this.onCreate = true
......@@ -1104,7 +1013,7 @@ export default {
this.getWorkOrder(orderId)
this.getProblemPriority()
},
getProblemPriority(){
getProblemPriority () {
// 优先级下拉列表
this.$request.post(
"/api/dictionary/optionsByGroupCode",
......@@ -1120,7 +1029,7 @@ export default {
}
);
},
custSearch(query) {
custSearch (query) {
let self = this
if (query !== "") {
this.callIDOptions = [];
......@@ -1132,7 +1041,7 @@ export default {
// callID_list 处理展示数组
this.callIDOptions = [];
let callIDList = res.responseResult.data;
if(callIDList != null && callIDList != undefined){
if (callIDList != null && callIDList != undefined) {
initCustSearchOption(callIDList, query, this.callIDOptions)
}
// 初始化选择项
......@@ -1166,7 +1075,7 @@ export default {
// console.log(this.formItem);
}
},
contactCustSearch(query, type) {
contactCustSearch (query, type) {
if (query !== "") {
this.contactOptions = [];
this.$request.post(
......@@ -1177,8 +1086,8 @@ export default {
// contactList 处理展示数组
this.contactOptions = [];
let contactList = res.responseResult.data;
if(contactList != null && contactList != undefined){
initCustSearchOption(contactList, query, this.contactOptions);
if (contactList != null && contactList != undefined) {
initCustSearchOption(contactList, query, this.contactOptions);
}
},
res => {
......@@ -1188,7 +1097,7 @@ export default {
this.contactOptions = [];
this.formItem.contactClient = "";
this.formItem.contactPhone = "";
this.formItem.contactNumber= "";
this.formItem.contactNumber = "";
this.formItem.contactUndef = "";
this.formItem.contactDeptName = "";
this.formItem.contactJobTitle = "";
......@@ -1199,7 +1108,7 @@ export default {
this.formItem.contactClientId = "";
}
},
handleRemove(index) {
handleRemove (index) {
this.imgFiles.splice(index, 1);
this.imgList.splice(index, 1);
if (this.editImgList[index].indexOf("http") !== -1) {
......@@ -1208,7 +1117,7 @@ export default {
},
handleRemoveRemarkImg(index) {
handleRemoveRemarkImg (index) {
this.remarkImgFiles.splice(index, 1);
this.remarkImgList.splice(index, 1);
},
......@@ -1216,12 +1125,12 @@ export default {
// 位置自动检索
locationChange(value) {
locationChange (value) {
console.log(value, "cv");
this.formItem.officeLocation = value;
},
officeLocationSearch(value, option) {
officeLocationSearch (value, option) {
this.officeLocations = this.officeLocationsBackup.filter(item => {
return (
item
......@@ -1232,7 +1141,7 @@ export default {
});
},
changeImg(e) {
changeImg (e) {
console.log(e);
var file = e.target.files[0];
if (file.type.indexOf("image/") == -1) {
......@@ -1246,13 +1155,13 @@ export default {
var reader = new FileReader();
reader.readAsDataURL(file);
var that = this;
reader.onload = function() {
reader.onload = function () {
that.imgList.push(this.result);
that.imgFiles.push(file);
};
},
changeRemarkImg(e) {
changeRemarkImg (e) {
console.log(e);
var file = e.target.files[0];
if (file.type.indexOf("image/") == -1) {
......@@ -1266,14 +1175,14 @@ export default {
var reader = new FileReader();
reader.readAsDataURL(file);
var that = this;
reader.onload = function() {
reader.onload = function () {
that.remarkImgList.push(this.result);
that.remarkImgFiles.push(file);
};
},
// 加载常见问题
getQuestionList(val) {
getQuestionList (val) {
let self = this;
this.problemTypeList.forEach(v => {
if (v.problem == self.formItem.problemType) {
......@@ -1285,26 +1194,37 @@ export default {
res => {
this.questionList = res.responseResult;
},
res => {}
res => { }
);
}
});
},
// 加载问题项
getProblemList(val) {
this.treeList.forEach(v => {
if (v.parentProblem == this.formItem.problemClass) {
this.problemTypeList = v.childList;
if (val) {
this.formItem.problemType = "";
this.questionList = [];
}
async getProblemList (val) {
if (val) {
this.formItem.problemType = ''
let arr = this.parentList.filter(item => item.parentProblem == val)
if (arr.length && arr[0].childList) {
this.sublevelList = arr[0].childList.map(item => {
item.id = `${item.id}`
return item
})
}
});
}
// this.treeList.forEach(v => {
// if (v.parentProblem == this.formItem.problemClass) {
// this.problemTypeList = v.childList;
// if (val) {
// this.formItem.problemType = "";
// this.questionList = [];
// }
// }
// });
},
// 数组去重
uniq(array) {
uniq (array) {
var temp = []; //一个新的临时数组
for (var i = 0; i < array.length; i++) {
if (temp.indexOf(array[i]) == -1) {
......@@ -1314,7 +1234,7 @@ export default {
return temp;
},
initCustOfficeLocation(clientId, onCreate){
initCustOfficeLocation (clientId, onCreate) {
let self = this
this.$request.post(
......@@ -1326,16 +1246,16 @@ export default {
JSON.stringify(self.officeLocations)
);
console.log(self.officeLocations[0]);
if ( self.officeLocations[0] !== undefined && self.officeLocations[0] !== "undefined" && !onCreate ) {
if (self.officeLocations[0] !== undefined && self.officeLocations[0] !== "undefined" && !onCreate) {
self.formItem.officeLocation = self.officeLocations[0];
}
},
res => {}
res => { }
);
},
// 输入手机号进行检索
custChange(val) {
custChange (val) {
if (!val) return;
// 兼容旧数据,旧数据没有部门
let noDept = false;
......@@ -1344,7 +1264,7 @@ export default {
// console.log('custChange ' + val);
var flag = false;
this.callIDOptions.forEach(obj => {
if ( (obj.name === val || (noDept && obj.name.indexOf(val) !== -1)) && obj.data) {
if ((obj.name === val || (noDept && obj.name.indexOf(val) !== -1)) && obj.data) {
flag = true;
let v = obj.data;
this.formItem.phone = v.phone;
......@@ -1419,9 +1339,9 @@ export default {
this.onCreate = false
},
contactCustChange() {
contactCustChange () {
console.log(this.formItem.contactClient);
if ( !this.formItem.contactClient || this.formItem.contactClient == "undefined" ) {
if (!this.formItem.contactClient || this.formItem.contactClient == "undefined") {
return;
}
var flag = false;
......@@ -1493,7 +1413,7 @@ export default {
},
// 报修提交
submit() {
submit () {
this.modal_loading = true;
this.$Spin.show();
if (this.isok) {
......@@ -1512,7 +1432,7 @@ export default {
} else {
reservationIs = true;
}
if ( this.formItem.problemClass && this.formItem.problemType && reservationIs === true) {
if (this.formItem.problemClass && this.formItem.problemType && reservationIs === true) {
var newarr = [];
this.userlist.forEach(v => {
if (this.formItem.participatorids.indexOf(v.id) != -1) {
......@@ -1522,7 +1442,7 @@ export default {
this.formItem.participatorids = this.formItem.participatorids.toString();
this.formItem.participators = newarr.toString();
if (this.formItem.replacementRepair != "" && this.formItem.replacementRepair != undefined ) {
if (this.formItem.replacementRepair != "" && this.formItem.replacementRepair != undefined) {
this.formItem.replacementRepair = parseInt(
this.formItem.replacementRepair
);
......@@ -1553,7 +1473,7 @@ export default {
if (this.editImgList) {
if (this.editImgList.length > 1) {
data.append("changeProblemImgs", this.editImgList.join('|~|'));
} else if (this.editImgList.length === 1){
} else if (this.editImgList.length === 1) {
data.append("changeProblemImgs", this.editImgList[0]);
}
}
......@@ -1594,11 +1514,11 @@ export default {
}
},
// 上一步
goBack() {
goBack () {
this.$router.go(-1)
},
// 选择文件
uploadImg() {
uploadImg () {
document.querySelector("#uploadImg").click();
},
......@@ -1607,22 +1527,22 @@ export default {
},
// 图片幻灯
handleView(index) {
handleView (index) {
this.showImg = index;
this.visible = true;
},
// 图片幻灯
handleViewRemarkImg(index) {
handleViewRemarkImg (index) {
this.showRemarkImg = index;
this.visibleRemarkImg = true;
},
// 历史报修
clientRepairList(e) {
clientRepairList (e) {
if (e == 0) return;
if (this.repairHistoryForm.clientId == "" || this.repairHistoryForm.clientId == null) {
this.$Message.error("请先输入手机号!");
} else {
this.showRepairHistory= true;
this.showRepairHistory = true;
this.tableConfig.url =
"/api/emaint/repairProblem/clientRepairProblemList";
this.$refs.repairHistoryTable.init();
......@@ -1630,7 +1550,7 @@ export default {
},
//是否预约单
reservationChange(e) {
reservationChange (e) {
if (e == "1") {
this.isReservation = true;
console.log(this.isReservation);
......@@ -1641,11 +1561,11 @@ export default {
}
},
//预约时间
changeDate(e) {
changeDate (e) {
console.log(e);
this.formItem.appointmentTime = e;
},
openChangeUserModal() {
openChangeUserModal () {
this.changeUserModal = true;
if (this.state == "待维修") {
this.dispatchItem.userId = this.formItem.userId;
......@@ -1654,11 +1574,11 @@ export default {
this.dispatchItem.changeDescription = this.formItem.changeDescription;
}
},
openCompleteModal() {
openCompleteModal () {
this.completeModal = true;
},
// 备注按钮
openRemarkModal() {
openRemarkModal () {
this.remarkModal = true;
this.remarkForm = {
id: "",
......@@ -1669,7 +1589,7 @@ export default {
this.remarkForm.id = this.formItem.id;
console.log(this.remarkForm);
},
getProblemBase(callback){
getProblemBase (callback) {
let self = this
this.$request.post(
"/api/emaint/problem-base/treeList",
......@@ -1680,17 +1600,38 @@ export default {
callback()
}
},
res => {}
res => { }
);
},
getWorkOrder(id){
getArrImgs (str, split) {
let newArr = []
if (str.includes(split)) {
let arr = str.split(split)
arr.forEach(item => {
newArr.push(item)
});
} else {
newArr.push(str)
}
return newArr
},
getWorkOrder (id) {
let self = this
this.$request.post(
"/api/emaint/repairProblem/view",
qs.stringify({id: id}),
qs.stringify({ id: id }),
res => {
var data = res.responseResult;
let dataSourceName = ''
if (data.dataSource == '0') {
dataSourceName = '特房集团'
} else if (data.dataSource == '1') {
dataSourceName = '塔楼客户'
} else if (data.dataSource == '2') {
dataSourceName = '轨道集团'
}
self.workOrder = data
data.repairImgs = this.getArrImgs(data.repairImgs, '|~|')
this.formItem = {
id: data.id,
callID: data.callID,
......@@ -1710,17 +1651,18 @@ export default {
problemClass: data.problemClass,
problemType: data.problemType,
remark: data.remark,
participatorids: !data.participatorids?[]:data.participatorids.split(","),
participatorids: !data.participatorids ? [] : data.participatorids.split(","),
userName: data.userName,
userId: data.userId,
problem: !data.problem?[]:data.problem.split(','),
problem: !data.problem ? [] : data.problem.split(','),
changeDescription: data.changeDescription,
problemImgs: data.problemImgs,
participators: data.participators,
replacementRepair: data.replacementRepair + '',
appointmentTime: data.appointmentTime,
reservations: data.reservations? data.reservations + '' : '0',
reservations: data.reservations ? data.reservations + '' : '0',
dataSource: data.dataSource,
dataSourceName: dataSourceName,
contactClientId: data.contactClientId,
contactName: data.contactName,
contactPhone: data.contactPhone,
......@@ -1732,8 +1674,13 @@ export default {
contactSex: data.contactSex,
contactTel: data.contactTel,
contactUndef: data.contactUndef,
repairLabel: data.repairLabel,
finishRemark: data.finishRemark,
repairEstimate: data.repairEstimate,
estimateLabel: data.estimateLabel,
repairImgs: data.repairImgs
};
this.getTreeList()
// 历史报修
this.repairHistoryForm.clientId = this.formItem.contactClientId;
......@@ -1821,12 +1768,12 @@ export default {
let custName = data.name;
let contactCustName = data.contactName;
self.$nextTick(() => {
if(custName != null){
self.$refs["callidselect"].query = custName
}
if (contactCustName != null) {
self.$refs["contactSelect"].query = contactCustName
}
if (custName != null) {
self.$refs["callidselect"].query = custName
}
if (contactCustName != null) {
self.$refs["contactSelect"].query = contactCustName
}
var transfer = document.getElementsByClassName(
"ivu-select-dropdown"
)[1];
......@@ -1854,21 +1801,21 @@ export default {
);
},
// 进度图片
showtheimg1(item, index, index1) {
showtheimg1 (item, index, index1) {
this.showimg1 = index1;
this.visible1 = true;
this.progressary = this.recordEntityList[index].progress_img;
},
changeUser(val) {
changeUser (val) {
let self = this
self.userlist.map((item,index) => {
if(index === val){
self.userlist.map((item, index) => {
if (index === val) {
self.dispatchItem.userName = item.name
self.dispatchItem.userId = item.id
}
})
},
complete(){
complete () {
this.completeModal = false;
this.modal_loading = true;
if (this.isok) {
......@@ -1878,7 +1825,7 @@ export default {
this.isok = true;
let headers = { headers: { "Content-Type": "multipart/form-data" } }; //修改成文件上传的请求头
axios
.post("/api/emaint/repairProblem/complete?id=" + this.formItem.id , headers)
.post("/api/emaint/repairProblem/complete?id=" + this.formItem.id, headers)
.then(
resdata => {
if (resdata.data.statusCode == 200) {
......@@ -1910,7 +1857,7 @@ export default {
);
},
remarkCommit(){
remarkCommit () {
console.log(this.remarkImgFiles);
this.modal_loading = true;
if (this.isok) {
......@@ -1937,7 +1884,7 @@ export default {
title: "提示信息",
content: res.data.responseResult
});
// this.getinfo(); //备注提交
// this.getinfo(); //备注提交
this.isok = false;
this.$Spin.hide();
},
......@@ -1957,7 +1904,7 @@ export default {
},
// 执行人变更
changeUserSumbit(){
changeUserSumbit () {
if (this.isok) {
return;
......@@ -1967,31 +1914,31 @@ export default {
// this.modal_loading=true
if (this.dispatchItem.userId != "" && this.dispatchItem.userId != null) {
// if (this.formItem.userId != this.dispatchItem.userId) {
var participatorids = "";
participatorids =
this.dispatchItem.participatorids == null
? ""
: this.dispatchItem.participatorids.toString();
this.$request.post(
"/api/emaint/repairProblem/updateUser",
qs.stringify({
id: this.formItem.id,
userId: this.dispatchItem.userId,
participatorids: participatorids,
changeDescription: this.dispatchItem.changeDescription
}),
res => {
this.isok = false;
this.$Message.success(res.responseResult);
this.$Spin.hide();
setTimeout(() => {
this.$router.push({ name: "order_list" });
}, 1000);
},
res => {
this.$Spin.hide();
}
);
var participatorids = "";
participatorids =
this.dispatchItem.participatorids == null
? ""
: this.dispatchItem.participatorids.toString();
this.$request.post(
"/api/emaint/repairProblem/updateUser",
qs.stringify({
id: this.formItem.id,
userId: this.dispatchItem.userId,
participatorids: participatorids,
changeDescription: this.dispatchItem.changeDescription
}),
res => {
this.isok = false;
this.$Message.success(res.responseResult);
this.$Spin.hide();
setTimeout(() => {
this.$router.push({ name: "order_list" });
}, 1000);
},
res => {
this.$Spin.hide();
}
);
// } else {
// this.isok = false;
// this.$Message.error("请变更执行人");
......@@ -2002,21 +1949,21 @@ export default {
this.$Spin.hide();
}
},
handleAddCust(){
handleAddCust () {
this.$refs.addCustRef.resetFields();
this.addCustModal = true;
let query = this.$refs["callidselect"].query
if (validateMobile(query)) {
this.addCustForm.phone = query;
} else if(validateNumber(query) && query && query.length ===4){
} else if (validateNumber(query) && query && query.length === 4) {
this.addCustForm.undef = query;
} else if(validateNumber(query) && query){
} else if (validateNumber(query) && query) {
this.addCustForm.tel = query;
}
this.getCompany()
},
getCompany(){
getCompany () {
let self = this
self.$refs.companySelect.clearSingleSelect()
this.$request.post(
......@@ -2029,14 +1976,14 @@ export default {
}
)
},
getDept(val){
getDept (val) {
if (!val) return;
this.deptList = []
let self = this
self.$refs.deptSelect.clearSingleSelect()
this.$request.post(
"/api/emaint/group/dept",
qs.stringify({parentCode: val}),
qs.stringify({ parentCode: val }),
res => {
self.addCustForm.deptName = ''
self.deptList = res.responseResult;
......@@ -2045,7 +1992,7 @@ export default {
}
)
},
addCustSumbit(){
addCustSumbit () {
let self = this
this.$refs.addCustRef.validate((valid) => {
if (valid) {
......@@ -2077,22 +2024,24 @@ export default {
}
}
},
watch:{
callIDOptions(val){
if(!val || val.length<=0){
watch: {
callIDOptions (val) {
if (!val || val.length <= 0) {
}
}
},
};
</script>
<style scoped>
.ivu-card-extra{
.ivu-card-extra {
left: 50px!important;
left: 50px !important;
}
#username_form .ivu-form-item-content {
text-align: left !important;
}
.demo-upload-list {
display: inline-block;
width: 60px;
......@@ -2174,7 +2123,7 @@ p.addbutton {
padding-left: 1px;
}
p.addbutton > button {
p.addbutton>button {
padding: 10px 20px;
border: none;
}
......@@ -2187,31 +2136,59 @@ p.addbutton > button {
div.ivu-form-item {
margin-bottom: 20px !important;
}
.ivu-card-body {
padding: 2px;
}
</style>
<style>
.workOrderManage .search-card .ivu-col.ivu-col-span-10 .ivu-form-item-content {
margin-left: 10px !important;
}
.workOrderManage .search-card .ivu-col.ivu-col-span-10 .ivu-form-item-error-tip {
left: 25px;
}
.workOrderManage .search-card .search-body .ivu-select-dropdown-list {
text-align: left;
}
.location {
margin: 0;
line-height: normal;
padding: 7px 16px;
clear: both;
color: #515a6e;
font-size: 12px!important;
font-size: 12px !important;
white-space: nowrap;
list-style: none;
cursor: pointer;
transition: background .2s ease-in-out;
}
.solveTabs {
border: 1px solid #57a3f3;
color: #57a3f3;
border-radius: 3px;
padding: 3px 8px;
margin-bottom: 5px;
}
.solveTabs+.solveTabs {
margin-left: 5px;
}
.verificationImgList {
margin-top: 10px;
}
.verificationImgList .verificationImg {
cursor: pointer;
width: 120px;
height: 120px;
border: 1px solid #ccc;
border-radius: 2px;
margin-right: 5px;
}
</style>
......@@ -2,420 +2,341 @@
<div>
<Card>
<div slot="title">
<!--工具栏-->
<Button slot="extra" type="primary" :loading="modal_loading" @click="repairSubmit">
提交
</Button>
<Button slot="extra" style="margin-left: 10px" @click="goBack">
返回
</Button>
<!--工具栏-->
<Button slot="extra" type="primary" :loading="modal_loading" @click="submit">
提交
</Button>
<Button slot="extra" style="margin-left: 10px" @click="goBack">
返回
</Button>
</div>
<!-- 编辑工单 -->
<Row :gutter="20">
<Col span="10">
<Card >
<p slot="title">工单信息: <span></span></p>
<Card>
<p slot="title">工单信息: <span></span></p>
<Form ref="kfxx" :model="formItem" :label-width="120" :rules="ruleValidate">
<Row type="flex" justify="start">
<Col span="20">
<FormItem label="报修人" prop="callID">
<Select
v-model="formItem.callID"
filterable
ref="callidselect"
remote
:remote-method="custSearch"
icon="search"
:blur="callIDblur"
@on-change="custChange"
:maxlength="20"
placeholder="客户姓名 / 手机号 / 座机 / 内线号码 "
>
<Option
v-for="(option, index) in callIDOptions"
:value="option.name"
:key="index"
:label="option.label"
>{{option.name}}</Option>
</Select>
</FormItem>
</Col>
<Col span="4">
<div style="margin-top: 1px"><Button icon="plus-round" @click="handleAddCust" ></Button></div>
</Col>
</Row>
<Form ref="kfxx" :model="formItem" :label-width="120" :rules="ruleValidate">
<Row type="flex" justify="start">
<Col span="20">
<FormItem label="报修人" prop="callID">
<Select v-model="formItem.callID" filterable ref="callidselect" remote :remote-method="custSearch"
icon="search" :blur="callIDblur" @on-change="custChange" :maxlength="20"
placeholder="客户姓名 / 手机号 / 座机 / 内线号码 ">
<Option v-for="(option, index) in callIDOptions" :value="option.name" :key="index"
:label="option.label">{{ option.name }}</Option>
</Select>
</FormItem>
</Col>
<Col span="4">
<div style="margin-top: 1px"><Button icon="plus-round" @click="handleAddCust"></Button></div>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="代报修" style="width: 100%;text-align: left;">
<RadioGroup v-model="formItem.replacementRepair">
<Radio label="1">
<span></span>
</Radio>
<Radio label="0">
<span></span>
</Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="代报修" style="width: 100%;text-align: left;">
<RadioGroup v-model="formItem.replacementRepair">
<Radio label="1">
<span></span>
</Radio>
<Radio label="0">
<span></span>
</Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
<!-- 联系人姓名 -->
<Row type="flex" justify="start">
<Col span="20">
<FormItem label="联系人" prop="contactName">
<Input type="text" v-model="formItem.contactName"
:disabled="formItem.replacementRepair === '1' ? false : true"
v-show="formItem.replacementRepair !== '1'"></Input>
<Select v-model="formItem.contactClient" filterable ref="contactSelect" remote
:remote-method="contactCustSearch" icon="search" @on-change="contactCustChange" :maxlength="20"
placeholder="客户姓名 / 手机号 / 座机 / 内线号码 " :disabled="formItem.replacementRepair === '1' ? false : true"
v-show="formItem.replacementRepair === '1'">
<Option v-for="(option, index) in contactOptions" :value="option.name" :key="index"
:label="option.label">{{ option.name }}</Option>
</Select>
</FormItem>
</Col>
<Col span="4">
<div style="margin-top: 1px"><Button icon="plus-round" @click="handleAddCust"
v-show="formItem.replacementRepair === '1'"></Button></div>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="工单来源" prop="dataSource">
<RadioGroup v-model="formItem.dataSource" @on-change="changDataSource">
<Radio :label="item.dataSource" v-for="item in organization" :key="item.dataSource">{{ item.label }}
</Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
<!-- 联系人号码 -->
<Row type="flex" justify="start">
<Col span="20">
<FormItem label="联系电话" prop="contactNumber">
<Input type="text" v-model="formItem.contactNumber"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="位置" prop="officeLocation">
<AutoComplete v-model="formItem.officeLocation" placeholder="请输入位置" @on-search="handleSearch1">
<option @click="locationChange(item)" :value="item" v-for="item in officeLocations" :key="item">
{{ item }}</option>
</AutoComplete>
<!-- 联系人姓名 -->
<Row type="flex" justify="start">
<Col span="20">
<FormItem label="联系人" prop="contactName">
<Input type="text" v-model="formItem.contactName" :disabled="formItem.replacementRepair==='1'?false:true" v-show="formItem.replacementRepair!=='1'"></Input>
<Select
v-model="formItem.contactClient"
filterable
ref="contactSelect"
remote
:remote-method="contactCustSearch"
icon="search"
@on-change="contactCustChange"
:maxlength="20"
placeholder="客户姓名 / 手机号 / 座机 / 内线号码 "
:disabled="formItem.replacementRepair==='1'?false:true"
v-show="formItem.replacementRepair==='1'"
>
<Option
v-for="(option, index) in contactOptions"
:value="option.name"
:key="index"
:label="option.label"
>{{option.name}}</Option>
</Select>
</FormItem>
</Col>
<Col span="4">
<div style="margin-top: 1px"><Button icon="plus-round" @click="handleAddCust" v-show="formItem.replacementRepair==='1'"></Button></div>
</Col>
</Row>
</FormItem>
</Col>
</Row>
<!-- 联系人号码 -->
<Row type="flex" justify="start">
<Col span="20">
<FormItem label="联系电话" prop="contactNumber">
<Input type="text" v-model="formItem.contactNumber"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="优先级">
<Select v-model="formItem.priority" style="text-align: left" placeholder="请选择优先级">
<Option v-for="(item, index) in priority" :value="item.value" :key="index" style="text-align: left;">
{{ item.name }}</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row type="flex" justify="start">
<Col span="12">
<FormItem label="预约单" prop="reservations" style="width: 100%;text-align: left;">
<RadioGroup v-model="formItem.reservations" @on-change="reservationChange">
<Radio label="1"><span></span></Radio>
<Radio label="0"><span></span></Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
<Row v-show="isReservation">
<Col span="12" style="margin-right:10px;">
<FormItem label="预约时间" prop="appointmentTime" style="width: 100%;text-align: left;">
<DatePicker type="datetime" @on-change="changeDate" v-model="formItem.appointmentTime"
placeholder="选择预约时间" style="width: 180px"></DatePicker>
</FormItem>
</Col>
</Row>
<Row>
<Col span="12">
<FormItem label="报修类型" prop="problemClass">
<Select v-model="formItem.problemClass" @on-change="findchildren" style="text-align: left">
<Option v-for="item in parentList" :value="item.parentProblem" :key="item.parentId"
style="text-align: left;">{{ item.parentProblem }}</Option>
</Select>
</FormItem>
</Col>
<Row>
<Col span="20">
<FormItem label="位置" prop="officeLocation">
<AutoComplete
v-model="formItem.officeLocation"
placeholder="请输入位置"
@on-search="handleSearch1"
>
<option
@click="locationChange(item)"
:value="item"
v-for="item in officeLocations"
:key="item"
>{{item}}</option>
</AutoComplete>
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="优先级">
<Select
v-model="formItem.priority"
style="text-align: left"
placeholder="请选择优先级"
>
<Option
v-for="(item,index) in priority"
:value="item.value"
:key="index"
style="text-align: left;"
>{{item.name}}</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row type="flex" justify="start">
<Col span="12">
<FormItem
label="预约单"
prop="reservation_type"
style="width: 100%;text-align: left;"
>
<RadioGroup v-model="formItem.reservations" @on-change="reservationChange">
<Radio label="1"><span></span></Radio>
<Radio label="0"><span></span></Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
<Row v-show="isReservation">
<Col span="12" style="margin-right:10px;">
<FormItem
label="预约时间"
prop="appointmentTime"
style="width: 100%;text-align: left;"
>
<DatePicker
type="datetime"
@on-change="changeDate"
v-model="formItem.appointmentTime"
placeholder="选择预约时间"
style="width: 180px"
></DatePicker>
</FormItem>
</Col>
</Row>
<Row>
<Col span="12">
<FormItem label="报修类型" prop="one_type">
<Select
v-model="formItem.problemClass"
:disabled="viewForm.id!=''?true:false"
@on-change="findchildren"
style="text-align: left"
>
<Option
v-for="(item,index) in treeList"
:value="item.parentProblem"
:key="index"
style="text-align: left;"
>{{ item.parentProblem}}</Option>
<!-- <Option value="">硬件问题</Option>
<Option value="-1">软件问题</Option>-->
</Select>
</FormItem>
</Col>
<Col span="7">
<FormItem :label-width="5">
<Select
v-model="formItem.problemType"
:disabled="viewForm.id!=''?true:false"
@on-change="findchildren2"
style="text-align: left"
>
<Option
v-for="(item,i) in childList"
:value="item.problem"
:key="i"
style="text-align: left;"
>{{ item.problem}}</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="问题项" style="text-align:left">
<CheckboxGroup v-model="formItem.problem" @on-change="checkProblem">
<Checkbox :key="index" :label="item.problem" v-for="(item,index) in questionList"><span>{{item.problem}}</span></Checkbox>
<Checkbox key="other" label="其他"><span>其他</span></Checkbox>
</CheckboxGroup>
</FormItem>
</Col>
</Row>
<Row v-show="isOtherProblem">
<Col span="20">
<FormItem
label="其他问题项"
prop="otherProblem"
>
<Input
type="text"
v-model="formItem.otherProblem"
placeholder="请简短描述"
></Input>
</FormItem>
</Col>
</Row>
<Row style="margin-bottom:30px;">
<Col span="24">
<FormItem label="图片描述">
<Modal
title="图片查看"
v-model="visible"
:closable="true"
:mask-closable="false"
>
<img :src="imgList[showimg]" v-if="visible" style="width: 100%" />
</Modal>
<div
class="addimg demo-upload-list"
:style="{'left':(index)*63+'px'}"
v-for="(item,index) in imgList"
:key="index"
>
<img
:src="item"
alt
v-if="item!=''"
:style="{'pointer-events':viewForm.id!=''?'none':'all'}"
/>
<div class="demo-upload-list-cover" v-if="item!=''">
<Icon type="ios-eye-outline" @click.native="handleView(index)" style="font-size: 20px;" ></Icon>
<Icon type="ios-trash-outline" @click.native="handleRemove(index)" style="font-size: 20px;"></Icon>
</div>
</div>
<div class="addimg demo-upload-list" :style="{'left':imgList.length*63+'px'}">
<i class="ivu-icon ivu-icon-ios-plus-empty"
@click="uploadfile()"
></i>
</div>
</FormItem>
</Col>
<input
type="file"
name
id="upfile"
style="display:none;"
@change="changefile"
/>
</Row>
<Col span="7">
<FormItem :label-width="5">
<Select v-model="formItem.problemType" @on-change="((val) => { findchildren2(val) })"
style="text-align: left">
<Option v-for="item in sublevelList" :value="item.problem" :key="item.id" style="text-align: left;">
{{
item.problem
}}</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="问题项" style="text-align:left">
<CheckboxGroup v-model="formItem.problem" @on-change="checkProblem">
<Checkbox :key="index" :label="item.problem" v-for="(item, index) in questionList">
<span>{{ item.problem }}</span>
</Checkbox>
<Checkbox key="other" label="其他"><span>其他</span></Checkbox>
</CheckboxGroup>
</FormItem>
</Col>
</Row>
<Row v-show="isOtherProblem">
<Col span="20">
<FormItem label="其他问题项" prop="otherProblem">
<Input type="text" v-model="formItem.otherProblem" placeholder="请简短描述"></Input>
</FormItem>
</Col>
</Row>
<Row style="margin-bottom:30px;">
<Col span="24">
<FormItem label="图片描述">
<Modal title="图片查看" v-model="visible" :closable="true" :mask-closable="false">
<img :src="imgList[showimg]" v-if="visible" style="width: 100%" />
</Modal>
<div class="addimg demo-upload-list" :style="{ 'left': (index) * 63 + 'px' }"
v-for="(item, index) in imgList" :key="index">
<img :src="item" alt v-if="item != ''"
:style="{ 'pointer-events': viewForm.id != '' ? 'none' : 'all' }" />
<div class="demo-upload-list-cover" v-if="item != ''">
<Icon type="ios-eye-outline" @click.native="handleView(index)" style="font-size: 20px;"></Icon>
<Icon type="ios-trash-outline" @click.native="handleRemove(index)" style="font-size: 20px;"></Icon>
</div>
</div>
<div class="addimg demo-upload-list" :style="{ 'left': imgList.length * 63 + 'px' }">
<i class="ivu-icon ivu-icon-ios-plus-empty" @click="uploadfile()"></i>
</div>
</FormItem>
</Col>
<input type="file" name id="upfile" style="display:none;" @change="changefile" />
</Row>
<Row>
<Col span="24">
<FormItem label="备注">
<Input
type="textarea"
:rows="3"
:disabled="viewForm.id!=''?true:false"
v-model="formItem.remark"
placeholder="300字以内"
></Input>
</FormItem>
</Col>
</Row>
<Row type="flex" style="margin-top:20px;margin-bottom:20px" justify="start">
<Col span="18">
<FormItem label="执行人">
<Select
v-model="formItem.userName"
filterable
clearable
@on-change="changeUser"
placeholder="请选择执行人"
>
<Option
v-for="(item, index) in userList"
:label="item.name"
:value="item.id"
:key="index"
>
<!-- {{ item.name }} -->
<span
style="float: left;max-width: 120px;min-width: 120px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"
>{{item.name}}</span>
<span>{{item.problemNum==null?0:item.problemNum}}</span>
</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row>
<Col span="18">
<!--表单验证 prop='participatorids' -->
<FormItem label="参与者">
<Select
v-model="formItem.participatorids"
multiple
style="width:100%;text-align: left;"
placeholder="请选择参与者"
>
<Option
:value="item.id"
:label="item.name"
v-for="(item,index) in userList"
:key="index"
>
<span
style="float: left;max-width: 120px;min-width: 120px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"
>{{item.name}}</span>
<span>{{item.problemNum==null?0:item.problemNum}}</span>
</Option>
</Select>
</FormItem>
</Col>
</Row>
</Form>
</Card>
<Row>
<Col span="24">
<FormItem label="备注">
<Input type="textarea" :rows="3" :disabled="viewForm.id != '' ? true : false" v-model="formItem.remark"
placeholder="300字以内"></Input>
</FormItem>
</Col>
</Row>
<Row type="flex" style="margin-top:20px;margin-bottom:20px" justify="start">
<Col span="18">
<FormItem label="执行人">
<Select v-model="formItem.userName" filterable clearable @on-change="changeUser" placeholder="请选择执行人">
<Option v-for="(item, index) in userList" :label="item.name" :value="item.id" :key="index">
<!-- {{ item.name }} -->
<span
style="float: left;max-width: 120px;min-width: 120px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">{{
item.name
}}</span>
<span>{{ item.problemNum == null ? 0 : item.problemNum }}</span>
</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row>
<Col span="18">
<!--表单验证 prop='participatorids' -->
<FormItem label="参与者">
<Select v-model="formItem.participatorids" multiple style="width:100%;text-align: left;"
placeholder="请选择参与者">
<Option :value="item.id" :label="item.name" v-for="(item, index) in userList" :key="index">
<span
style="float: left;max-width: 120px;min-width: 120px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">{{
item.name
}}</span>
<span>{{ item.problemNum == null ? 0 : item.problemNum }}</span>
</Option>
</Select>
</FormItem>
</Col>
</Row>
</Form>
</Card>
</Col>
<Col span="14">
<Tabs type = 'card' @on-click="clientRepairList">
<Tabs type='card' @on-click="clientRepairList">
<TabPane label="报修详情">
<Collapse v-model="openPanel">
<Collapse v-model="openPanel">
<Panel>
报修人
<div slot="content">
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">姓名:</label><div style="display: inline-block">{{formItem.name}}</div></div>
</Col>
<Col span="8" style="padding: 16px">
<div style="color: red"><label style="text-align: right;padding: 10px 12px 10px 0;">职务:</label><div style="display: inline-block">{{formItem.jobTitle}}</div></div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">公司:</label><div style="display: inline-block">{{formItem.companyName}}</div></div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">部门:</label><div style="display: inline-block">{{formItem.deptName}}</div></div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">手机:</label><div style="display: inline-block">{{formItem.phone}}</div></div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black;">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">内线:</label><div style="display: inline-block">{{formItem.undef}}</div></div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">座机:</label><div style="display: inline-block">{{formItem.tel}}</div></div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">性别:</label><div style="display: inline-block">{{formItem.sex}}</div></div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">姓名:</label>
<div style="display: inline-block">{{ formItem.name }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div style="color: red"><label style="text-align: right;padding: 10px 12px 10px 0;">职务:</label>
<div style="display: inline-block">{{ formItem.jobTitle }}</div>
</div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">公司:</label>
<div style="display: inline-block">{{ formItem.companyName }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">部门:</label>
<div style="display: inline-block">{{ formItem.deptName }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">手机:</label>
<div style="display: inline-block">{{ formItem.phone }}</div>
</div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black;">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">内线:</label>
<div style="display: inline-block">{{ formItem.undef }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">座机:</label>
<div style="display: inline-block">{{ formItem.tel }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">性别:</label>
<div style="display: inline-block">{{ formItem.sex }}</div>
</div>
</Col>
</Row>
</div>
</Panel>
<Panel v-show="formItem.replacementRepair=='1'">
<Panel v-show="formItem.replacementRepair == '1'">
联系人
<div slot="content">
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">姓名:</label><div style="display: inline-block">{{formItem.contactName}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">姓名:</label>
<div style="display: inline-block">{{ formItem.contactName }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div style="color: red"><label style="text-align: right;padding: 10px 12px 10px 0;">职务:</label><div style="display: inline-block">{{formItem.contactJobTitle}}</div></div>
<div style="color: red"><label style="text-align: right;padding: 10px 12px 10px 0;">职务:</label>
<div style="display: inline-block">{{ formItem.contactJobTitle }}</div>
</div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">公司:</label><div style="display: inline-block">{{formItem.contactCompanyName}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">公司:</label>
<div style="display: inline-block">{{ formItem.contactCompanyName }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">部门:</label><div style="display: inline-block">{{formItem.contactDeptName}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">部门:</label>
<div style="display: inline-block">{{ formItem.contactDeptName }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">手机:</label><div style="display: inline-block">{{formItem.contactPhone}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">手机:</label>
<div style="display: inline-block">{{ formItem.contactPhone }}</div>
</div>
</Col>
</Row>
<Row :gutter="10" style="margin-left:5px;color: black;">
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">内线:</label><div style="display: inline-block">{{formItem.contactUndef}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">内线:</label>
<div style="display: inline-block">{{ formItem.contactUndef }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">座机:</label><div style="display: inline-block">{{formItem.contactTel}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">座机:</label>
<div style="display: inline-block">{{ formItem.contactTel }}</div>
</div>
</Col>
<Col span="8" style="padding: 16px">
<div><label style="text-align: right;padding: 10px 12px 10px 0;">性别:</label><div style="display: inline-block">{{formItem.contactSex}}</div></div>
<div><label style="text-align: right;padding: 10px 12px 10px 0;">性别:</label>
<div style="display: inline-block">{{ formItem.contactSex }}</div>
</div>
</Col>
</Row>
</div>
......@@ -427,160 +348,82 @@
<m-table :config="tableConfig" :searchParams="repairHistoryForm" ref="table" :isFirst="isFirst"></m-table>
</div>
</TabPane>
</Tabs>
</Tabs>
</Col>
</Row>
</Card>
<!-- 客户新增 -->
<Modal
v-model="addCustModal"
title="客户新增"
@on-ok="addCustSumbit"
:loading="addCustLoading"
>
<Form
ref="addCustRef"
:model="addCustForm"
:label-width="100"
:rules="addCustRule"
>
<Modal v-model="addCustModal" title="客户新增" @on-ok="addCustSumbit" :loading="addCustLoading">
<Form ref="addCustRef" :model="addCustForm" :label-width="100" :rules="addCustRule">
<Row>
<Col span="16">
<FormItem
label="公司"
prop="companyCode"
>
<Select
v-model="addCustForm.companyCode"
style="text-align: left"
ref="companySelect"
filterable
@on-change="getDept"
clearable
>
<Option
v-for="item in companyList"
:value="item.groupNo"
:key="item.groupNo"
style="text-align: left;"
>{{ item.groupName}}</Option>
<!-- <Option value="">硬件问题</Option>
<FormItem label="公司" prop="companyCode">
<Select v-model="addCustForm.companyCode" style="text-align: left" ref="companySelect" filterable
@on-change="getDept" clearable>
<Option v-for="item in companyList" :value="item.groupNo" :key="item.groupNo" style="text-align: left;">{{
item.groupName
}}</Option>
<!-- <Option value="">硬件问题</Option>
<Option value="-1">软件问题</Option>-->
</Select>
</FormItem>
</Select>
</FormItem>
</Col>
<Col span="16">
<FormItem
label="部门"
prop="deptCode"
>
<Select
v-model="addCustForm.deptCode"
style="text-align: left"
ref="deptSelect"
filterable
clearable
>
<Option
v-for="item in deptList"
:value="item.groupNo"
:key="item.groupNo"
style="text-align: left;"
>{{ item.groupName}}</Option>
<!-- <Option value="">硬件问题</Option>
<FormItem label="部门" prop="deptCode">
<Select v-model="addCustForm.deptCode" style="text-align: left" ref="deptSelect" filterable clearable>
<Option v-for="item in deptList" :value="item.groupNo" :key="item.groupNo" style="text-align: left;">{{
item.groupName
}}</Option>
<!-- <Option value="">硬件问题</Option>
<Option value="-1">软件问题</Option>-->
</Select>
</FormItem>
</Select>
</FormItem>
</Col>
<Col span="16">
<FormItem
label="姓名"
prop="name"
>
<Input
v-model="addCustForm.name"
:maxlength="20"
placeholder="请输入姓名"
></Input>
</FormItem>
<FormItem label="姓名" prop="name">
<Input v-model="addCustForm.name" :maxlength="20" placeholder="请输入姓名"></Input>
</FormItem>
</Col>
<Col span="16">
<FormItem
label="优先级"
prop="priority"
>
<Select
v-model="addCustForm.priority"
placeholder="请选择优先级"
>
<Option
v-for="(item,index) in priority"
:value="item.value"
:key="index"
>{{item.name}}</Option>
<!-- <Option value="待派单"></Option>
<FormItem label="优先级" prop="priority">
<Select v-model="addCustForm.priority" placeholder="请选择优先级">
<Option v-for="(item, index) in priority" :value="item.value" :key="index">{{ item.name }}</Option>
<!-- <Option value="待派单"></Option>
<Option value="待维修">很高</Option> -->
</Select>
</FormItem>
</Select>
</FormItem>
</Col>
<Col span="16">
<FormItem
label="手机号"
prop="phone"
>
<Input
v-model="addCustForm.phone"
:maxlength="20"
placeholder="请输入手机号"
></Input>
</FormItem>
<FormItem label="手机号" prop="phone">
<Input v-model="addCustForm.phone" :maxlength="20" placeholder="请输入手机号"></Input>
</FormItem>
</Col>
<Col span="16">
<FormItem
label="座机"
prop="tel"
>
<Input
v-model="addCustForm.tel"
:maxlength="12"
placeholder="请输入座机号码"
></Input>
</FormItem>
<FormItem label="座机" prop="tel">
<Input v-model="addCustForm.tel" :maxlength="12" placeholder="请输入座机号码"></Input>
</FormItem>
</Col>
<Col span="16">
<FormItem
label="内线号码"
prop="undef"
>
<Input
v-model="addCustForm.undef"
:maxlength="12"
placeholder="请输入内线号码"
></Input>
</FormItem>
<FormItem label="内线号码" prop="undef">
<Input v-model="addCustForm.undef" :maxlength="12" placeholder="请输入内线号码"></Input>
</FormItem>
</Col>
<Col span="16">
<FormItem label="位置">
<Input
v-model="addCustForm.officeLocation"
:maxlength="30"
placeholder="请输入位置"
></Input>
</FormItem>
<FormItem label="位置">
<Input v-model="addCustForm.officeLocation" :maxlength="30" placeholder="请输入位置"></Input>
</FormItem>
</Col>
<Col span="16">
<FormItem label="性别">
<RadioGroup
v-model="addCustForm.sex"
>
<Radio label="男">
<span></span>
</Radio>
<Radio label="女">
<span></span>
</Radio>
</RadioGroup>
</FormItem>
<FormItem label="性别">
<RadioGroup v-model="addCustForm.sex">
<Radio label="男">
<span></span>
</Radio>
<Radio label="女">
<span></span>
</Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
</Form>
......@@ -596,7 +439,7 @@ import { validateMobile, validateNumber } from "@/assets/js/validate";
import { initCustSearchOption, getCustOrgInfo, getCustSex, getCustContactNumber } from "@/utils/workOrder"
export default {
data() {
data () {
return {
isOtherProblem: false,
companyList: [],
......@@ -618,8 +461,8 @@ export default {
{
message: "请输入正确的手机号",
trigger: "blur",
transform(value) {
var reg= /^[1][3,4,5,7,8,9][0-9]{9}$/;
transform (value) {
var reg = /^[1][3,4,5,7,8,9][0-9]{9}$/;
if (!value) {
return value;
} else if (!reg.test(value)) {
......@@ -634,7 +477,7 @@ export default {
{
message: "请输入正确的座机号码",
trigger: "blur",
transform(value) {
transform (value) {
if (!value) return '';
var reg = /[0-9\-]/;
// var reg=/0\d{2,3}\-\d{7,8}/
......@@ -650,7 +493,7 @@ export default {
{
message: "请输入正确的内线号码",
trigger: "blur",
transform(value) {
transform (value) {
if (!value) return '';
var reg = /^\d+$/;
if (!reg.test(value)) {
......@@ -663,9 +506,9 @@ export default {
],
priority: [
{ required: true, message: "请选择优先级", trigger: "change" }
]
],
},
openPanel: ['0','1'],
openPanel: ['0', '1'],
officeLocationsBackup: [],
isok: false,
callIDblur: false,
......@@ -713,7 +556,7 @@ export default {
replacementRepair: "0",
appointmentTime: "", //预约时间(接口)
reservations: '0', //预约单
dataSource: '',
contactClientId: "",
contactName: '',
contactPhone: '',
......@@ -730,21 +573,22 @@ export default {
treeList: [],
// 设置表单验证
ruleValidate: {
callID: [
{
required: true,
message: "请输入正确的来电号码",
trigger: "blur",
transform(value) {
var reg = /[0-9\-]/;
if (!reg.test(value)) {
return false;
} else {
return value;
}
}
}
],
// callID: [
// {
// required: true,
// message: "请输入正确的来电号码",
// trigger: "blur",
// transform (value) {
// var reg = /[0-9\-]/;
// if (!reg.test(value)) {
// return false;
// } else {
// return value;
// }
// }
// }
// ],
callID: [{ required: true, message: "请填写报修人姓名", trigger: "blur" }],
contactNumber: [
{
required: true,
......@@ -752,10 +596,13 @@ export default {
trigger: "blur"
}
],
dataSource: [
{ required: true, message: "请选择工单来源", trigger: "change" }
],
contactName: [
{ required: true, message: "请填写联系人姓名", trigger: "blur" }
],
reservation_type: [
reservations: [
{ required: true, message: "该选项不能为空", trigger: "blur" }
],
reservationTime: [
......@@ -766,8 +613,8 @@ export default {
type: "string"
}
],
one_type: [
{ required: true, message: "该选项不能为空", trigger: "blur" }
problemClass: [
{ required: true, message: "该选项不能为空", trigger: "change" }
],
officeLocation: [
{ required: true, message: "位置不能为空", trigger: "blur" }
......@@ -777,11 +624,11 @@ export default {
],
participatorids: [
{ required: true, message: "该选项不能为空", trigger: "blur" }
]
],
},
// 设置结束时间大于开始时间
end: {
disabledDate: function(date) {
disabledDate: function (date) {
return date.valueOf() < new Date(this.formItem.startUpdateTime);
}.bind(this)
},
......@@ -845,10 +692,10 @@ export default {
params.row.priority === "一级"
? "error"
: params.row.priority === "二级"
? "warning"
: params.row.priority === "三级"
? "success"
: "info",
? "warning"
: params.row.priority === "三级"
? "success"
: "info",
size: "small"
}
},
......@@ -925,10 +772,13 @@ export default {
},
repairHistoryForm: {
clientId: ""
}
},
organization: [],
parentList: [],
sublevelList: []
};
},
mounted() {
mounted () {
//方法
if (this.$route.query.callID) {
......@@ -942,7 +792,9 @@ export default {
this.custSearch(this.$route.query.callID, true);
}
},
created() {
created () {
this.getOrganization()
// 优先级下拉列表
this.$request.post(
"/api/dictionary/optionsByGroupCode",
......@@ -961,14 +813,14 @@ export default {
this.custSearch(value, true);
});
},
beforeCreate() {
beforeCreate () {
this.$request.post(
"/api/emaint/problem-base/treeList",
{},
res => {
this.treeList = res.responseResult;
},
res => {}
res => { }
);
this.$request.post(
"/api/user/searchUserProblemNum",
......@@ -977,11 +829,11 @@ export default {
this.userList = res.responseResult.list;
this.userList.sort(util.compare1("problemNum"));
},
res => {}
res => { }
);
},
methods: {
custSearch(query, type) {
custSearch (query, type) {
var self = this;
if (query !== "") {
self.callIDOptions = [];
......@@ -1021,7 +873,7 @@ export default {
}
},
contactCustSearch(query, type) {
contactCustSearch (query, type) {
if (query !== "") {
this.contactOptions = [];
this.$request.post(
......@@ -1053,12 +905,12 @@ export default {
}
},
// 位置自动检索
locationChange(value) {
locationChange (value) {
console.log(value, "cv");
this.formItem.officeLocation = value;
},
handleSearch1(value, option) {
handleSearch1 (value, option) {
// this.officeLocations = [];
console.log(value, "value");
console.log(value, "value");
......@@ -1074,7 +926,7 @@ export default {
});
},
changefile(e) {
changefile (e) {
console.log(e);
var file = e.target.files[0];
......@@ -1089,43 +941,80 @@ export default {
var reader = new FileReader();
reader.readAsDataURL(file);
var that = this;
reader.onload = function() {
reader.onload = function () {
that.imgList.push(this.result);
that.imgFiles.push(file);
};
},
// 二级菜单
findchildren2() {
findchildren2 (val) {
console.log(val);
if (this.formItem.problemClass == '' || this.formItem.problemClass == null) {
this.$Message.error(
"请先选择一级菜单!"
);
return
}
let arr = this.sublevelList.filter(item => item.problem === val)
console.log(arr);
this.formItem.problemBaseId = arr[0].id
// console.log(this.formItem.problemType);
this.childList.forEach(v => {
if (v.problem == this.formItem.problemType) {
this.$request.post(
"/api/emaint/problem-base/list",
qs.stringify({ parentId: v.id }),
res => {
this.questionList = res.responseResult;
},
res => {}
);
}
});
// this.childList.forEach(v => {
// if (v.problem == this.formItem.problemType) {
// this.$request.post(
// "/api/emaint/problem-base/list",
// qs.stringify({ parentId: v.id }),
// res => {
// this.questionList = res.responseResult;
// },
// res => { }
// );
// }
// });
},
// 一级菜单
findchildren() {
this.treeList.forEach(v => {
if (v.parentProblem == this.formItem.problemClass) {
this.childList = v.childList;
this.formItem.problemType = "";
this.questionList = [];
// if(this.formItem.problemType=='')
// this.formItem.problemType=v.childList[0].problem
}
this.findchildren2();
});
findchildren (value) {
this.formItem.problemType = ''
this.sublevelList = []
let arr = this.parentList.filter(item => item.parentProblem == value)
this.sublevelList = arr[0].childList
// this.treeList.forEach(v => {
// if (v.parentProblem == this.formItem.problemClass) {
// this.childList = v.childList;
// this.formItem.problemType = "";
// this.questionList = [];
// // if(this.formItem.problemType=='')
// // this.formItem.problemType=v.childList[0].problem
// }
// this.findchildren2();
// });
},
// 点击工单来源
changDataSource (value) {
this.formItem.problemClass = ''
this.$request.post(
"/api/emaint/problem-base/getTreeList",
qs.stringify({ dataSource: value }),
res => {
this.parentList = res.responseResult.map(item => {
item.parentId = `${item.parentId}`
return item
})
// that.parentList = res.responseResult.map(item => {
// item.label = item.parentProblem
// item.value = itme.parentId
// return item
// })
// console.log(this.parentList);
// this.$set(that.$data, 'parentList', res.responseResult)
// this.parentList = res.responseResult
},
res => { }
);
},
// 数组去重
uniq(array) {
uniq (array) {
var temp = []; //一个新的临时数组
for (var i = 0; i < array.length; i++) {
if (temp.indexOf(array[i]) == -1) {
......@@ -1135,11 +1024,11 @@ export default {
return temp;
},
search1(e) {},
search1 (e) { },
// 输入手机号进行检索
custChange(e) {
custChange (e) {
console.log(this.formItem.callID);
if ( !this.formItem.callID || this.formItem.callID == "undefined" ) {
if (!this.formItem.callID || this.formItem.callID == "undefined") {
return;
}
var flag = false;
......@@ -1192,7 +1081,7 @@ export default {
this.formItem.officeLocation = this.officeLocations[0];
}
},
res => {}
res => { }
);
}
this.formItem.sex = getCustSex(v)
......@@ -1247,9 +1136,9 @@ export default {
},
contactCustChange() {
contactCustChange () {
console.log(this.formItem.contactClient);
if ( !this.formItem.contactClient || this.formItem.contactClient == "undefined" ) {
if (!this.formItem.contactClient || this.formItem.contactClient == "undefined") {
return;
}
var flag = false;
......@@ -1293,7 +1182,7 @@ export default {
this.formItem.officeLocation = this.officeLocations[0];
}
},
res => {}
res => { }
);
}
});
......@@ -1340,8 +1229,20 @@ export default {
)[1];
transfer.style.display = "none";
},
// 表单验证
submit () {
const that = this;
this.$refs['kfxx'].validate(valid => {
if (valid) {
that.repairSubmit()
} else {
this.$Message.error('Fail!');
return
}
})
},
// 报修提交
repairSubmit() {
repairSubmit () {
this.modal_loading = true;
if (this.isok) {
......@@ -1379,7 +1280,7 @@ export default {
// this.formItem.phone != "" &&
this.formItem.problemClass != "" &&
this.formItem.problemType != "" &&
// this.formItem.phone != undefined &&
this.formItem.dataSource != "" &&
this.formItem.problemClass != undefined &&
this.formItem.problemType != undefined &&
reservationIs === true
......@@ -1469,25 +1370,25 @@ export default {
}
},
// 上一步
goBack() {
goBack () {
this.$router.go(-1)
},
// 选择文件
uploadfile() {
uploadfile () {
document.querySelector("#upfile").click();
},
// 图片幻灯
handleView(index) {
handleView (index) {
this.showimg = index;
this.visible = true;
},
handleRemove(index) {
handleRemove (index) {
this.imgFiles.splice(index, 1);
this.imgList.splice(index, 1);
},
// 历史报修数据
clientRepairList(e) {
clientRepairList (e) {
if (e == 0) return;
// console.log(this.repairHistoryForm.clientId);
if (this.repairHistoryForm.clientId == "" || this.repairHistoryForm.clientId == null) {
......@@ -1501,7 +1402,7 @@ export default {
},
//是否预约单
reservationChange(e) {
reservationChange (e) {
if (e == "1") {
this.isReservation = true;
console.log(this.isReservation);
......@@ -1512,28 +1413,28 @@ export default {
}
},
//预约时间
changeDate(e) {
changeDate (e) {
console.log(e);
this.formItem.appointmentTime = e;
},
changeUser(val) {
changeUser (val) {
this.formItem.userId = val;
},
handleAddCust(){
handleAddCust () {
this.$refs.addCustRef.resetFields();
this.addCustModal = true;
let query = this.$refs["callidselect"].query
if (validateMobile(query)) {
this.addCustForm.phone = query;
} else if(validateNumber(query) && query && query.length ===4){
} else if (validateNumber(query) && query && query.length === 4) {
this.addCustForm.undef = query;
} else if(validateNumber(query) && query){
} else if (validateNumber(query) && query) {
this.addCustForm.tel = query;
}
this.getCompany()
},
getCompany(){
getCompany () {
let self = this
self.$refs.companySelect.clearSingleSelect()
this.$request.post(
......@@ -1546,14 +1447,14 @@ export default {
}
)
},
getDept(val){
getDept (val) {
if (!val) return;
this.deptList = []
let self = this
self.$refs.deptSelect.clearSingleSelect()
this.$request.post(
"/api/emaint/group/dept",
qs.stringify({parentCode: val}),
qs.stringify({ parentCode: val }),
res => {
self.addCustForm.deptName = ''
self.deptList = res.responseResult;
......@@ -1562,7 +1463,7 @@ export default {
}
)
},
addCustSumbit(){
addCustSumbit () {
let self = this
this.$refs.addCustRef.validate((valid) => {
if (valid) {
......@@ -1592,13 +1493,29 @@ export default {
this.isOtherProblem = false
this.formItem.otherProblem = ''
}
},
getOrganization () {
this.$request.post(
"/api/emaint/group/getGroup",
{},
res => {
this.organization = res.responseResult.map(item => {
if (item.dataSource == 1) {
item.label = '塔楼客户'
} else {
item.label = item.parentName
}
item.dataSource = `${item.dataSource}`
return item
})
})
}
},
watch:{
openPanel(){
watch: {
openPanel () {
console.log(this.openPanel)
},
formItem(){
formItem () {
console.log(this.formItem.callID)
}
/*,
......@@ -1616,6 +1533,7 @@ export default {
#username_form .ivu-form-item-content {
text-align: left !important;
}
.demo-upload-list {
display: inline-block;
width: 60px;
......@@ -1697,7 +1615,7 @@ p.addbutton {
padding-left: 1px;
}
p.addbutton > button {
p.addbutton>button {
padding: 10px 20px;
border: none;
}
......@@ -1715,12 +1633,11 @@ div.ivu-form-item {
.workOrderManage .search-card .ivu-col.ivu-col-span-10 .ivu-form-item-content {
margin-left: 10px !important;
}
.workOrderManage
.search-card
.ivu-col.ivu-col-span-10
.ivu-form-item-error-tip {
.workOrderManage .search-card .ivu-col.ivu-col-span-10 .ivu-form-item-error-tip {
left: 25px;
}
.workOrderManage .search-card .search-body .ivu-select-dropdown-list {
text-align: left;
}
......
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 sign in to comment