提醒配置文案更改,访客选项更改、添加拉送货车辆图片
This commit is contained in:
parent
c8c14c8f1c
commit
8bc055bf06
|
@ -77,5 +77,13 @@ export default {
|
|||
data);
|
||||
}
|
||||
},
|
||||
stat: {
|
||||
name: "测点统计记录",
|
||||
req: async function(data){
|
||||
return await http.get(
|
||||
`${config.API_URL}/enm/mpointstat/`,
|
||||
data);
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
|
@ -71,16 +71,17 @@ export default {
|
|||
},
|
||||
//停机记录
|
||||
stlog: {
|
||||
name: "停机记录列表",
|
||||
req: async function(data){
|
||||
return await http.get(
|
||||
`${config.API_URL}/wpm/stlog/`,
|
||||
data
|
||||
);
|
||||
}
|
||||
},
|
||||
//值班停机关系
|
||||
stsflog: {
|
||||
list: {
|
||||
name: "停机记录列表",
|
||||
req: async function(data){
|
||||
return await http.get(
|
||||
`${config.API_URL}/wpm/stlog/`,
|
||||
data
|
||||
);
|
||||
}
|
||||
},
|
||||
stsflog: {
|
||||
name: "值班停机关系",
|
||||
req: async function(data){
|
||||
return await http.get(
|
||||
|
|
|
@ -841,6 +841,16 @@ const routes = [
|
|||
},
|
||||
"component": "ungrouped/mpoint"
|
||||
},
|
||||
{
|
||||
"name": "material",
|
||||
"path": "/ungrouped/material",
|
||||
"meta": {
|
||||
"title": "产品",
|
||||
"icon": "el-icon-grid",
|
||||
"perms": ["dataset"]
|
||||
},
|
||||
"component": "ungrouped/material"
|
||||
},
|
||||
{
|
||||
"name": "goalSetting",
|
||||
"path": "/ungrouped/goalSetting",
|
||||
|
|
|
@ -235,8 +235,10 @@ export default {
|
|||
selection: [],
|
||||
chosen_cate: null,
|
||||
filter_recipient_: {
|
||||
10: "当事人部门以上",
|
||||
30: "属地部门以上",
|
||||
10: "当事人部门",
|
||||
20: "当事人部门以上",
|
||||
30: "属地部门",
|
||||
40: "属地部门以上",
|
||||
},
|
||||
objcate_: { post: "岗位", user: "用户", variable: "变量" },
|
||||
variable_: {
|
||||
|
|
|
@ -0,0 +1,220 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="roleAdd" v-auth="'role.create'"></el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<div class="right-panel-search">
|
||||
<el-input v-model="query.search" placeholder="产品名称" clearable @keyup.enter="handleQuery"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" hidePagination>
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="名称" prop="name" min-width="100"></el-table-column>
|
||||
<el-table-column label="标识" prop="code" min-width="100"></el-table-column>
|
||||
<el-table-column label="类型" prop="type" min-width="150">
|
||||
<template #default="scope">
|
||||
<span>{{ types_[scope.row.type] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检测项目" prop="testitems" min-width="150">
|
||||
<!-- <template #default="scope">
|
||||
<span v-for="item in scope.row.testitems">{{ item.name }}</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" @click="roleEdit(scope.row)" v-auth="'team.update'" type="primary">编辑</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="roleDel(scope.row, scope.$index)">
|
||||
<template #reference>
|
||||
<el-button link size="small" v-auth="'role.delete'" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<el-dialog :title="titleMap[type]" v-model="limitedVisible">
|
||||
<el-form :model="form" :rules="rules" ref="addForm" label-width="80px" style="padding: 0 10px;">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="form.name" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="标识">
|
||||
<el-input v-model="form.code" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型">
|
||||
<el-select
|
||||
v-model="form.type"
|
||||
placeholder="类型"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="检测项目">
|
||||
<el-select
|
||||
v-model="form.testitems"
|
||||
placeholder="检测项目"
|
||||
clearable
|
||||
multiple
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="limitedVisible=false" >取 消</el-button>
|
||||
<el-button v-if="type!=='show'" type="primary" :loading="isSaving" @click="submitHandle()">保 存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import {genTree} from "@/utils/verificate";
|
||||
const defaultForm = {
|
||||
id:"",
|
||||
name: "",
|
||||
code: "",
|
||||
type: "",
|
||||
testitems: [],
|
||||
|
||||
};
|
||||
export default {
|
||||
name: 'dept',
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.mtm.material.list,
|
||||
search: {
|
||||
keyword: null
|
||||
},
|
||||
query: {},
|
||||
isSaving: false,
|
||||
limitedVisible : false,
|
||||
type: "add",
|
||||
titleMap: {
|
||||
add: '新增测点集',
|
||||
edit: '编辑测点集',
|
||||
show: '查看测点集'
|
||||
},
|
||||
//表单数据
|
||||
form: defaultForm,
|
||||
//验证规则
|
||||
rules: {
|
||||
name: [{required: true, message: '请输入产品名称'}],
|
||||
},
|
||||
options:[],
|
||||
typeOptions:[
|
||||
{label:'电/水/气',value:0},
|
||||
{label:'成品',value:10},
|
||||
{label:'半成品',value:20},
|
||||
{label:'主要原料',value:30},
|
||||
{label:'辅助材料',value:40},
|
||||
{label:'加工工具',value:50},
|
||||
{label:'辅助工装',value:60},
|
||||
],
|
||||
types_:{
|
||||
0:'电/水/气',
|
||||
10:'成品',
|
||||
20:'半成品',
|
||||
30:'主要原料',
|
||||
40:'辅助材料',
|
||||
50:'加工工具',
|
||||
60:'辅助工装',
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTestItem();//获取产品
|
||||
},
|
||||
methods: {
|
||||
handleChange(value) {
|
||||
console.log(value);
|
||||
console.log(this.form.belong_dept);
|
||||
},
|
||||
//质检项目
|
||||
getTestItem(){
|
||||
this.$API.qm.getTestItem.get({page:0}).then(res=>{
|
||||
this.options = res;
|
||||
});
|
||||
|
||||
},
|
||||
//添加测点集
|
||||
roleAdd(){
|
||||
this.limitedVisible = true;
|
||||
this.type = "add";
|
||||
this.form = Object.assign({}, defaultForm);
|
||||
},
|
||||
submitHandle(){
|
||||
let that = this;
|
||||
this.$refs.addForm.validate( (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
let res;
|
||||
if(this.type==='add'){
|
||||
res = this.$API.mtm.material.create.req(that.form);
|
||||
}else{
|
||||
res = this.$API.mtm.material.update.req(that.form.id,that.form);
|
||||
}
|
||||
if(res.err_msg){
|
||||
this.$message.error(res.err_msg);
|
||||
}else{
|
||||
this.isSaveing = false;
|
||||
this.limitedVisible = false;
|
||||
this.$refs.table.refresh();
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//编辑测点集
|
||||
roleEdit(row){
|
||||
this.type='edit';
|
||||
this.form = Object.assign(defaultForm, row);
|
||||
this.limitedVisible = true;
|
||||
},
|
||||
|
||||
//删除测点集
|
||||
async roleDel(row){
|
||||
var id = row.id;
|
||||
var res = await this.$API.mtm.material.delete.req(id);
|
||||
if(res.err_msg){
|
||||
this.$message.error(res.err_msg)
|
||||
}else{
|
||||
this.$refs.table.refresh();
|
||||
this.$message.success("删除成功")
|
||||
}
|
||||
},
|
||||
//表格选择后回调事件
|
||||
selectionChange(selection){
|
||||
this.selection = selection;
|
||||
},
|
||||
//搜索
|
||||
handleQuery(){
|
||||
this.$refs.table.queryData(this.query)
|
||||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess(){
|
||||
this.$refs.table.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.treeMain {width: 100%;height:280px;overflow: auto;border: 1px solid #dcdfe6;margin-bottom: 10px;}
|
||||
</style>
|
|
@ -190,7 +190,7 @@
|
|||
//删除测点集
|
||||
async roleDel(row){
|
||||
var id = row.id;
|
||||
var res = await this.$API.mtm.team.delete.req(id);
|
||||
var res = await this.$API.mtm.mgroup.delete.req(id);
|
||||
if(res.err_msg){
|
||||
this.$message.error(res.err_msg)
|
||||
}else{
|
||||
|
|
|
@ -15,13 +15,9 @@
|
|||
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" hidePagination>
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="名称" prop="name" min-width="100"></el-table-column>
|
||||
<el-table-column label="分类" prop="cate" min-width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ cates_[scope.row.cate] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主要产品" prop="product" min-width="150"></el-table-column>
|
||||
<el-table-column label="计量物料" prop="product" min-width="150"></el-table-column>
|
||||
<el-table-column label="所属部门" prop="belong_dept_name" min-width="150"></el-table-column>
|
||||
<el-table-column label="所属工段" prop="mgroup_name" min-width="150"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time" min-width="150"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||
<template #default="scope">
|
||||
|
@ -55,23 +51,6 @@
|
|||
<el-input v-model="form.unit" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="分类">
|
||||
<el-select
|
||||
v-model="form.cate"
|
||||
placeholder="分类"
|
||||
clearable
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="检测设备">
|
||||
<el-select
|
||||
|
@ -115,7 +94,7 @@
|
|||
style="width: 100%;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
v-for="item in mgroupOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
|
@ -186,15 +165,19 @@
|
|||
checkStrictly: true,
|
||||
},
|
||||
options:[
|
||||
{label:'工序',value:'section'},
|
||||
{label:'其他',value:'other'},
|
||||
{label:'动力电',value:'elec'},
|
||||
{label:'工业水',value:'water'},
|
||||
{label:'煤粉',value:'water'},
|
||||
{label:'蒸汽',value:'water'},
|
||||
{label:'柴油',value:'water'},
|
||||
{label:'压缩空气',value:'water'},
|
||||
],
|
||||
cates_:{
|
||||
'section':'工序',
|
||||
'other':'其他',
|
||||
'elec':'动力电',
|
||||
'water':'工业水',
|
||||
},
|
||||
group: [],
|
||||
options:[],
|
||||
mgroupOptions:[],
|
||||
epOptions:[],
|
||||
monitoredOptions:[],
|
||||
|
||||
|
@ -226,15 +209,14 @@
|
|||
},
|
||||
//获取监测设备列表
|
||||
getMonitored(){
|
||||
this.$API.mtm.equipment.list.req({page:0,type:20}).then(res=>{
|
||||
this.$API.em.equipment.list.req({page:0,type:20}).then(res=>{
|
||||
this.monitoredOptions = res.data;
|
||||
})
|
||||
|
||||
},
|
||||
//获取集合列表
|
||||
getMgroup(){
|
||||
this.$API.mtm.product.list.req({page:0}).then(res=>{
|
||||
this.options = res.data;
|
||||
this.$API.mtm.material.list.req({page:0}).then(res=>{
|
||||
this.mgroupOptions = res.data;
|
||||
})
|
||||
},
|
||||
//添加测点集
|
||||
|
|
|
@ -108,6 +108,12 @@
|
|||
</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24" style="position: relative;" v-if="form.purpose==50">
|
||||
<span style="color:red;position: absolute;top: 8px;left: 18px;">*</span>
|
||||
<el-form-item label="车辆照片">
|
||||
<sc-upload-multiple v-model="fileurl2" @imagesDel="imagesDel" @imagesChange="imagesChange" draggable :limit="9" tip="最多上传9个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin-top:20px;text-align:center">
|
||||
|
@ -336,281 +342,314 @@
|
|||
cursor: not-allowed;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import { genTree } from "@/utils/verificate";
|
||||
import scAddress from "@/components/scAddress/SelectAddress.vue";
|
||||
<script>
|
||||
import { genTree } from "@/utils/verificate";
|
||||
import imgUpload from "@/components/scUpload/multiple.vue";
|
||||
import scAddress from "@/components/scAddress/SelectAddress.vue";
|
||||
|
||||
const defaultformworker = {
|
||||
duty: "",
|
||||
rcertificates: [],
|
||||
rpj: "",
|
||||
};
|
||||
export default {
|
||||
name: "vistoradd",
|
||||
components:{
|
||||
scAddress
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
measureOptions: ['集中隔离','居家隔离','居家健康检测','排除风险'],
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
form: {
|
||||
purpose:10,
|
||||
level:10,
|
||||
leave_time:'',
|
||||
},
|
||||
defaultTime_start:new Date(2000, 1, 1, 10, 0, 0),
|
||||
defaultTime:new Date(2000, 1, 1, 18, 0, 0),
|
||||
stepTitle: ["基本信息", "选择访客"],
|
||||
receptionistoptions: [],
|
||||
purposeoptions: [
|
||||
{ id: 10, name: "参观" },
|
||||
{ id: 20, name: "拜访" },
|
||||
{ id: 30, name: "面试" },
|
||||
{ id: 40, name: "开会" },
|
||||
{ id: 50, name: "拉送货" },
|
||||
{ id: 60, name: "其他" },
|
||||
],
|
||||
search: {
|
||||
keyword: null,
|
||||
},
|
||||
come_place:'',
|
||||
dialog: {
|
||||
save: false,
|
||||
permission: false,
|
||||
},
|
||||
isSaving:false,
|
||||
apiObj: this.$API.vm.visit.list,
|
||||
query: {},
|
||||
selection: [],
|
||||
dialogpeople: false,
|
||||
formpeople: {
|
||||
id: "",
|
||||
visit: "",
|
||||
visitor: '',
|
||||
// return_date: '',
|
||||
come_place: '',
|
||||
come_place_detail:'',
|
||||
// trip_desc: '',
|
||||
// test_date:'',
|
||||
// measure: '',
|
||||
// health_code: '',
|
||||
// travel_code: '',
|
||||
// test_report: '',
|
||||
is_main: false,
|
||||
// is_reported: true,
|
||||
},
|
||||
rules: {
|
||||
purpose: [{ required: true, message: "请输入" }],
|
||||
name: [{ required: true, message: "来访概述" }],
|
||||
visit_time: [{ required: true, message: "请输入" }],
|
||||
leave_time: [{ required: true, message: "请输入" }],
|
||||
receptionist: [{ required: true, message: "请输入" }],
|
||||
level: [{ required: true, message: "请输入" }]
|
||||
},
|
||||
peopleRules:{
|
||||
visitor: [{ required: true, message: "请选择来访人员" }],
|
||||
return_date: [{ required: true, message: "请选择返乡日期" }],
|
||||
come_place: [{ required: true, message: "请填写来源地" }],
|
||||
come_place_detail: [{ required: true, message: "请填写来源地详细地址" }],
|
||||
trip_desc: [{ required: true, message: "请填写行程轨迹" }],
|
||||
test_date: [{ required: true, message: "请选择核酸日期" }],
|
||||
measure: [{ required: true, message: "请选择管控措施" }],
|
||||
health_code: [{ required: true, message: "请长传健康码截图" }],
|
||||
travel_code: [{ required: true, message: "请上传行程码截图" }],
|
||||
test_report: [{ required: true, message: "请上传核酸报告" }],
|
||||
},
|
||||
visitoroptions: [],
|
||||
peoplelist: [],
|
||||
initform:[],
|
||||
ticket:{},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.visitid = this.$route.query.visitid; //作业ID
|
||||
this.isSaving = false;
|
||||
if(this.visitid){
|
||||
this.getRpj();
|
||||
this.getpeoplelistlist();
|
||||
}
|
||||
this.getvisitorlist();
|
||||
},
|
||||
methods: {
|
||||
selectedAddress(data){
|
||||
// debugger;
|
||||
console.log(data)
|
||||
this.formpeople.come_place=data;
|
||||
const defaultformworker = {
|
||||
duty: "",
|
||||
rcertificates: [],
|
||||
rpj: "",
|
||||
};
|
||||
export default {
|
||||
name: "vistoradd",
|
||||
components:{
|
||||
scAddress,
|
||||
imgUpload
|
||||
},
|
||||
//访问项目基本信息
|
||||
getRpj() {
|
||||
this.$API.vm.visit.read.req(this.visitid).then((res) => {
|
||||
this.form = res;
|
||||
});
|
||||
data() {
|
||||
return {
|
||||
fileurl2: "",
|
||||
measureOptions: ['集中隔离','居家隔离','居家健康检测','排除风险'],
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
form: {
|
||||
purpose:10,
|
||||
level:10,
|
||||
leave_time:'',
|
||||
vehicle_photos:[]
|
||||
},
|
||||
defaultTime_start:new Date(2000, 1, 1, 10, 0, 0),
|
||||
defaultTime:new Date(2000, 1, 1, 18, 0, 0),
|
||||
stepTitle: ["基本信息", "选择访客"],
|
||||
receptionistoptions: [],
|
||||
purposeoptions: [
|
||||
{ id: 2, name: "售后服务" },
|
||||
{ id: 4, name: "业务洽谈" },
|
||||
{ id: 10, name: "参观" },
|
||||
{ id: 20, name: "拜访" },
|
||||
{ id: 30, name: "面试" },
|
||||
{ id: 40, name: "开会" },
|
||||
{ id: 50, name: "拉送货" },
|
||||
{ id: 60, name: "其他" },
|
||||
],
|
||||
search: {
|
||||
keyword: null,
|
||||
},
|
||||
come_place:'',
|
||||
dialog: {
|
||||
save: false,
|
||||
permission: false,
|
||||
},
|
||||
isSaving:false,
|
||||
apiObj: this.$API.vm.visit.list,
|
||||
query: {},
|
||||
selection: [],
|
||||
dialogpeople: false,
|
||||
formpeople: {
|
||||
id: "",
|
||||
visit: "",
|
||||
visitor: '',
|
||||
// return_date: '',
|
||||
come_place: '',
|
||||
come_place_detail:'',
|
||||
// trip_desc: '',
|
||||
// test_date:'',
|
||||
// measure: '',
|
||||
// health_code: '',
|
||||
// travel_code: '',
|
||||
// test_report: '',
|
||||
is_main: false,
|
||||
// is_reported: true,
|
||||
},
|
||||
rules: {
|
||||
purpose: [{ required: true, message: "请输入" }],
|
||||
name: [{ required: true, message: "来访概述" }],
|
||||
visit_time: [{ required: true, message: "请输入" }],
|
||||
leave_time: [{ required: true, message: "请输入" }],
|
||||
receptionist: [{ required: true, message: "请输入" }],
|
||||
level: [{ required: true, message: "请输入" }],
|
||||
vehicle_photos:[{required: true, message: "请上传"}]
|
||||
},
|
||||
peopleRules:{
|
||||
visitor: [{ required: true, message: "请选择来访人员" }],
|
||||
return_date: [{ required: true, message: "请选择返乡日期" }],
|
||||
come_place: [{ required: true, message: "请填写来源地" }],
|
||||
come_place_detail: [{ required: true, message: "请填写来源地详细地址" }],
|
||||
trip_desc: [{ required: true, message: "请填写行程轨迹" }],
|
||||
test_date: [{ required: true, message: "请选择核酸日期" }],
|
||||
measure: [{ required: true, message: "请选择管控措施" }],
|
||||
health_code: [{ required: true, message: "请长传健康码截图" }],
|
||||
travel_code: [{ required: true, message: "请上传行程码截图" }],
|
||||
test_report: [{ required: true, message: "请上传核酸报告" }],
|
||||
},
|
||||
visitoroptions: [],
|
||||
peoplelist: [],
|
||||
initform:[],
|
||||
ticket:{},
|
||||
};
|
||||
},
|
||||
getReceptionist(data) {
|
||||
// 子组件调用父组件的方法并传参
|
||||
this.form.receptionist=data.id;
|
||||
this.form.receptionist_name=data.name
|
||||
},
|
||||
//接待人
|
||||
//渲染工单提交按钮
|
||||
getInit(){
|
||||
this.$API.wf.workflow.initkey.req('visit').then((res) => {
|
||||
this.initform = res;
|
||||
|
||||
});
|
||||
},
|
||||
handleStep(val) {
|
||||
//点击步骤条
|
||||
if (this.stepSuc.includes(val) === true) {
|
||||
this.active = val;
|
||||
mounted() {
|
||||
this.visitid = this.$route.query.visitid; //作业ID
|
||||
this.isSaving = false;
|
||||
if(this.visitid){
|
||||
this.getRpj();
|
||||
this.getpeoplelistlist();
|
||||
}
|
||||
this.getvisitorlist();
|
||||
},
|
||||
//组件点击上一步
|
||||
handleLastStep() {
|
||||
if (--this.active === 0) {
|
||||
this.active = 0;
|
||||
}
|
||||
},
|
||||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
if (this.active == 0) {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaving = true;
|
||||
if(this.visitid){
|
||||
this.$API.vm.visit.update
|
||||
.req(this.visitid, this.form)
|
||||
.then((res) => {
|
||||
this.$message.success("基本信息更新成功");
|
||||
this.getInit();
|
||||
this.active = 1;
|
||||
this.isSaving = false;
|
||||
}).catch(()=>{
|
||||
this.isSaving = false;
|
||||
})
|
||||
}else{
|
||||
this.$API.vm.visit.create.req(this.form).then(res=>{
|
||||
this.visitid = res.id;
|
||||
this.$message.success("项目创建成功");
|
||||
this.getInit();
|
||||
this.active = 1;
|
||||
this.isSaving = false;
|
||||
}).catch(()=>{
|
||||
this.isSaving = false;
|
||||
})
|
||||
methods: {
|
||||
imagesDel(index){
|
||||
//合并新增的图片Ids
|
||||
this.form.vehicle_photos.splice(index,1)
|
||||
//console.log(this.form.create_imgs)
|
||||
},
|
||||
imagesChange(data){
|
||||
// debugger;
|
||||
// console.log(data)
|
||||
//合并新增的图片Ids
|
||||
if(this.form.vehicle_photos){
|
||||
this.form.vehicle_photos = this.form.vehicle_photos.concat(data);
|
||||
}else{
|
||||
this.form.vehicle_photos = data;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
selectedAddress(data){
|
||||
// debugger;
|
||||
console.log(data)
|
||||
this.formpeople.come_place=data;
|
||||
},
|
||||
//访问项目基本信息
|
||||
getRpj() {
|
||||
this.$API.vm.visit.read.req(this.visitid).then((res) => {
|
||||
this.form = res;
|
||||
let imgsLset =[];
|
||||
if(res.vehicle_photos_.length>0){
|
||||
for(let i=0;i<res.vehicle_photos_.length;i++){
|
||||
imgsLset.push(res.vehicle_photos_[i].path)
|
||||
}
|
||||
this.fileurl2 =imgsLset.join(",");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.active = 1;
|
||||
}
|
||||
// this.stepSuc.push(++this.active)
|
||||
},
|
||||
//退出界面
|
||||
submitOut() {
|
||||
this.$router.push({
|
||||
name: "visit",
|
||||
query: {},
|
||||
});
|
||||
},
|
||||
//添加
|
||||
add() {
|
||||
this.dialogpeople = true;
|
||||
},
|
||||
|
||||
//项目访客人员
|
||||
getpeoplelistlist() {
|
||||
this.$API.vm.people.list
|
||||
.req({ visit: this.visitid, page: 0 })
|
||||
.then((res) => {
|
||||
this.peoplelist = res;
|
||||
},
|
||||
getReceptionist(data) {
|
||||
// 子组件调用父组件的方法并传参
|
||||
this.form.receptionist=data.id;
|
||||
this.form.receptionist_name=data.name
|
||||
},
|
||||
//接待人
|
||||
//渲染工单提交按钮
|
||||
getInit(){
|
||||
this.$API.wf.workflow.initkey.req('visit').then((res) => {
|
||||
this.initform = res;
|
||||
|
||||
});
|
||||
},
|
||||
},
|
||||
handleStep(val) {
|
||||
//点击步骤条
|
||||
if (this.stepSuc.includes(val) === true) {
|
||||
this.active = val;
|
||||
}
|
||||
},
|
||||
//组件点击上一步
|
||||
handleLastStep() {
|
||||
if (--this.active === 0) {
|
||||
this.active = 0;
|
||||
}
|
||||
},
|
||||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
debugger;
|
||||
console.log(this.form)
|
||||
if (this.active == 0) {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaving = true;
|
||||
if(this.visitid){
|
||||
this.$API.vm.visit.update
|
||||
.req(this.visitid, this.form)
|
||||
.then((res) => {
|
||||
this.$message.success("基本信息更新成功");
|
||||
this.getInit();
|
||||
this.active = 1;
|
||||
this.isSaving = false;
|
||||
}).catch(()=>{
|
||||
this.isSaving = false;
|
||||
})
|
||||
}else{
|
||||
this.$API.vm.visit.create.req(this.form).then(res=>{
|
||||
this.visitid = res.id;
|
||||
this.$message.success("项目创建成功");
|
||||
this.getInit();
|
||||
this.active = 1;
|
||||
this.isSaving = false;
|
||||
}).catch(()=>{
|
||||
this.isSaving = false;
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.active = 1;
|
||||
}
|
||||
// this.stepSuc.push(++this.active)
|
||||
},
|
||||
//退出界面
|
||||
submitOut() {
|
||||
this.$router.push({
|
||||
name: "visit",
|
||||
query: {},
|
||||
});
|
||||
},
|
||||
//添加
|
||||
add() {
|
||||
this.dialogpeople = true;
|
||||
},
|
||||
|
||||
//我的访客
|
||||
getvisitorlist() {
|
||||
this.$API.vm.visitor.list.req({ page: 0 }).then((res) => {
|
||||
this.visitoroptions = res;
|
||||
});
|
||||
},
|
||||
//表单提交方法
|
||||
submitpeople() {
|
||||
let that = this;
|
||||
that.formpeople.visit = this.visitid;
|
||||
let addressObj = that.formpeople.come_place;
|
||||
let addressStr = '';
|
||||
that.formpeople.come_place = '';
|
||||
for(let key in addressObj){
|
||||
addressStr =addressStr+addressObj[key];
|
||||
}
|
||||
that.formpeople.come_place = addressStr;
|
||||
// debugger;
|
||||
console.log(addressStr)
|
||||
that.$refs.formpeople.validate((valid) => {
|
||||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
that.$API.vm.people.create
|
||||
.req(that.formpeople)
|
||||
//项目访客人员
|
||||
getpeoplelistlist() {
|
||||
this.$API.vm.people.list
|
||||
.req({ visit: this.visitid, page: 0 })
|
||||
.then((res) => {
|
||||
that.$message.success("创建成功");
|
||||
that.dialogpeople = false;
|
||||
that.isSaveing = false;
|
||||
this.peoplelist = res;
|
||||
});
|
||||
},
|
||||
|
||||
//我的访客
|
||||
getvisitorlist() {
|
||||
this.$API.vm.visitor.list.req({ page: 0 }).then((res) => {
|
||||
this.visitoroptions = res;
|
||||
});
|
||||
},
|
||||
//表单提交方法
|
||||
submitpeople() {
|
||||
let that = this;
|
||||
that.formpeople.visit = this.visitid;
|
||||
let addressObj = that.formpeople.come_place;
|
||||
let addressStr = '';
|
||||
that.formpeople.come_place = '';
|
||||
for(let key in addressObj){
|
||||
addressStr =addressStr+addressObj[key];
|
||||
}
|
||||
that.formpeople.come_place = addressStr;
|
||||
// debugger;
|
||||
console.log(addressStr)
|
||||
that.$refs.formpeople.validate((valid) => {
|
||||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
that.$API.vm.people.create
|
||||
.req(that.formpeople)
|
||||
.then((res) => {
|
||||
that.$message.success("创建成功");
|
||||
that.dialogpeople = false;
|
||||
that.isSaveing = false;
|
||||
this.getpeoplelistlist();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
that.isSaveing = false;
|
||||
return err;
|
||||
});
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除访客信息
|
||||
table_del(row) {
|
||||
this.$API.vm.people.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("访客删除成功");
|
||||
this.getpeoplelistlist();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
that.isSaveing = false;
|
||||
return err;
|
||||
});
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除访客信息
|
||||
table_del(row) {
|
||||
this.$API.vm.people.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("访客删除成功");
|
||||
this.getpeoplelistlist();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
},
|
||||
//提交工单
|
||||
submitticket(id){
|
||||
this.ticket={};
|
||||
this.isSaving = true;
|
||||
this.ticket.title = this.form.name;
|
||||
this.ticket.workflow=this.initform.workflow;
|
||||
this.ticket.ticket_data={visit:this.visitid,name:this.form.name};
|
||||
this.ticket.transition=id;
|
||||
},
|
||||
//提交工单
|
||||
submitticket(id){
|
||||
this.ticket={};
|
||||
this.isSaving = true;
|
||||
this.ticket.title = this.form.name;
|
||||
this.ticket.workflow=this.initform.workflow;
|
||||
this.ticket.ticket_data={visit:this.visitid,name:this.form.name};
|
||||
this.ticket.transition=id;
|
||||
|
||||
if(this.form.ticket!= null&&this.form.ticket!= undefined){
|
||||
this.$API.wf.ticket.ticketHandle.req(this.form.ticket,this.ticket).then((res) => {
|
||||
this.isSaving=false
|
||||
this.$message.success("提交成功");
|
||||
this.$router.push({
|
||||
name: "visit",
|
||||
query: {},
|
||||
});
|
||||
}).catch(e=>{this.isSaving=false});
|
||||
}else{
|
||||
this.$API.wf.ticket.create.req(this.ticket).then((res) => {
|
||||
this.isSaving=false
|
||||
this.$message.success("提交成功");
|
||||
this.$router.push({
|
||||
name: "visit",
|
||||
query: {},
|
||||
});
|
||||
}).catch(e=>{this.isSaving=false});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
if(this.form.ticket!= null&&this.form.ticket!= undefined){
|
||||
this.$API.wf.ticket.ticketHandle.req(this.form.ticket,this.ticket).then((res) => {
|
||||
this.isSaving=false
|
||||
this.$message.success("提交成功");
|
||||
this.$router.push({
|
||||
name: "visit",
|
||||
query: {},
|
||||
});
|
||||
}).catch(e=>{this.isSaving=false});
|
||||
}else{
|
||||
this.$API.wf.ticket.create.req(this.ticket).then((res) => {
|
||||
this.isSaving=false
|
||||
this.$message.success("提交成功");
|
||||
this.$router.push({
|
||||
name: "visit",
|
||||
query: {},
|
||||
});
|
||||
}).catch(e=>{this.isSaving=false});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue