Commit ac5ee9f8 by 张杰

v1.10.0版本需求

1 parent d47b086b
......@@ -11,7 +11,9 @@ import './core/public-path';
import { Common } from '@/utils/common.js'
import Constants from '@/utils/constants.js'
import actions from '@/core/actions';
import GlsxDialog from "@/components/dialog";
// import axios from 'axios'
Vue.component('glsx-dialog', GlsxDialog)
Vue.prototype.btn_size = 'mini'
Vue.prototype.$Common = Common
Vue.prototype.$Constants = Constants
......
......@@ -98,3 +98,14 @@ export const UPDATE_ORDER_IMAGE = params => {
export const DELETE_ORDER_INFO = params => {
return request(params, "/trialdrive/workorder/delete");
}
// 工单管理-工单列表-关联车辆-根据车架号获取车辆列表
export const GET_VEHICLE_LIST_BY_VIN = params => {
return request(params, "/trialdrive/workorder/getLinkVehicleList");
}
// 工单管理-工单列表-关联车辆-保存数据
export const SAVE_RELINKVEHICLE_INFO = params => {
return request(params, "/trialdrive/workorder/reLinkVehicle",'POST');
}
......@@ -2,44 +2,50 @@ import { ORGINIZA_API } from '@/config/config'
import request from '@/services/request'
// 获取组织列表
function getTableList (params) {
function getTableList(params) {
const url = ORGINIZA_API.ORGINIZA_SEARCH
return request(params, url)
}
// 根据根节点,获取子节点列表
function getChildren (params) {
function getChildren(params) {
const url = ORGINIZA_API.ORGINIZA_CHILDREN
return request(params, url)
}
// 获取组织列表树
function getSimpleList (params) {
function getSimpleList(params) {
const url = ORGINIZA_API.ORGINIZA_SIMPLElIST
return request(params, url)
}
// 组织架构
function getTreeOrg (params) {
function getTreeOrg(params) {
const url = ORGINIZA_API.ORGINIZA_TREEORY
return request(params, url)
}
// 添加组织
function addOrganiza (params) {
function addOrganiza(params) {
const url = ORGINIZA_API.ORGINIZA_ADD
return request(params, url, 'post')
}
// 编辑组织
function editOrganiza (params) {
function editOrganiza(params) {
const url = ORGINIZA_API.ORGINIZA_EDIT
return request(params, url, 'post')
}
// 删除组织
function deleteOrganiza (params) {
function deleteOrganiza(params) {
const url = ORGINIZA_API.ORGINIZA_DELETE
return request(params, url)
}
// 组织详情
function organizaInfo (params) {
function organizaInfo(params) {
const url = ORGINIZA_API.ORGINIZA_INFO
return request(params, url)
}
// 获取组织架构
export const GET_ORIGINIZATION_LIST = params => {
return request(params, ORGINIZA_API.ORGINIZA_TREEORY);
}
export { getTableList, getChildren, getSimpleList, getTreeOrg, addOrganiza, editOrganiza, deleteOrganiza, organizaInfo }
.sort_select {
width: 100px;
width: 120px;
}
.small_select {
width: 120px;
......@@ -114,3 +114,16 @@
}
}
}
/* 关联车辆 */
.car_info_box{
.cell{
display:flex;
align-items: center;
line-height:30px;
}
}
.btn_mini_size{
padding:2px 12px !important;
min-height: 24px;
}
\ No newline at end of file
......@@ -7,17 +7,22 @@
<el-tab-pane label="导入数据" name="2">
<import-vehicle ref="importVehicleCom" v-if="activeTabs == 2" :id="id" :key="id"></import-vehicle>
</el-tab-pane>
<el-tab-pane label="按组织授权" name="3">
<authorization-info ref="authorizationInfoCom" v-if="activeTabs == 3" :id="id" :key="id"></authorization-info>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import SelectInfo from "./select.vue";
import ImportVehicle from "./import.vue";
import AuthorizationInfo from "./authorization";
export default {
name: "AssignInfo",
components: {
SelectInfo,
ImportVehicle,
AuthorizationInfo,
},
props: {
id: {
......@@ -29,16 +34,16 @@ export default {
return {
activeTabs: "1",
userId: "",
randomKey:''
randomKey: "",
};
},
watch:{
id:{
handler:function(){
console.log('key:',Math.random())
this.randomKey = Math.random()
}
}
watch: {
id: {
handler: function () {
console.log("key:", Math.random());
this.randomKey = Math.random();
},
},
},
mounted() {
this.userId = this.id;
......@@ -46,10 +51,16 @@ export default {
methods: {
// 保存数据
saveInfo() {
if (this.activeTabs == 1) {
let _id = this.activeTabs;
if (_id == 1) {
this.$refs.selectInfoCom.saveInfo();
return false;
}
if (_id == 3) {
this.$refs.authorizationInfoCom.saveInfo();
return false;
}
this.$refs.importVehicleCom.saveInfo();
},
},
......
<template>
<div class="select_info_page">
<h2 class="title">注:按车辆所属组织层级直接授权数据,包括后续增加的车辆</h2>
<div class="device_box">
<div class="card_box">
<div class="head">请选择组织层级(支持多选)</div>
<div class="info_box">
<div class="search_box">
<el-input v-model="term" placeholder="请输入两位以上组织层级名称" suffix-icon="el-icon-search" @input="onSearch" @keyup.enter.native="onSearch"></el-input>
</div>
<div class="tree_box" v-loading="treeLoading">
<el-scrollbar class="el_scroll">
<el-tree ref="elTree" :key="id" :data="organizationList" default-expand-all :props="treeProps" :default-checked-keys="checkKeys" show-checkbox node-key="id" :filter-node-method="filterNode">
</el-tree>
</el-scrollbar>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { GET_ORIGINIZATION_LIST } from "@/services/orginizaManage";
import { deepClone, showToast, broadcast, received } from "@/utils/util";
export default {
name: "AuthorizationInfo",
props: {
id: {
type: [String, Number],
default: "",
},
},
data() {
return {
term: "",
organizationList: [],
treeLoading: false,
treeProps: {
label: "label",
children: "children",
isLeaf: "leaf",
["node-key"]: "id",
},
checkKeys: ["1837"],
};
},
created() {
this.getList();
},
mounted() {},
methods: {
// 获取组织树列表
getList() {
this.treeLoading = true;
GET_ORIGINIZATION_LIST().then((res) => {
this.treeLoading = false;
this.organizationList = res.data || [];
});
},
// 搜索树
onSearch() {
let term = this.term;
if (term && term.length < 2) {
return false;
}
this.$refs.elTree.filter(term);
},
// 筛选树
filterNode(value, data) {
return data.label.indexOf(value) !== -1;
},
// 保存数据
saveInfo() {
let _keys = this.$refs.elTree.getCheckedKeys();
console.log(_keys);
broadcast("cancel-loading");
},
},
};
</script>
<style lang="scss" scoped>
.select_info_page {
.title {
font-family: PingFangSC-Regular;
font-size: 14px;
color: #666666;
font-weight: 400;
}
.device_box {
display: flex;
justify-content: space-between;
.card_box {
flex: 1;
//width: 380px;
flex-shrink: 0;
box-sizing: border-box;
.head {
height: 54px;
line-height: 54px;
background: #f5f7fa;
padding: 0 16px;
font-family: PingFangSC-Regular;
font-size: 14px;
color: #333333;
font-weight: 400;
}
.info_box {
border: 1px solid #eee;
.search_box {
padding: 10px;
.input_select {
width: 100%;
::v-deep .el-input-group__prepend {
background: #fff !important;
//padding: 0 10px;
padding-left: 10px;
.el-select {
width: 90px;
box-sizing: border-box;
}
}
}
}
.tree_box {
border-top: 1px solid #eee;
.el_scroll {
padding: 10px 0;
height: 340px;
box-sizing: border-box;
overflow-y: auto;
}
}
}
}
}
}
</style>
\ No newline at end of file
......@@ -327,6 +327,7 @@ export default {
},
mounted() {
let _this = this;
received("assign-success", this.closeDialog);
received("cancel-loading", function () {
_this.loading = false;
......
......@@ -87,7 +87,7 @@
<el-table-column label="安装技工" prop="mechanicName" :width="tdWidth"></el-table-column> -->
<el-table-column label="工单归属" prop="createdBy" :width="longTdWidth" show-overflow-tooltip></el-table-column>
<el-table-column label="创建时间" prop="createdDate" :width="tdWidth"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180px">
<el-table-column label="操作" fixed="right" align="left" width="210px">
<template slot-scope="{row}">
<el-link class="el_link" type="primary" @click="lookDetail(row,1)">查看</el-link>
<el-link class="el_link" type="primary" v-if="row.status == 0 ||row.status == 1" @click="lookDetail(row,2)">编辑</el-link>
......@@ -95,6 +95,12 @@
<el-link class="el_link" type="primary" v-if="row.status == 0 ||row.status == 1" @click="lookDetail(row,3)">激活</el-link>
<el-link class="el_link" type="primary" v-if="row.status == 5" @click="lookDetail(row,4)">审核</el-link>
<auth-link class="el_link" type="primary" v-if="row.status == 2" uid="14010101" name="照片编辑" @click.native="lookDetail(row,5)">照片编辑</auth-link>
<el-dropdown trigger="click" @command="e => onCommand(e,row)" v-if="hasPermission('work_order_associated') && row.status == 1">
<el-button class="btn_mini_size" icon="el-icon-arrow-down" size="mini"></el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1" v-if="hasPermission('work_order_associated')">关联车辆</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
......@@ -164,10 +170,44 @@
</glsx-dialog>
<!-- 查看工单 end -->
<!-- 关联车辆 开始 -->
<glsx-dialog :show="showCarDialog" title="关联车辆" width="600px" :appendtobody="true" @close="closeCarDialog()">
<div>
<el-form ref="carInfoForm" :model="carInfoForm" :rules="carInfoFormRules" label-width="140px">
<el-form-item label="请选择对应车辆:" prop="vehicleId">
<el-select class="a_select" v-model="carInfoForm.vehicleId">
<el-option v-for="(item,index) in vehicleList" :key="index" :value="item.vehicleId" :label="item.ownerName + '/' + item.shopName"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="currentVehicle.ownerName || currentVehicle.shopName || currentVehicle.bizOrderNo">
<div class="car_info_box">
<div class="cell">
<div class="name">姓名:</div>
<div class="txt">{{currentVehicle.ownerName||'--'}}</div>
</div>
<div class="cell">
<div class="name">店面名称:</div>
<div class="txt">{{currentVehicle.shopName||'--'}}</div>
</div>
<div class="cell">
<div class="name">业务工单:</div>
<div class="txt">{{currentVehicle.bizOrderNo||'--'}}</div>
</div>
</div>
</el-form-item>
</el-form>
</div>
<div slot="footer">
<el-button type="primary" size="small" :loading="aloading" @click="saveLinkInfo()">保存</el-button>
<el-button type="default" size="small" @click="closeCarDialog()">关闭</el-button>
</div>
</glsx-dialog>
<!-- 关联车辆 end -->
</div>
</template>
<script>
import GlsxDialog from "@/components/dialog";
// import GlsxDialog from "@/components/dialog";
import {
GET_WORKORDER_SEARCH,
GET_WORKORDER_EXPORT,
......@@ -175,18 +215,18 @@ import {
GET_WORKORDER_TEMPLATEFILE,
IMPORT_WORKORDER_FILES,
GET_WORKORDER_STATUSOPTION,
DELETE_ORDER_INFO
DELETE_ORDER_INFO,
GET_VEHICLE_LIST_BY_VIN,
SAVE_RELINKVEHICLE_INFO,
} from "@/services/order";
import { deepClone, showToast, showModal } from "@/utils/util";
import store from "@/store";
import GlsxOrganization from "@/components/glsx-organization";
import EditOrder from "./edit.vue";
import moment from "moment";
import AuthLink from "@/components/auth-button/link";
import axios from "axios";
export default {
components: {
GlsxDialog,
// GlsxDialog,
GlsxOrganization,
EditOrder,
AuthLink,
......@@ -235,12 +275,21 @@ export default {
tdWidth: 140,
longTdWidth: 180,
orderInfo: {},
// 关联车辆弹框
showCarDialog: false,
carInfoForm: {},
vehicleList: [],
currentVehicle: {},
carInfoFormRules: {
vehicleId: [
{ required: true, message: "请选择对应车辆", trigger: "change" },
],
},
};
},
watch: {
$route: {
handler: function (n, o) {
console.log(n);
if (n.query && n.query.refresh) {
this.currentPage = 1;
this.getList();
......@@ -305,7 +354,6 @@ export default {
// 监听文件导入
onFileChange(file, fileList) {
console.log(file);
if (!file.response) {
this.uploadFile = file;
}
......@@ -332,7 +380,6 @@ export default {
});
return false;
}
console.log(this.uploadFile);
this.loading = true;
this.$refs.elUpload.submit();
},
......@@ -432,7 +479,6 @@ export default {
// 监听树
onChange(e) {
this.filterVisible = false;
console.log(e);
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
......@@ -497,7 +543,6 @@ export default {
// 编辑工单
saveInfo() {
console.log("保存工单");
this.aloading = true;
this.$refs.editOrderCom.saveInfo();
},
......@@ -519,7 +564,6 @@ export default {
// 激活工单
activeDevice() {
console.log("保存工单");
this.aloading = true;
this.$refs.editOrderCom.activeDevice();
},
......@@ -578,6 +622,72 @@ export default {
},
});
},
// 关闭关联车辆弹框
closeCarDialog() {
this.showCarDialog = false;
this.vehicleList = [];
this.currentVehicle = {};
this.carInfoForm = {};
this.orderId = "";
this.$refs.carInfoForm.clearValidate();
},
// 点击下拉菜单
onCommand(e, row) {
console.log(row);
if (e == 1) {
this.showCarDialog = true;
this.orderId = row.id;
this.getVehicleList(row.vin);
}
},
// 是否有权限
hasPermission(id) {
let list = this.$root.parentCommon.getAuthData();
let idx = list.findIndex((k) => k.origin.permissionTag == id);
if (idx < 0) {
return false;
} else {
return true;
}
},
// 获取车辆列表
getVehicleList(vin) {
let _this = this;
GET_VEHICLE_LIST_BY_VIN({ vin: vin }).then((res) => {
let list = res.data || [];
_this.vehicleList = list;
_this.currentVehicle = list[0] || {};
if (list[0]) {
_this.$set(_this.carInfoForm, "vehicleId", list[0].vehicleId);
}
});
},
// 订单关联车辆
async saveLinkInfo() {
let _this = this;
let oParams = {};
let _pass = await _this.$refs.carInfoForm.validate().catch((err) => false);
console.log(_pass);
if (!_pass) {
return false;
}
oParams.orderId = this.orderId;
oParams.vehicleId = this.currentVehicle.vehicleId;
let res = await SAVE_RELINKVEHICLE_INFO(oParams);
if (res.code == 200) {
showToast({
message: "关联成功",
type: "success",
});
_this.closeCarDialog();
}
console.log(res);
},
},
};
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!