张雄 3 years ago
parent 782c7410f4
commit df89efeed3

@ -18,7 +18,7 @@ module.exports = {
"vue" "vue"
], ],
"rules": { "rules": {
indent: ['error', 'tab'], // indent: ['error', 'tab'],
'no-console': 'off', 'no-console': 'off',
} }
}; };

11
package-lock.json generated

@ -15,6 +15,7 @@
"less-loader": "5.0.0", "less-loader": "5.0.0",
"momen": "^0.0.1-security", "momen": "^0.0.1-security",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"qrcodejs2": "^0.0.2",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-router": "^3.5.3", "vue-router": "^3.5.3",
"vuex": "^3.6.2" "vuex": "^3.6.2"
@ -10968,6 +10969,11 @@
"teleport": ">=0.2.0" "teleport": ">=0.2.0"
} }
}, },
"node_modules/qrcodejs2": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/qrcodejs2/-/qrcodejs2-0.0.2.tgz",
"integrity": "sha1-Rlr+Xjnxn6zsuTLBH3oYYQkUauE="
},
"node_modules/qs": { "node_modules/qs": {
"version": "6.7.0", "version": "6.7.0",
"resolved": "https://registry.nlark.com/qs/download/qs-6.7.0.tgz", "resolved": "https://registry.nlark.com/qs/download/qs-6.7.0.tgz",
@ -22979,6 +22985,11 @@
"integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
"dev": true "dev": true
}, },
"qrcodejs2": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/qrcodejs2/-/qrcodejs2-0.0.2.tgz",
"integrity": "sha1-Rlr+Xjnxn6zsuTLBH3oYYQkUauE="
},
"qs": { "qs": {
"version": "6.7.0", "version": "6.7.0",
"resolved": "https://registry.nlark.com/qs/download/qs-6.7.0.tgz", "resolved": "https://registry.nlark.com/qs/download/qs-6.7.0.tgz",

@ -10,3 +10,171 @@ export function name(params) {
}) })
} }
// 所有的工单类型
export function getAllWorkOrderType(params) {
return httpService({
url: `/user/workOrderType/list`,
method: 'get',
params: params,
})
}
// 添加工单类型
export function AddWorkOrderType(params) {
return httpService({
url: `/user/workOrderType/insert`,
method: 'post',
data: params,
})
}
// 修改工单类型
export function EditWorkOrderType(params) {
return httpService({
url: `/user/workOrderType/update`,
method: 'POST',
data: params,
})
}
// 删除工单类型
export function DelWorkOrderType(params) {
return httpService({
url: `/user/workOrderType/delete`,
method: 'POST',
data: params,
})
}
// 所有的工单信息
export function getAllWorkOrder(params) {
return httpService({
url: `/user/workOrder/list`,
method: 'get',
params: params,
})
}
// 查询后台工单详情
export function getDetail(params) {
return httpService({
url: `/user/workOrder/detail`,
method: 'get',
params: params,
})
}
// 添加工单信息
export function addWorkOrder(params) {
return httpService({
url: `/user/workOrder/insert`,
method: 'post',
data: params,
})
}
// 取消后台工单信息
export function cancelWorkOrder(params) {
return httpService({
url: `/user/workOrder/cancel`,
method: 'post',
data: params,
})
}
// 加入工单池
export function joinTicketPool(params) {
return httpService({
url: `/user/workOrder/joinTicketPool`,
method: 'get',
params: params,
})
}
// 转移至待分配
export function moveToAssignment(params) {
return httpService({
url: `/user/workOrder/moveToAssignment`,
method: 'get',
params: params,
})
}
// 指派人员
export function designate(params) {
return httpService({
url: `/user/workOrder/designate`,
method: 'post',
data: params,
})
}
// 转派人员
export function updateDesignate(params) {
return httpService({
url: `/user/workOrder/updateDesignate`,
method: 'post',
data: params,
})
}
// 工单处理
export function process(params) {
return httpService({
url: `/user/workOrder/process`,
method: 'get',
params: params,
})
}
// 完成工单
export function finish(params) {
return httpService({
url: `/user/workOrder/finish`,
method: 'post',
data: params,
})
}
// 确认工单
export function confirm(params) {
return httpService({
url: `/user/workOrder/confirm`,
method: 'get',
params: params,
})
}
// 工单结算账单
export function workOrderCostList(params) {
return httpService({
url: `/user/workOrder/workOrderCostList`,
method: 'get',
params: params,
})
}
// 结算工单
export function settlement(params) {
return httpService({
url: `/user/workOrder/settlement`,
method: 'post',
data: params,
})
}
// 汇报
export function report(params) {
return httpService({
url: `/user/workOrder/report`,
method: 'post',
data: params,
})
}
// 查询工单记录
export function orderSchedule(params) {
return httpService({
url: `/user/workOrder/orderSchedule`,
method: 'get',
params: params,
})
}

@ -62,6 +62,14 @@ export function findTenantByEstateId(params) {
params: params, params: params,
}) })
} }
// 住户详情
export function residentDetail(params) {
return httpService({
url: `/user/resident/findDetail`,
method: 'get',
params: params,
})
}
// 住户审核 // 住户审核
// 审核列表 // 审核列表
export function reviewList(params) { export function reviewList(params) {

@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
}
</script>
<style>
</style>

@ -82,15 +82,15 @@ export default [
}, },
] ]
}, },
// { {
// path: '/Workorder', path: '/Workorder',
// name: "Workorder", name: "Workorder",
// title: "工单管理", title: "工单管理",
// icon: 'solution', icon: 'solution',
// hide: false, hide: false,
// component: resolve => require(['@/views/Basic/WorkOrder'], resolve), component: resolve => require(['@/views/Basic/WorkOrder'], resolve),
// meta: {title: '工单管理'} meta: {title: '工单管理'}
// }, },
// { // {
// path: '/attendance', // path: '/attendance',
// name: "Attendance", // name: "Attendance",

@ -0,0 +1,13 @@
<template>
<div>test</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

@ -0,0 +1,13 @@
<template>
<div>test</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

@ -97,4 +97,6 @@ export const rules = {
estateId:[{required:true,message:'请选择房屋',trigger:'change'}], estateId:[{required:true,message:'请选择房屋',trigger:'change'}],
identity:[{required:true,message:'请选择身份',trigger:'change'}], identity:[{required:true,message:'请选择身份',trigger:'change'}],
linkUserId :[{required:true,message:'请输入姓名',trigger:'change'}], linkUserId :[{required:true,message:'请输入姓名',trigger:'change'}],
} }
export const politicalOutlook = ["群众","中共党员","共青团","民革党员","民盟盟员",
"民建会员","民进会员","农工党党员","致公党党员","九三学社社员","台盟盟员","无党派人士",]

@ -10,9 +10,9 @@
style="width: 200px" style="width: 200px"
placeholder="请选择性别" placeholder="请选择性别"
> >
<a-select-option value="1"></a-select-option> <a-select-option :value="1"></a-select-option>
<a-select-option value="2"></a-select-option> <a-select-option :value="2"></a-select-option>
<a-select-option value="3">保密</a-select-option> <a-select-option :value="3">保密</a-select-option>
</a-select> </a-select>
<a-input <a-input
v-model="searchForm.keyword" v-model="searchForm.keyword"
@ -126,14 +126,33 @@
</a-modal> </a-modal>
<!-- 住户房屋管理 --> <!-- 住户房屋管理 -->
<a-drawer <a-drawer
title="查看房屋" title="住户详情"
:width="1000" :width="1000"
:visible="show.detail" :visible="show.detail"
:body-style="{ paddingBottom: '80px' }" :body-style="{ paddingBottom: '80px' }"
@close="onClose" @close="onClose"
> >
<div class="drawer-content"> <div class="drawer-content">
房屋信息 <a-avatar :size="64" icon="user" :src="imgUrl" />
<span>
{{holderDetail.name}}
{{holderDetail.sex == 1 ? '男' : (holderDetail.sex == 2)?'女':'保密'}}
</span>
<img style="height: 81px;width: 131px;margin-left: 24px;float: right" :src="idCardFront" />
<img style="height: 81px;width: 131px;float: right" :src="idCardBack" />
<a-divider></a-divider>
<a-descriptions layout="vertical">
<a-descriptions-item label="手机号">
{{holderDetail.tel}}
</a-descriptions-item>
<a-descriptions-item label="身份证号" >
{{holderDetail.idCard}}
</a-descriptions-item>
<a-descriptions-item label="入住时间">
{{holderDetail.checkTime}}
</a-descriptions-item>
</a-descriptions>
<div style="margin-top: 24px">房屋信息</div>
<a-divider></a-divider> <a-divider></a-divider>
<a-table <a-table
:columns="columns_house" :columns="columns_house"
@ -164,6 +183,36 @@
</span> </span>
</a-table> </a-table>
</div> </div>
<div style="margin-top: 24px">其他信息</div>
<a-divider></a-divider>
<a-descriptions layout="vertical">
<a-descriptions-item label="婚姻状况">
{{holderDetail.maritalStatus == 1 ? '未婚' : '已婚'}}
</a-descriptions-item>
<a-descriptions-item label="民族">
{{holderDetail.nation}}
</a-descriptions-item>
<a-descriptions-item label="政治面貌">
{{holderDetail.politicalOutlook == -1 ? '' : politicalOutlook[holderDetail.politicalOutlook-1] }}
</a-descriptions-item>
<a-descriptions-item label="从事职业">
{{holderDetail.occupation}}
</a-descriptions-item>
<a-descriptions-item label="工作单位">
{{holderDetail.employer}}
</a-descriptions-item>
<a-descriptions-item label="户口类型">
{{holderDetail.accountType == 1 ? '农村' : '城市'}}
</a-descriptions-item>
<a-descriptions-item label="工作单位地址">
{{holderDetail.employerAddress}}
</a-descriptions-item>
</a-descriptions>
<a-descriptions layout="vertical" :column="1">
<a-descriptions-item label="备注">
{{holderDetail.remarks}}
</a-descriptions-item>
</a-descriptions>
<div class="drawer-footer"> <div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="onClose"> <a-button :style="{ marginRight: '8px' }" @click="onClose">
关闭 关闭
@ -180,6 +229,7 @@ import {
searchForm, searchForm,
rules, rules,
columns_house, columns_house,
politicalOutlook,
} from "./depend/config.js"; } from "./depend/config.js";
import { estate } from "@/api/basic/estate"; import { estate } from "@/api/basic/estate";
import { import {
@ -187,6 +237,7 @@ import {
moveIn, moveIn,
moveOut, moveOut,
findTenantByEstateId, findTenantByEstateId,
residentDetail,
} from "@/api/basic/resident"; } from "@/api/basic/resident";
import addForm from "./depend/addForm.vue"; import addForm from "./depend/addForm.vue";
export default { export default {
@ -221,6 +272,11 @@ export default {
// //
tableData: [], tableData: [],
table_house: [], table_house: [],
holderDetail: {},
imgUrl: '', //
idCardFront: '',
idCardBack: '',
politicalOutlook: politicalOutlook,
options: { options: {
identity: [ identity: [
{ id: 1, name: "业主" }, { id: 1, name: "业主" },
@ -247,9 +303,26 @@ export default {
this.pagination.total = res.data.total; this.pagination.total = res.data.total;
}, },
houseManage(data) { houseManage(data) {
console.log(data);
this.holderInfo = data; this.holderInfo = data;
this.table_house = data.residentListEstateVoList; this.table_house = data.residentListEstateVoList;
residentDetail({id: data.id}).then(res => {
this.holderDetail = res.data;
if(res.data.residentImgUrls.length != 0) {
this.imgUrl = this.$ImgUrl(res.data.residentImgUrls[0].url)
} else {
this.imgUrl = ''
}
if(res.data.idCardFrontImgUrls.length != 0) {
this.idCardFront = this.$ImgUrl(res.data.idCardFrontImgUrls[0].url)
} else {
this.idCardFront = ''
}
if(res.data.idCardBackImgUrls.length != 0) {
this.idCardBack = this.$ImgUrl(res.data.idCardBackImgUrls[0].url)
} else {
this.idCardBack = ''
}
})
this.show.detail = true; this.show.detail = true;
}, },
// //

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<a-drawer <a-drawer
title="抽屉" title="添加工单"
:width="720" :width="720"
:visible="isVisibleDrawe" :visible="isVisibleDrawe"
:body-style="{ paddingBottom: '80px' }" :body-style="{ paddingBottom: '80px' }"
@ -19,12 +19,86 @@
<div>基本信息</div> <div>基本信息</div>
<a-divider></a-divider> <a-divider></a-divider>
<a-row> <a-row>
<a-col :span="12"> <a-col :span="8">
<a-form-model-item label="申请人身份" prop="identity"> <a-form-model-item label="申请人身份" prop="identity">
<a-select <a-select v-model="form.identity" placeholder="请选择申请人身份" @change="form.applicantId=undefined">
v-model="form.identity" <a-select-option v-for="(item, index) in options.identity" :key="index" :value="item.id">
placeholder="请选择申请人身份" {{item.name}}
/> </a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="8" v-if="form.identity == 1">
<a-form-model-item label="选择房屋" prop="estateId">
<a-select v-model="form.estateId" placeholder="请选择房屋" @change="getAppName">
<a-select-option v-for="(item, index) in options.estateId" :key="index" :value="item.id">
{{item.name}}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="8" v-else>
<a-form-model-item label="选择岗位" prop="estateId">
<a-cascader v-model="form.positionId" :options="options.applicantId" @change="getDepartmentName" placeholder="请选择岗位"></a-cascader>
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="申请人姓名" prop="applicantId">
<a-select v-if="form.identity == 1" v-model="form.applicantId" placeholder="请选择申请人">
<a-select-option v-for="(item,index) in applicantIds" :value="item.id" :key="index">
{{item.name}}
</a-select-option>
</a-select>
<a-select v-else v-model="form.applicantId" placeholder="请选择申请人">
<a-select-option v-for="(item,index) in departmentIds" :value="item.id" :key="index">
{{item.actualName}}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="工单类型" prop="workOrderTypeId">
<a-select placeholder="请选择工单类型" v-model="form.workOrderTypeId">
<a-select-option v-for="(item,index) in options.workOrderTypeId" :value="item.id" :key="index">
{{item.name}}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="预约地址" prop="reserveAddress">
<a-input placeholder="请输入预约地址" v-model="form.reserveAddress"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="预约到场时间" prop="reserveDate">
<a-date-picker style="width: 253px" v-model="form.reserveDate" value-format="YYYY-MM-DD HH:mm:ss"/>
</a-form-model-item>
</a-col>
<a-col :span="12">
工单照片
<!-- head -->
<a-upload
list-type="picture-card"
:action="`${$upload}`"
:headers="uploadHeaders"
accept='.jpg,.JPG,.png,.PNG,.jpeg,.JPEG'
@preview="handlePreview"
@change="picChange"
:file-list="headList"
:beforeUpload="beforeUpload"
>
<div v-if="headList.length < 1">
<a-icon type="plus" />
<div class="ant-upload-text">
上传照片
</div>
</div>
</a-upload>
</a-col>
<a-col :span="24">
<a-form-model-item label="工单内容" prop="content">
<a-textarea style="width: 824px" placeholder="请输入工单内容" v-model="form.content"></a-textarea>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
@ -34,28 +108,130 @@
<a-button :style="{ marginRight: '8px' }" @click="onClose"> <a-button :style="{ marginRight: '8px' }" @click="onClose">
关闭 关闭
</a-button> </a-button>
<a-button type="primary" @click="onClose"> </a-button> <a-button type="primary" @click="onSubmit"> </a-button>
</div> </div>
</a-drawer> </a-drawer>
<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
<img alt="example" style="width: 100%" :src="previewImage" />
</a-modal>
</div> </div>
</template> </template>
<script> <script>
import { form, rules, options, uploadHeaders } from "./form.js"
import {findTenantByEstateId} from "@/api/basic/resident"
import {findToUser} from "@/api/basic/department"
import {addWorkOrder} from "@/api/basic/Workorder"
function getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
export default { export default {
name: "addWork", name: "addWork",
data() { data() {
return { return {
isVisibleDrawe: false, isVisibleDrawe: false,
uploadHeaders,
previewVisible:false,
previewImage:'',
headList: [],
form,
rules,
options,
applicantIds: [],
departmentIds: [],
}; };
}, },
props: { props: {
visible: Boolean, visible: Boolean,
form:Object,
rules:Object
}, },
methods: { methods: {
onClose() { onClose() {
this.$emit("onClose"); this.$emit("onClose");
}, },
addClose(){
this.$refs.ruleForm.resetFields();
this.$emit('close');
this.headList = [];
},
success(){
this.$emit('success')
},
onSubmit() {
//
let pic = []
for(let item of this.headList){
//
if(item.response){
pic.push(item.response.data)
}else{
//
pic.push(item.url.split('/')[item.url.split('/').length-1])
}
};
this.form.imgUrls = pic;
let obj = {
...this.form
}
if(obj.identity == 2) {
obj.positionId = obj.positionId[2]
}
this.$refs.ruleForm.validate(async valid => {
if(valid) {
addWorkOrder(obj).then(res => {
if(res.code === 200){
this.$message.success(res.msg)
this.success()
this.addClose()
} else {
this.$message.error(res.msg)
}
})
}
})
},
//
beforeUpload(f, l) {
const isLt50M = f.size / 1024 / 1024 < 50;
if (!isLt50M) {
this.$message.error(f.name + "文件大小超出限制,请修改后重新上传");
return false;
} else {
return true;
}
}, //
async handlePreview(file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
},
picChange(info){
this.headList = info.fileList
},
handleCancel() {
this.previewVisible = false;
},
//
getAppName(val) {
form.applicantId = undefined;
findTenantByEstateId({estateId: val}).then(res => {
let data = res.data;
this.applicantIds = data;
})
},
//
getDepartmentName(val) {
findToUser({pageNum: 1,size: 10000,positionId: val[2]}).then(res => {
let data = res.data.rows;
this.departmentIds = data
})
}
}, },
watch: { watch: {
visible: { visible: {

@ -0,0 +1,249 @@
<template>
<div>
<a-drawer title="完成工单" :width="720" :visible="isVisibleDrawe" :body-style="{ paddingBottom: '80px' }" @close="onClose">
<div class="drawer-content">
<a-form-model title="1d2" layout="vertical" ref="ruleForm" :wrapper-col="{ span: 18 }">
<a-row>
<a-col :span="24">
<a-form-model-item label="完成情况">
<a-textarea v-model="form.content"></a-textarea>
</a-form-model-item>
</a-col>
<a-col :span="12">
工单照片
<!-- head -->
<a-upload
list-type="picture-card"
:action="`${$upload}`"
:headers="uploadHeaders"
accept='.jpg,.JPG,.png,.PNG,.jpeg,.JPEG'
@preview="handlePreview"
@change="picChange"
:file-list="headList"
:beforeUpload="beforeUpload"
>
<div v-if="headList.length < 1">
<a-icon type="plus" />
<div class="ant-upload-text">
上传照片
</div>
</div>
</a-upload>
</a-col>
</a-row>
<div>工单费用<a-button style="float: right" type="danger" ghost @click="delAll"></a-button></div>
<a-divider></a-divider>
<a-table :columns="columns" :data-source="form.workOrderFinishCostDTOList">
<template slot="costType" slot-scope="text,record,index">
<a-select v-model="form.workOrderFinishCostDTOList[index].costType">
<a-select-option :value="1">
人工费
</a-select-option>
<a-select-option :value="2">
耗材费
</a-select-option>
</a-select>
</template>
<template slot="name" slot-scope="text,record,index">
<a-input v-model="form.workOrderFinishCostDTOList[index].name"></a-input>
</template>
<template slot="num" slot-scope="text,record,index">
<a-input-number @change="totalPrice" v-model="form.workOrderFinishCostDTOList[index].num"></a-input-number>
</template>
<template slot="price" slot-scope="text,record,index">
<a-input-number :step="0.01" @change="totalPrice" v-model="form.workOrderFinishCostDTOList[index].price"></a-input-number>
</template>
<template slot="option" slot-scope="text,record,index">
<a @click="delSingle(index)" style="color: red">删除</a>
</template>
<template slot="footer">
<span>总费用{{total}}</span>
</template>
</a-table>
<a-button type="primary" ghost @click="addFee"></a-button>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="onClose">
关闭
</a-button>
<a-button type="primary" @click="onSubmit"> </a-button>
</div>
</a-drawer>
<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
<img alt="example" style="width: 100%" :src="previewImage" />
</a-modal>
</div>
</template>
<script>
import store from "@/store";
import {finish} from "@/api/basic/Workorder";
const uploadHeaders = {
"manage-login-token": store.getters.getToken,
}
function getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
export default {
name: "finishDrawer",
props: {
visible: Boolean,
finishId: Number
},
watch: {
visible: {
handler(newValue) {
this.isVisibleDrawe = newValue;
},
immediate: true,
}
},
data() {
return {
form: {
workOrderId: undefined,
content: '',
imgUrls: [],
workOrderFinishCostDTOList: []
},
//
uploadHeaders: uploadHeaders,
headList: [],
isVisibleDrawe: false,
previewVisible:false,
previewImage:'',
//
columns: [
{
title: "收费类型",
dataIndex: "costType",
key: "costType",
scopedSlots: { customRender: "costType" },
},
{
title: "收费名称",
dataIndex: "name",
key: "name",
scopedSlots: { customRender: "name" },
},
{
title: "数量",
dataIndex: "num",
key: "num",
scopedSlots: { customRender: "num" },
},
{
title: "单价(元)",
dataIndex: "price",
key: "price",
scopedSlots: { customRender: "price" },
},
{
title: "操作",
dataIndex: "option",
key: "option",
scopedSlots: { customRender: "option" },
},
],
tableData: [],
total: 0,
}
},
methods: {
onSubmit() {
//
let pic = []
for(let item of this.headList){
//
if(item.response){
pic.push(item.response.data)
}else{
//
pic.push(item.url.split('/')[item.url.split('/').length-1])
}
};
this.form.workOrderId = this.finishId;
this.form.imgUrls = pic;
let obj = {...this.form};
finish(obj).then(res => {
if(res.code === 200){
this.$message.success(res.msg)
this.success()
this.addClose()
} else {
this.$message.error(res.msg)
}
})
},
onClose() {
this.$emit("onClose");
},
addClose(){
this.isVisibleDrawe = false;
this.form.workOrderFinishCostDTOList = [];
this.form.content = '';
this.headList = [];
},
addFee() {
let obj = {
costType: 1,
name: '',
num: 0,
price: 0,
}
this.form.workOrderFinishCostDTOList.push(obj)
},
//
delSingle(index) {
this.form.workOrderFinishCostDTOList.splice(index, 1);
},
delAll() {
this.form.workOrderFinishCostDTOList = []
},
//
beforeUpload(f, l) {
const isLt50M = f.size / 1024 / 1024 < 50;
if (!isLt50M) {
this.$message.error(f.name + "文件大小超出限制,请修改后重新上传");
return false;
} else {
return true;
}
}, //
async handlePreview(file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
},
picChange(info){
this.headList = info.fileList
},
handleCancel() {
this.previewVisible = false;
},
totalPrice() {
let total = 0;
this.form.workOrderFinishCostDTOList.forEach(ele => {
let val = ele.num * ele.price;
total = total + val
})
this.total = total
},
success(){
this.$emit('success')
},
}
}
</script>
<style>
</style>

@ -0,0 +1,90 @@
import {houseList} from "@/api/basic/estate";
import {departmentList} from "@/api/basic/department"
import {getAllWorkOrderType} from "@/api/basic/Workorder"
let applicantIds = []
let estateIds = []
let workOrderTypeIds = []
departmentList().then(res => {
let data = res.data;
data.forEach(ele => {
let childList = []
ele.childList.forEach(el => {
let chList = [];
el.childList.forEach(e => {
let obj = {
value: e.id,
label: e.name
};
chList.push(obj)
})
let obj = {
value: el.id,
label: el.name,
children: chList,
};
childList.push(obj)
})
let obj = {
value: ele.id,
label: ele.name,
children: childList
};
applicantIds.push(obj)
});
})
houseList({pageNum: 1,size: 100000}).then(res => {
let data = res.data.rows;
data.forEach(ele => {
let obj = {
id: ele.id,
name: ele.manageUnitName+'/'+ele.floorLocation+'楼/'+ele.name
};
estateIds.push(obj);
})
})
getAllWorkOrderType().then(res => {
let data = res.data;
data.forEach(ele => {
workOrderTypeIds.push(ele)
})
})
export const form = {
identity: undefined,
applicantId: undefined,
estateId: null,
positionId: null,
workOrderTypeId: undefined,
reserveAddress: '',
reserveDate: '',
imgUrls: [],
content: ''
}
export const rules = {
identity:[{required:true,message:'请选择身份',trigger:'change'}],
applicantId:[{required:true,message:'请选择申请人',trigger:'change'}],
// estateId:[{required:true,message:'请选择房屋',trigger:'change'}],
// positionId:[{required:true,message:'请选择岗位',trigger:'change'}],
workOrderTypeId:[{required:true,message:'请选择工单类型',trigger:'change'}],
reserveAddress:[{required:true,message:'请输入地址',trigger:'blur'}],
reserveDate:[{required:true,message:'请选择时间',trigger:'change'}],
content:[{required:true,message:'请输入工单内容',trigger:'blur'}],
}
export const options = {
identity:[
{ id:1, name:'住户' },
{ id:2, name:'物业' },
],
applicantId: applicantIds, //岗位
estateId: estateIds, //房屋
workOrderTypeId: workOrderTypeIds, //工单类型
}
// 请求头
import store from "@/store";
export const uploadHeaders = {
"manage-login-token": store.getters.getToken,
}

@ -4,30 +4,17 @@
<a-space size="large"> <a-space size="large">
<span>工单管理</span> <span>工单管理</span>
<a-radio-group v-model='activeName' button-style="solid" @change="tabsChange"> <a-radio-group v-model='activeName' button-style="solid" @change="tabsChange">
<a-radio-button value="0"> <a-radio-button :value="undefined">全部</a-radio-button>
全部 <a-radio-button :value="1">待分配</a-radio-button>
</a-radio-button> <a-radio-button :value="2">工单池</a-radio-button>
<a-radio-button value="1"> <a-radio-button :value="3">已接单</a-radio-button>
待分配 <a-radio-button :value="4">处理中</a-radio-button>
</a-radio-button> <a-radio-button :value="5">待确认</a-radio-button>
<a-radio-button value="2"> <a-radio-button :value="6">待支付</a-radio-button>
工单池 <a-radio-button :value="7">已完成</a-radio-button>
</a-radio-button> <a-radio-button :value="8">已评价</a-radio-button>
<a-radio-button value="3"> <a-radio-button :value="9">已拒绝</a-radio-button>
已接单 <a-radio-button :value="10">已取消</a-radio-button>
</a-radio-button>
<a-radio-button value="4">
处理中
</a-radio-button>
<a-radio-button value="5">
已完成
</a-radio-button>
<a-radio-button value="6">
已评价
</a-radio-button>
<a-radio-button value="7">
已拒绝
</a-radio-button>
</a-radio-group> </a-radio-group>
</a-space> </a-space>
</div> </div>
@ -35,13 +22,20 @@
<a-row> <a-row>
<a-col :span="20"> <a-col :span="20">
<a-space size="large"> <a-space size="large">
<a-select placeholder="请选择" style="width:200px"/> <a-select placeholder="工单类型" style="width:200px" v-model="form.workOrderTypeId" allowClear>
<a-button type="primary"> </a-button> <a-select-option v-for="item,index in typeList" :key="index" :value="item.id">
{{item.name}}
</a-select-option>
</a-select>
<a-input placeholder="请输入工单号/姓名/手机号" style="width:200px" v-model="form.keyword">
</a-input>
<a-button type="primary" @click="onSearch"> </a-button>
<a-button> </a-button> <a-button> </a-button>
</a-space> </a-space>
</a-col> </a-col>
<a-col :span="4"> <a-col :span="4">
<a-button class='add-btn' @click="show=true"></a-button> <a-button class='add-btn' @click="show=true"></a-button>
<a-button @click="orderType=true"></a-button>
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
@ -73,7 +67,7 @@
:columns="columns" :columns="columns"
:data-source="tableData" :data-source="tableData"
:pagination="pagination" :pagination="pagination"
:scroll="{ x: 1400 }" :scroll="{ x: 2376 }"
@change="handleTableChange" @change="handleTableChange"
:row-selection="{ :row-selection="{
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
@ -98,39 +92,247 @@
}} }}
</span> </span>
<span slot="action" slot-scope="text, row"> <span slot="action" slot-scope="text, row">
<a-space> <a class="ant-dropdown-link" v-show="row.status===1" @click="put(row)"></a>
<a class="ant-dropdown-link" v-show="row.status===1" @click="put(row)"></a> <a class="ant-dropdown-link" v-show="row.status===2" @click="shift(row)"></a>
<a class="ant-dropdown-link" v-show="row.status===1" @click="shift(row)"></a> <!-- <a class="ant-dropdown-link" v-show="row.status===1 || row.status===2" @click="assign(row)"></a>
<a class="ant-dropdown-link" v-show="row.status===1" @click="assign(row)"></a> <a class="ant-dropdown-link" v-show="row.status===3 || row.status===4" @click="shiftAssign(row)"></a> -->
<a class="ant-dropdown-link" v-show="row.status===1" @click="shiftAssign(row)"></a> <a class="ant-dropdown-link" v-show="row.status===4" @click="finish(row)"></a>
<a class="ant-dropdown-link" v-show="row.status===1" @click="finish(row)"></a> <a class="ant-dropdown-link" v-show="row.status===4" @click="report(row)"></a>
<a class="ant-dropdown-link" v-show="row.status===1" @click="deal(row)"></a> <a class="ant-dropdown-link" v-show="row.status===3" @click="deal(row)"></a>
<a class="ant-dropdown-link" v-show="row.status===1" @click="refuse(row)"></a> <a class="ant-dropdown-link" v-show="row.status===5" @click="confirm(row)"></a>
</a-space> <a class="ant-dropdown-link" v-show="row.status===6" @click="pay(row)"></a>
<a class="ant-dropdown-link" v-show="row.status===7 || row.status===8|| row.status===9|| row.status===10" @click="recall(row)"></a>
<a class="ant-dropdown-link" style="color: red" v-show="row.status===1|| row.status===2|| row.status===3|| row.status===4|| row.status===5 " @click="refuse(row)"></a>
</span> </span>
<span slot="code" slot-scope="text,row">
<a @click="orderDetail(row.id)">{{row.code}}</a>
</span>
<span slot="tags" slot-scope="tag"> <span slot="tags" slot-scope="tag">
<a-tag <a-tag :color="tag === 1 ? '#FF8C39' : tag === 2 ? '#921EAF' : tag === 4 ? '#205FBD' : tag === 8 ? 'rgba(0, 0, 0, 0.45)' : tag === 10 ? '#D53131' : 'grey'">
:color="tag === 1 ? 'volcano' : tag === 2 ? 'geekblue' : tag === 3 ? 'geekblue' : 'red'" {{ tag === 1 ? "待分配" : tag === 2 ? "工单池" :tag === 3 ? "已接单" :tag === 4 ? "处理中" :tag === 5 ? "待确认" :tag === 6 ? "待支付"
> :tag === 7 ? "已完成" :tag === 8 ? "已评价" :tag === 9 ? "已拒绝" :tag === 10 ? "已取消" :'-' }}
{{ tag === 1 ? "业主" : tag === 2 ? "业主亲属" :tag === 3 ? "租户":tag === 4 ? "租户亲属":'-' }}
</a-tag> </a-tag>
</span> </span>
<span slot="principal" slot-scope="text, row">
<span v-for="(item,index) in row.principal" :key="index">{{item}} </span>
</span>
<span slot="collaborator" slot-scope="text, row">
<span v-for="(item,index) in row.collaborator" :key="index">{{item}} </span>
</span>
</a-table> </a-table>
</div> </div>
<add-work :visible='show' :form="form" @onClose="onClose" :rules="rules"></add-work> <add-work :visible='show' @success="success" @onClose="onClose" :rules="rules"></add-work>
<trans-drawer @success="success" :assignId="assignId" :visible="transShow" @onClose="transClose"></trans-drawer>
<finish-drawer @success="success" :finishId="finishId" :visible="finishShow" @onClose="finishClose" ></finish-drawer>
<up-date-trans-drawer @success="success" :orderCode="orderCode" :updateTransId="updateTransId" :visible="updateTransShow" @onClose="updateTransClose"></up-date-trans-drawer>
<a-drawer title="工单设置" :width="720" :visible="orderType" :body-style="{ paddingBottom: '80px' }" @close="orderType=false">
<div class="drawer-content">
工单类型
<a-divider></a-divider>
<span v-for="item,index in typeList" :key="item.id">
<a-input v-if="item.show==true" ref="input" v-focus type="text" size="small"
:style="{ width: '78px','padding-bottom':'3px','margin-right':'7px' }"
v-model="item.name"
@blur="editType(item)"
@keyup.enter="editType(item)">
</a-input>
<a-tag v-else-if="item.show==false" closable @click="editInput(item, index)" @close.prevent="delType(item.id)">
{{item.name}}
</a-tag>
</span>
<span>
<a-input v-if="inputVisible" ref="addInput" type="text" size="small"
:style="{ width: '78px','padding-bottom':'3px'}"
:value="typeForm.name"
@change="handleInputChange"
@blur="handleInputConfirm"
@keyup.enter="handleInputConfirm">
</a-input>
<a-tag v-else style="background: #fff; borderStyle: dashed;" @click="addShow">
<a-icon type="plus" /> 新增类型
</a-tag>
</span>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="orderType=false">
关闭
</a-button>
</div>
</a-drawer>
<a-drawer title="工单结算" :width="720" :visible="payShow" :body-style="{ paddingBottom: '80px' }" @close="payClose">
<div class="drawer-content">
<a-form-model title="1d2" layout="vertical" ref="ruleForm" :wrapper-col="{ span: 18 }">
<div>工单账单</div>
<a-divider></a-divider>
<a-table :columns="payColumns" :data-source="payData.workOrderCostListVoList" :row-key="(record,index)=>{return record.id}">
<span slot="costType" slot-scope="text,record">
{{record.costType == 1 ? '人工费' : '耗材费'}}
</span>
<template slot="footer">
<span>总费用{{payData.totalCost}}</span>
</template>
</a-table>
<a-row>
<a-col :span="12">
<a-form-model-item label="支付金额">
<a-input-number :min="0" :step="0.01" v-model="payForm.payPrice" placeholder="请输入支付金额" style="width: 200px"></a-input-number>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="payClose"></a-button>
<a-button type="primary" :style="{ marginRight: '8px' }" @click="payConfirm"></a-button>
</div>
</a-drawer>
<a-drawer title="提交报告" :width="720" :visible="repShow" :body-style="{ paddingBottom: '80px' }" @close="repClose">
<div class="drawer-content">
<a-form-model title="1d2" layout="vertical" ref="ruleForm" :wrapper-col="{ span: 18 }">
<a-row>
<a-col :span="24">
<a-form-model-item label="报告内容">
<a-textarea v-model="repForm.content"></a-textarea>
</a-form-model-item>
</a-col>
<a-col :span="12">
报告照片
<a-upload list-type="picture-card"
:action="`${$upload}`"
:headers="uploadHeaders"
accept='.jpg,.JPG,.png,.PNG,.jpeg,.JPEG'
@preview="handlePreview"
@change="picChange"
:file-list="headList"
:beforeUpload="beforeUpload">
<div v-if="headList.length < 1">
<a-icon type="plus" />
<div class="ant-upload-text">上传照片</div>
</div>
</a-upload>
</a-col>
</a-row>
<div>工单进度</div>
<a-divider></a-divider>
<a-timeline>
<a-timeline-item v-for="(item, index) in repData" :key="index">
<template>
<a-tag>{{repStatus[item.status]}}</a-tag>
<div>{{item.createDate}}</div>
<div>{{item.userType==1?'申请人':2?'分配人':3?'负责人':4?'管理员':'协同人'}}{{item.createName}}</div>
<div>{{item.content}}</div>
</template>
</a-timeline-item>
</a-timeline>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="repClose"></a-button>
<a-button type="primary" :style="{ marginRight: '8px' }" @click="repConfirm"></a-button>
</div>
</a-drawer>
<a-drawer title="工单详情" :width="720" :visible="detailShow" :body-style="{ paddingBottom: '80px' }" @close="detailClose">
<div class="drawer-content">
<div class="order-detail-title">工单编号
<span style="float: right;color: rgba(0, 0, 0, 0.45)">来源{{detailData.workOrderInfo.froms==1?'后台':2?'app':'管家app'}}</span>
</div>
<div class="order-detail-title">{{detailData.workOrderInfo.code}}
<a-tag style="margin-left: 16px">{{repStatus[detailData.workOrderInfo.status]}}</a-tag>
</div>
<a-divider></a-divider>
<a-descriptions layout="vertical" style="margin-left: 6px">
<a-descriptions-item label="申请人">{{detailData.workOrderInfo.applicantName}}</a-descriptions-item>
<a-descriptions-item label="申请人身份">{{detailData.workOrderInfo.identity==1?'住户':'物业'}}</a-descriptions-item>
<a-descriptions-item label="联系方式">{{}}</a-descriptions-item>
<a-descriptions-item label="关联房屋">
{{detailData.workOrderInfo.buildingName}}-{{detailData.workOrderInfo.unitName}}-{{detailData.workOrderInfo.estateName}}
</a-descriptions-item>
<a-descriptions-item label="工单类型">{{detailData.workOrderInfo.workOrderTypeName}}</a-descriptions-item>
<a-descriptions-item label="预约到场时间">{{detailData.workOrderInfo.reserveDate}}</a-descriptions-item>
<a-descriptions-item label="具体地址">{{detailData.workOrderInfo.reserveAddress}}</a-descriptions-item>
</a-descriptions>
<a-descriptions layout="vertical" :column="1" style="margin-left: 6px">
<a-descriptions-item label="工单内容">
<div style="display: flex">
<img v-for="(item,index) in detailData.workOrderInfo.imgList"
:key="index" :src="$ImgUrl(item.url)" style="height: 86px;width: 86px" />
</div>
<div style="margin-top: 16px">{{detailData.workOrderInfo.content}}</div>
</a-descriptions-item>
</a-descriptions>
<div class="order-detail-title">工单账单</div>
<a-divider></a-divider>
<a-table :columns="payColumns" :data-source="detailData.workOrderCostList">
<span slot="costType" slot-scope="text,record">
{{record.costType == 1 ? '人工费' : '耗材费'}}
</span>
<span slot="footer">
总价格{{detailTotalCost}}
</span>
</a-table>
<div class="order-detail-title">工单进度</div>
<a-divider></a-divider>
<a-timeline :reverse="true">
<a-timeline-item v-for="(item, index) in detailData.workOrderScheduleList" :key="index">
<template>
<a-tag>{{repStatus[item.status]}}</a-tag>
<div>
{{ (new Date(item.createDate)).toLocaleString() }}
{{ (new Date(item.createDate)).getUTCDay()==1?'一':2?'二':3?'三':4?'四':5?'五':6?'六':'日'}}
</div>
<div>{{item.userType==1?'申请人':2?'分配人':3?'负责人':4?'管理员':'协同人'}}{{item.createName}}</div>
<div>{{item.content}}</div>
</template>
</a-timeline-item>
</a-timeline>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" type="danger" ghost @click="detailClose"></a-button>
</div>
</a-drawer>
</div> </div>
</template> </template>
<script> <script>
import uploadHeaders from "./form.js"
import {getAllWorkOrder} from "@/api/basic/Workorder"
import {getAllWorkOrderType} from "@/api/basic/Workorder"
import {AddWorkOrderType, EditWorkOrderType, DelWorkOrderType} from "@/api/basic/Workorder"
import {cancelWorkOrder, joinTicketPool, moveToAssignment, process, confirm, settlement, report} from "@/api/basic/Workorder"
import addWork from "../WorkOrder/addWorkOrder.vue" import addWork from "../WorkOrder/addWorkOrder.vue"
import transDrawer from "../WorkOrder/transDrawer.vue"
import finishDrawer from "../WorkOrder/finishDrawer.vue"
import upDateTransDrawer from "../WorkOrder/upDateTransDrawer.vue"
import {getDetail, workOrderCostList, orderSchedule} from "@/api/basic/Workorder"
export default { export default {
components:{ components:{
addWork addWork,
transDrawer,
finishDrawer,
upDateTransDrawer
},
directives: {
focus: {
//
inserted: function (el) {
el.focus()
}
}
}, },
data() { data() {
return { return {
uploadHeaders,
headList: [],
form:{ form:{
identity:null pageNum: 1,
size: 10,
status: undefined,
workOrderTypeId: undefined,
keyword: ''
},
typeForm: {
name: '',
id: undefined
}, },
rules:{}, rules:{},
show: false, show: false,
@ -158,47 +360,92 @@ export default {
{ {
title: "工单状态", title: "工单状态",
key: "tags", key: "tags",
width: "14%",
dataIndex: "status", dataIndex: "status",
width: 117,
scopedSlots: { customRender: "tags" }, scopedSlots: { customRender: "tags" },
}, },
{ {
title: "工单号", title: "工单号",
width: "14%",
dataIndex: "code", dataIndex: "code",
width: 215,
scopedSlots: { customRender: "code" },
}, },
{ {
title: "申请人", title: "申请人",
width: "14%", width: 117,
dataIndex: "people", dataIndex: "applicantName",
}, },
{ {
title: "手机号", title: "手机号",
width: "14%", width: 157,
dataIndex: "tel", dataIndex: "applicantTel",
}, },
{ {
title: "工单类型", title: "工单类型",
width: "14%", width: 155,
dataIndex: "type", dataIndex: "workOrderTypeName",
}, },
{ {
title: "工单类型", title: "工单内容",
width: "14%", width: 326,
dataIndex: "content", dataIndex: "content",
}, },
{
title: "具体地址",
width: 220,
dataIndex: "reserveAddress",
},
{
title: "负责人",
width: 166,
dataIndex: "principal",
scopedSlots: { customRender: "principal" },
},
{
title: "协同人",
width: 246,
dataIndex: "collaborator",
scopedSlots: { customRender: "collaborator" },
},
{
title: "任务开始时间",
width: 266,
dataIndex: "reserveDate",
},
{ {
title: "操作", title: "操作",
dataIndex: "action", dataIndex: "action",
key: "action", key: "action",
width: "300", width: 220,
fixed: "right", fixed: "right",
scopedSlots: { customRender: "action" }, scopedSlots: { customRender: "action" },
}, },
], ],
payColumns: [
{
title: "收费类型",
dataIndex: "costType",
key: "costType",
scopedSlots: { customRender: "costType" },
},
{
title: "收费名称",
dataIndex: "name",
key: "name",
},
{
title: "数量",
dataIndex: "num",
key: "num",
},
{
title: "价格(单价)",
dataIndex: "price",
key: "price",
},
],
// //
tableData: [{}, tableData: [],
],
ActionsList: [ ActionsList: [
{ {
label: "批量删除", label: "批量删除",
@ -209,47 +456,238 @@ export default {
value: 2, value: 2,
}, },
], ],
//
typeList: [],
orderType: false,
inputVisible: false,
//
transShow: false,
assignId: undefined,
//
finishShow: false,
finishId: undefined,
//
updateTransShow: false,
updateTransId: undefined,
orderCode: '',
//
payShow: false,
payData: {},
payForm: {workOrderId: undefined, payPrice: 0},
//
repShow: false,
repData: [],
repForm: {workOrderId: undefined, content: '', imgUrls: []},
repStatus: ['','待分配','工单池','已接单','处理中','待确认','待支付','已完成','已评价','已拒绝','已取消'],
//
detailData: {
workOrderCostList: [],
workOrderInfo: {},
workOrderScheduleList: {}
}, //workOrderCostList, workOrderInfo, workOrderScheduleList
detailShow: false,
detailTotalCost: 0
}; };
}, },
mounted(){ mounted(){
this.getApi()
this.getData() this.getData()
}, },
methods: { methods: {
getData(){}, getApi() {
getAllWorkOrderType().then(res => {
let data = res.data;
data.forEach(ele => {
ele.show = false;
});
this.typeList = data;
})
},
getData() {
getAllWorkOrder(this.form).then(res => {
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
})
},
onSearch() {
this.getData()
},
tabsChange(e){ tabsChange(e){
this.searchForm.status = e.target.value this.form.status = e.target.value
this.getData() this.getData()
}, },
onClose(){ onClose(){
this.show = false; this.show = false;
}, },
// //
put(){ orderDetail(id) {
getDetail({manageWorkOrderId: id}).then(res => {
let data = res.data;
this.detailData = data
let detailTotalCost = 0;
data.workOrderCostList.forEach(ele => {
let p = ele.num * ele.price;
detailTotalCost = detailTotalCost + p;
})
this.detailTotalCost = detailTotalCost
});
this.detailShow = true;
},
//
put(val){
this.$confirm({
title: "是否加入工单池",
icon:'plus',
onOk:async()=>{
let res = await joinTicketPool({manageWorkOrderId: val.id})
if(res.code === 200){
this.$message.success(res.msg);
this.getData()
} else {
this.$message.error(res.msg);
}
},
})
}, },
// //
shift(){ shift(val){
this.$confirm({
title: "是否转移至待分配",
icon:'redo',
onOk:async()=>{
let res = await moveToAssignment({manageWorkOrderId: val.id})
if(res.code === 200){
this.$message.success(res.msg);
this.getData()
} else {
this.$message.error(res.msg);
}
},
})
}, },
// //
assign(){ assign(val){
this.assignId = val.id;
this.transShow = true;
}, },
// //
shiftAssign(){ shiftAssign(val){
this.orderCode = val.code;
this.updateTransId = val.id;
this.updateTransShow = true;
}, },
// //
finish(){ finish(val){
this.finishId = val.id;
this.finishShow = true;
}, },
// //
deal(){ deal(val){
this.$confirm({
title: "是否处理",
icon:'tool',
onOk:async()=>{
let res = await process({manageWorkOrderId: val.id})
if(res.code === 200){
this.$message.success(res.msg);
this.getData()
} else {
this.$message.error(res.msg);
}
},
})
},
//
confirm(val) {
this.$confirm({
title: "是否确认",
icon:'check',
onOk:async()=>{
let res = await confirm({manageWorkOrderId: val.id})
if(res.code === 200){
this.$message.success(res.msg);
this.getData()
} else {
this.$message.error(res.msg);
}
},
})
}, },
// //
refuse(){ report(val) {
this.repShow = true;
this.repForm.workOrderId = val.id;
orderSchedule({manageWorkOrderId: val.id}).then(res => {
let data = res.data;
this.repData = data
})
},
repConfirm() {
//
let pic = []
for(let item of this.headList){
//
if(item.response){
pic.push(item.response.data)
}else{
//
pic.push(item.url.split('/')[item.url.split('/').length-1])
}
};
this.repForm.imgUrls = pic
report(this.repForm).then(res => {
if(res.code === 200){
this.$message.success(res.msg);
this.getData()
} else {
this.$message.error(res.msg);
}
});
this.repShow = false;
this.repData = [];
this.headList = [];
},
//
pay(val) {
this.payShow = true;
this.payForm.workOrderId = val.id;
workOrderCostList({manageWorkOrderId: val.id}).then(res => {
let data = res.data;
this.payData = data;
})
},
payConfirm() {
settlement(this.payForm).then(res => {
if(res.code=== 200){
this.$message.success(res.msg);
this.getData()
} else {
this.$message.error(res.msg);
}
});
this.payShow = false;
this.payData = {};
this.payForm.payPrice = 0;
},
//
recall() {
},
//
refuse(val){
this.$confirm({
title: "是否删除",
icon:'delete',
onOk:async()=>{
let res = await cancelWorkOrder({workOrderIds: [val.id]})
if(res.code=== 200){
this.$message.success(res.msg);
this.getData()
}else{
this.$message.error(res.msg);
}
},
})
}, },
handleTableChange(pagination) { handleTableChange(pagination) {
console.log(pagination); console.log(pagination);
@ -267,6 +705,95 @@ export default {
console.log(data); console.log(data);
this.tableChoosed = data; this.tableChoosed = data;
}, },
//
addShow() {
this.inputVisible = true;
this.$nextTick(function() {
this.$refs.addInput.focus();
});
},
handleInputChange(e) {
this.typeForm.name = e.target.value;
},
handleInputConfirm() {
if(this.typeForm.name === ''){
this.inputVisible = false;
return
};
AddWorkOrderType({name: this.typeForm.name}).then(res => {
this.$message.success(res.msg);
this.inputVisible = false;
this.getApi();
this.typeForm.name = ''
})
},
//
editInput(obj, i) {
this.$set(this.typeList[i],'show',true)
this.$forceUpdate()
},
editType(item) {
let obj = {
id: item.id,
name: item.name
}
EditWorkOrderType(obj).then(res => {
if(res.code === 200){
item.show = false
this.$forceUpdate()
this.$message.success(res.msg)
} else {
this.$message.error(res.msg)
}
})
},
//
delType(id) {
this.$confirm({
title: "是否删除",
icon:'delete',
onOk:async()=>{
let res = await DelWorkOrderType({workOrderTypeIds:[id]})
if(res.code=== 200){
this.$message.success(res.msg);
this.getApi()
}else{
this.$message.error(res.msg);
}
},
})
},
// form
close() {
this.show = false;
},
// form
success() {
this.getData();
},
//
transClose() {this.transShow = false;},
finishClose() {this.finishShow = false;},
updateTransClose() {this.updateTransShow = false;},
payClose() {this.payShow = false},
repClose() {this.repShow = false},
detailClose() {this.detailShow = false},
//
beforeUpload(f,l) {
const isLt50M = f.size / 1024 / 1024 < 50;
if (!isLt50M) {
this.$message.error(f.name + "文件大小超出限制,请修改后重新上传");
return false;
} else {
return true;
}
},
picChange(info){
this.headList = info.fileList
},
handlePreview() {
}
}, },
computed: { computed: {
// selection // selection
@ -278,4 +805,12 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.ant-dropdown-link {
margin-left: 8px;
}
.order-detail-title {
padding: 8px;
size :16px;
font-weight: bold;
}
</style> </style>

@ -0,0 +1,198 @@
<template>
<div>
<a-drawer title="指派人员" :width="720" :visible="isVisibleDrawe" :body-style="{ paddingBottom: '80px' }" @close="onClose">
<div class="drawer-content">
<a-form-model title="1d2" layout="vertical" ref="ruleForm" :wrapper-col="{ span: 18 }">
<div>负责人</div>
<a-divider></a-divider>
<a-row>
<a-col :span="12">
<a-form-model-item label="主办部门">
<a-cascader :options="applicantIds" @change="getDepartment" placeholder="请选择部门"></a-cascader>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="负责人">
<a-select placeholder="请选择负责人" v-model="form.principalDTOList[0].manageUserId">
<a-select-option v-for="(item,index) in applicantPeoples" :value="item.id" :key="index">
{{item.actualName}}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<div>协同人<a-button style="float: right" type="danger" ghost @click="delAll"></a-button></div>
<a-divider></a-divider>
<a-row v-for="(item, index) in form.collaboratorDTOList" :key="index">
<a-col :span="12">
<a-form-model-item label="协同部门" >
<a-cascader v-model="coApplicants[index]" :options="applicantIds" @change="getCoDepartment(index)" placeholder="请选择部门"></a-cascader>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="协同人">
<a-select placeholder="请选择协同人" v-model="form.collaboratorDTOList[index].manageUserId">
<a-select-option v-for="(it,i) in caDTO[index]" :value="it.id" :key="i">
{{it.actualName}}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<a-button type="primary" ghost @click="coAdd"></a-button>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="onClose">
关闭
</a-button>
<a-button type="primary" @click="onSubmit"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import {departmentList} from "@/api/basic/department"
import {findToUser} from "@/api/basic/department"
import {designate} from "@/api/basic/Workorder"
export default {
name: "transDrawer",
props: {
visible: Boolean,
assignId: Number
},
watch: {
visible: {
handler(newValue) {
this.isVisibleDrawe = newValue;
},
immediate: true,
},
},
data() {
return {
form: {
manageWorkOrderId: undefined,
principalDTOList: [
{
departmentId: undefined,
positionId: undefined,
userType: 1,
manageUserId: undefined
}
],
collaboratorDTOList: []
},
isVisibleDrawe: false,
applicantIds: [],
applicantPeoples: [],
//DTO
coApplicants: [],
caDTO: [],
}
},
created() {
this.getApi();
},
methods: {
onClose() {
this.$emit("onClose");
},
getApi() {
departmentList().then(res => {
let data = res.data;
let applicantIds = [];
data.forEach(ele => {
let childList = []
ele.childList.forEach(el => {
let chList = [];
el.childList.forEach(e => {
let obj = {
value: e.id,
label: e.name
};
chList.push(obj)
})
let obj = {
value: el.id,
label: el.name,
children: chList,
};
childList.push(obj)
})
let obj = {
value: ele.id,
label: ele.name,
children: childList
};
applicantIds.push(obj)
});
this.applicantIds = applicantIds;
})
},
//
getDepartment(val) {
this.form.principalDTOList[0].departmentId = val[1];
this.form.principalDTOList[0].positionId = val[2];
findToUser({pageNum: 1,size: 10000,positionId: val[2]}).then(res => {
let data = res.data.rows;
this.applicantPeoples = data
})
},
onSubmit() {
this.form.manageWorkOrderId = this.assignId;
console.log(this.form);
designate(this.form).then(res => {
if(res.code === 200){
this.$message.success(res.msg)
this.success()
this.addClose()
} else {
this.$message.error(res.msg)
}
})
},
success(){
this.$emit('success')
},
addClose(){
this.isVisibleDrawe = false;
this.form.principalDTOList= [
{
departmentId: undefined,
positionId: undefined,
userType: 1,
manageUserId: undefined
}
];
this.form.collaboratorDTOList = [];
},
//
coAdd() {
let obj = {
departmentId: undefined,
positionId: undefined,
userType: 2,
manageUserId: undefined,
}
this.form.collaboratorDTOList.push(obj);
},
getCoDepartment(index) {
this.form.collaboratorDTOList[index].departmentId = this.coApplicants[index][1];
this.form.collaboratorDTOList[index].positionId = this.coApplicants[index][2];
findToUser({pageNum: 1,size: 10000,positionId: this.coApplicants[index][2]}).then(res => {
let data = res.data.rows;
this.caDTO.push(data)
})
},
delAll() {
this.form.collaboratorDTOList = []
}
}
}
</script>
<style>
</style>

@ -0,0 +1,208 @@
<template>
<div>
<a-drawer title="工单转派" :width="720" :visible="isVisibleDrawe" :body-style="{ paddingBottom: '80px' }" @close="onClose">
<div class="drawer-content">
<a-form-model title="1d2" layout="vertical" ref="ruleForm" :wrapper-col="{ span: 18 }">
<div>负责人</div>
<a-divider></a-divider>
<a-row>
<a-col :span="12">
<a-form-model-item label="主办部门">
<a-cascader :options="applicantIds" @change="getDepartment" placeholder="请选择部门"></a-cascader>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="负责人">
<a-select placeholder="请选择负责人" v-model="form.principalDTOList[0].manageUserId">
<a-select-option v-for="(item,index) in applicantPeoples" :value="item.id" :key="index">
{{item.actualName}}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<div>协同人<a-button style="float: right" type="danger" ghost @click="delAll"></a-button></div>
<a-divider></a-divider>
<a-row v-for="(item, index) in form.collaboratorDTOList" :key="index">
<a-col :span="12">
<a-form-model-item label="协同部门" >
<a-cascader v-model="coApplicants[index]" :options="applicantIds" @change="getCoDepartment(index)" placeholder="请选择部门"></a-cascader>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="协同人">
<a-select placeholder="请选择协同人" v-model="form.collaboratorDTOList[index].manageUserId">
<a-select-option v-for="(it,i) in caDTO[index]" :value="it.id" :key="i">
{{it.actualName}}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<a-button type="primary" ghost @click="coAdd"></a-button>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="onClose">
关闭
</a-button>
<a-button type="primary" @click="onSubmit"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import {departmentList} from "@/api/basic/department"
import {findToUser} from "@/api/basic/department"
import {updateDesignate, orderSchedule} from "@/api/basic/Workorder"
export default {
name: "upDateTransDrawer",
props: {
visible: Boolean,
updateTransId: Number,
orderCode: String
},
watch: {
visible: {
handler(newValue) {
this.isVisibleDrawe = newValue;
},
immediate: true,
},
},
data() {
return {
form: {
manageWorkOrderId: undefined,
principalDTOList: [
{
departmentId: undefined,
positionId: undefined,
userType: 1,
manageUserId: undefined
}
],
collaboratorDTOList: []
},
isVisibleDrawe: false,
applicantIds: [],
applicantPeoples: [],
//DTO
coApplicants: [],
caDTO: [],
id: 1,
}
},
updated() {
this.getDetail()
},
created() {
this.getApi();
},
methods: {
onClose() {
this.$emit("onClose");
},
getApi() {
departmentList().then(res => {
let data = res.data;
let applicantIds = [];
data.forEach(ele => {
let childList = []
ele.childList.forEach(el => {
let chList = [];
el.childList.forEach(e => {
let obj = {
value: e.id,
label: e.name
};
chList.push(obj)
})
let obj = {
value: el.id,
label: el.name,
children: chList,
};
childList.push(obj)
})
let obj = {
value: ele.id,
label: ele.name,
children: childList
};
applicantIds.push(obj)
});
this.applicantIds = applicantIds;
});
},
//
getDetail() {
orderSchedule({manageWorkOrderId: this.updateTransId}).then(res => {
let data = res.data
})
},
//
getDepartment(val) {
this.form.principalDTOList[0].departmentId = val[1];
this.form.principalDTOList[0].positionId = val[2];
findToUser({pageNum: 1,size: 10000,positionId: val[2]}).then(res => {
let data = res.data.rows;
this.applicantPeoples = data
})
},
onSubmit() {
this.form.manageWorkOrderId = this.updateTransId;
updateDesignate(this.form).then(res => {
if(res.code === 200){
this.$message.success(res.msg)
this.success()
this.addClose()
} else {
this.$message.error(res.msg)
}
})
},
success(){
this.$emit('success')
},
addClose(){
this.isVisibleDrawe = false;
this.form.principalDTOList= [
{
departmentId: undefined,
positionId: undefined,
userType: 1,
manageUserId: undefined
}
];
this.form.collaboratorDTOList = [];
},
//
coAdd() {
let obj = {
departmentId: undefined,
positionId: undefined,
userType: 2,
manageUserId: undefined,
}
this.form.collaboratorDTOList.push(obj);
},
getCoDepartment(index) {
this.form.collaboratorDTOList[index].departmentId = this.coApplicants[index][1];
this.form.collaboratorDTOList[index].positionId = this.coApplicants[index][2];
findToUser({pageNum: 1,size: 10000,positionId: this.coApplicants[index][2]}).then(res => {
let data = res.data.rows;
this.caDTO.push(data)
})
},
delAll() {
this.form.collaboratorDTOList = []
}
}
}
</script>
<style>
</style>

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
退款 退款//
</div> </div>
</template> </template>

15939
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save