修改默认值问题

master
CJYXTX\27961 7 months ago
parent 54a8ae8754
commit 6ca355024e

@ -63,4 +63,7 @@ public class HousingEstateEntity {
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField(value = "ENTERPRISE_ID" , updateStrategy = FieldStrategy.IGNORED)
private String enterpriseId;
}

@ -47,4 +47,8 @@ public class HousingEstateForm {
/** 来源 **/
@JsonProperty("sourceType")
private Object sourceType;
/** 企业 **/
@JsonProperty("enterpriseId")
private Object enterpriseId;
}

@ -76,7 +76,7 @@
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<!-- <el-col :span="8">
<jnpf-form-tip-item label="回收站名称" prop="stationName">
<JnpfInput
v-model="dataForm.stationName"
@ -87,10 +87,11 @@
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
</el-col> -->
<el-col :span="8">
<jnpf-form-tip-item label="企业公司" prop="enterpriseId">
<!-- {{ this.$store.getters.userInfo.organizeId }} -->
<jnpf-form-tip-item label="所属商户" prop="enterpriseId">
<JnpfDepSelect
v-model="dataForm.enterpriseId"
@change="changeData('enterpriseId', -1)"
@ -98,12 +99,29 @@
selectType="all"
:ableIds="ableAll.enterpriseIdableIds"
clearable
disabled="true"
:style="{ width: '100%' }"
>
</JnpfDepSelect>
</jnpf-form-tip-item>
</el-col>
<!-- <el-col :span="8">
<jnpf-form-tip-item label="所属商户" prop="enterpriseId">
<JnpfOrganizeSelect
v-model="dataForm.enterpriseId"
@change="changeData('enterpriseId', -1)"
placeholder="请选择"
selectType="all"
:ableIds="ableAll.enterpriseIdableIds"
disabled
clearable
:style="{ width: '100%' }"
>
</JnpfOrganizeSelect>
</jnpf-form-tip-item>
</el-col> -->
<el-col :span="8">
<jnpf-form-tip-item
class="site-item"
@ -281,87 +299,6 @@
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<!-- <el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>价格配置</h2>
</div>
<el-table :data="dataForm.recycleStationPriceList" size="mini">
<el-table-column
type="index"
width="50"
label="序号"
align="center"
/>
<el-table-column label="回收类目" prop="recycleTypeId">
<template slot="header" v-if="false">
<span class="required-sign">*</span>回收类目
</template>
<template slot-scope="scope">
<JnpfSelect
v-model="scope.row.recycleTypeId"
@change="
changeData(
'recyclestationprice-recycleTypeId',
scope.$index
)
"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
:options="recyclestationpricerecycleTypeIdOptions"
:props="recyclestationpricerecycleTypeIdProps"
>
</JnpfSelect>
</template>
</el-table-column>
<el-table-column label="单价(kg)" prop="unitPrice">
<template slot="header" v-if="false">
<span class="required-sign">*</span>单价(kg)
</template>
<template slot-scope="scope">
<JnpfInput
v-model="scope.row.unitPrice"
@change="
changeData(
'recyclestationprice-unitPrice',
scope.$index
)
"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
class="JNPF-table-delBtn"
@click="delrecycleStationPriceList(scope.$index)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div
class="table-actions"
@click="addrecycleStationPriceList()"
>
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
</el-col> -->
<el-col :span="24">
<jnpf-form-tip-item>
@ -656,7 +593,7 @@ export default {
Vmodel: "",
currVmodel: "",
dataForm: {
enterpriseId: [],
enterpriseId: undefined,
stationCode: undefined,
stationName: undefined,
address: undefined, //
@ -1096,7 +1033,10 @@ export default {
this.dataForm.enterpriseId = this.userInfo.organizeIdList;
}
this.dataForm.firstContactPerson = this.userInfo.userId;
if(this.$store.getters.userInfo.organizeId && this.$store.getters.userInfo.organizeId != null){
if (
this.$store.getters.userInfo.organizeId &&
this.$store.getters.userInfo.organizeId != null
) {
this.dataForm.enterpriseId = this.$store.getters.userInfo.organizeId;
}
},

@ -762,6 +762,7 @@ export default {
addOrUpdateHandle(row, isDetail) {
let id = row ? row.id : "";
this.formVisible = true;
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail, this.list);
});

@ -5,34 +5,60 @@
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack" :content="!dataForm.id ? '新建':'编辑'" />
<el-page-header
@back="goBack"
:content="!dataForm.id ? '新建' : '编辑'"
/>
<div class="options">
<el-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px">
<el-button style="width: 70px">
<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
{{'上一条'}}
<el-dropdown-item @click.native="prev" :disabled="prevDis">
{{ "上一条" }}
</el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled='nextDis'>
{{'下一条'}}
<el-dropdown-item @click.native="next" :disabled="nextDis">
{{ "下一条" }}
</el-dropdown-item>
</template>
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)"
:loading="continueBtnLoading" :disabled='btnLoading'>
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item>
<el-dropdown-item
type="primary"
@click.native="dataFormSubmit(2)"
:loading="continueBtnLoading"
:disabled="btnLoading"
>
{{
!dataForm.id ? "确定并新增" : "确定并继续"
}}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"
:disabled='continueBtnLoading'> </el-button>
<el-button
type="primary"
@click="dataFormSubmit()"
:loading="btnLoading"
:disabled="continueBtnLoading"
>
</el-button
>
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="default"
label-width="100px" label-position="right">
<el-row
:gutter="15"
class="main"
:style="{ margin: '0 auto', width: '100%' }"
>
<el-form
ref="formRef"
:model="dataForm"
:rules="dataRule"
size="default"
label-width="100px"
label-position="right"
>
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="24">
@ -43,22 +69,53 @@
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="小区名" prop="name">
<JnpfInput v-model="dataForm.name" @change="changeData('name',-1)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
<JnpfInput
v-model="dataForm.name"
@change="changeData('name', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<!-- {{ this.$store.getters.userInfo.organizeId }} -->
<jnpf-form-tip-item label="所属商户" prop="enterpriseId">
<JnpfDepSelect
v-model="dataForm.enterpriseId"
@change="changeData('enterpriseId', -1)"
placeholder="请选择"
selectType="all"
:ableIds="ableAll.enterpriseIdableIds"
clearable
disabled="true"
:style="{ width: '100%' }"
>
</JnpfDepSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="10">
<jnpf-form-tip-item label="小区详细地址" prop="address">
<JnpfInput v-model="dataForm.address" @change="changeData('address',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
<JnpfInput
v-model="dataForm.address"
@change="changeData('address', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="启用禁用" prop="enabledMark">
<JnpfSwitch v-model="dataForm.enabledMark" @change="changeData('enabledMark',-1)"
:active-value="1" :inactive-value="0">
<JnpfSwitch
v-model="dataForm.enabledMark"
@change="changeData('enabledMark', -1)"
:active-value="1"
:inactive-value="0"
>
</JnpfSwitch>
</jnpf-form-tip-item>
</el-col>
@ -84,54 +141,87 @@
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="定时定点回收" prop="hasSchedule">
<JnpfSwitch v-model="dataForm.hasSchedule" @change="changeData('hasSchedule',-1)"
:active-value="1" :inactive-value="0">
<JnpfSwitch
v-model="dataForm.hasSchedule"
@change="changeData('hasSchedule', -1)"
:active-value="1"
:inactive-value="0"
>
</JnpfSwitch>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="回收地址" prop="recycleAddress">
<JnpfInput v-model="dataForm.recycleAddress"
@change="changeData('recycleAddress',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}'>
<JnpfInput
v-model="dataForm.recycleAddress"
@change="changeData('recycleAddress', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="回收时间起" prop="appointmentTimeStart">
<JnpfTimePicker v-model="dataForm.appointmentTimeStart"
@change="changeData('appointmentTimeStart',-1)"
:startTime="time(false,1,1,'','HH:mm','')"
:endTime="time(false,1,1,'','HH:mm','')" placeholder="请选择" clearable
:style='{"width":"100%"}' format="HH:mm">
<jnpf-form-tip-item
label="回收时间起"
prop="appointmentTimeStart"
>
<JnpfTimePicker
v-model="dataForm.appointmentTimeStart"
@change="changeData('appointmentTimeStart', -1)"
:startTime="time(false, 1, 1, '', 'HH:mm', '')"
:endTime="time(false, 1, 1, '', 'HH:mm', '')"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
format="HH:mm"
>
</JnpfTimePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="回收时间止" prop="appointmentTimeEnd">
<JnpfTimePicker v-model="dataForm.appointmentTimeEnd"
@change="changeData('appointmentTimeEnd',-1)"
:startTime="time(false,1,1,'','HH:mm','')"
:endTime="time(false,1,1,'','HH:mm','')" placeholder="请选择" clearable
:style='{"width":"100%"}' format="HH:mm">
<JnpfTimePicker
v-model="dataForm.appointmentTimeEnd"
@change="changeData('appointmentTimeEnd', -1)"
:startTime="time(false, 1, 1, '', 'HH:mm', '')"
:endTime="time(false, 1, 1, '', 'HH:mm', '')"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
format="HH:mm"
>
</JnpfTimePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="来源" prop="sourceType">
<JnpfSelect v-model="dataForm.sourceType" @change="changeData('sourceType',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="sourceTypeOptions"
:props="sourceTypeProps">
<JnpfSelect
v-model="dataForm.sourceType"
@change="changeData('sourceType', -1)"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
:options="sourceTypeOptions"
:props="sourceTypeProps"
>
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
<SelectDialog
v-if="selectDialogVisible"
:config="currTableConf"
:formData="dataForm"
ref="selectDialog"
@select="addForSelect"
@close="selectDialogVisible = false"
/>
</el-row>
</div>
</transition>
@ -139,14 +229,20 @@
<script>
import request from '@/utils/request'
import request from "@/utils/request";
import { mapGetters } from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index"
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
import { getDefaultCurrentValueUserId } from "@/api/permission/user";
import { getDefaultCurrentValueDepartmentId } from "@/api/permission/organize";
import {
getDateDay,
getLaterData,
getBeforeData,
getBeforeTime,
getLaterTime,
} from "@/components/Generator/utils/index.js";
import { thousandsFormat } from "@/components/Generator/utils/index";
export default {
components: {},
props: [],
@ -161,23 +257,21 @@ export default {
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
formRef: "formRef",
setting: {},
eventType: '',
eventType: "",
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {
},
addTableConf: {},
//
ableAll: {
},
tableRows: {
},
ableAll: {},
tableRows: {},
Vmodel: "",
currVmodel: "",
dataForm: {
enterpriseId: undefined,
name: undefined,
address: undefined,
enabledMark: 1,
@ -190,21 +284,31 @@ export default {
sourceType: "1",
},
tableRequiredData: {},
dataRule:
{
dataRule: {
name: [
{
required: true,
message: '请输入',
trigger: 'blur'
message: "请输入",
trigger: "blur",
},
],
enterpriseId: [
{
required: true,
message: "请输入",
trigger: "change",
},
sourceTypeOptions: [{ "fullName": "系统导入", "id": "1" }, { "fullName": "用户自定义", "id": "2" }],
sourceTypeProps: { "label": "fullName", "value": "id" },
],
},
sourceTypeOptions: [
{ fullName: "系统导入", id: "1" },
{ fullName: "用户自定义", id: "2" },
],
sourceTypeProps: { label: "fullName", value: "id" },
childIndex: -1,
isEdit: false,
interfaceRes: {
enterpriseId: [],
name: [],
address: [],
enabledMark: [],
@ -216,60 +320,60 @@ export default {
appointmentTimeEnd: [],
sourceType: [],
},
}
};
},
computed: {
...mapGetters(['userInfo'])
...mapGetters(["userInfo"]),
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
this.dataAll();
this.initDefaultData();
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm));
},
mounted() { },
mounted() {},
methods: {
prev() {
this.index--
this.index--;
if (this.index === 0) {
this.prevDis = true
this.prevDis = true;
}
this.nextDis = false
this.nextDis = false;
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
this.getInfo(element.id);
}
}
},
next() {
this.index++
this.index++;
if (this.index === this.allList.length - 1) {
this.nextDis = true
this.nextDis = true;
}
this.prevDis = false
this.prevDis = false;
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
this.getInfo(element.id);
}
}
},
getInfo(id) {
request({
url: '/api/scm/HousingEstate/' + id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
url: "/api/scm/HousingEstate/" + id,
method: "get",
}).then((res) => {
this.dataInfo(res.data);
});
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
this.visible = false;
this.$emit("refreshDataList", true);
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
this.isEdit = false;
this.childIndex = index;
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
@ -277,14 +381,14 @@ export default {
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
let faceReList = this.interfaceRes[key];
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
let options = "get" + key + "Options";
if (this[options]) {
this[options]()
this[options]();
}
this.changeData(key, index)
this.changeData(key, index);
}
}
}
@ -295,205 +399,221 @@ export default {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
this.dataForm[data][i][model] = defaultValue;
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
this.dataForm[data][i][model] = defaultValue;
}
}
} else {
this.dataForm[data] = defaultValue
this.dataForm[data] = defaultValue;
}
}
},
dataAll() {
},
dataAll() {},
goBack() {
this.$emit('refresh')
this.$emit("refresh");
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll));
},
init(id, isDetail, allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
this.prevDis = false;
this.nextDis = false;
this.allList = allList || [];
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
this.index = this.allList.findIndex((item) => item.id === id);
if (this.index == 0) {
this.prevDis = true
this.prevDis = true;
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
this.nextDis = true;
}
} else {
this.prevDis = true
this.nextDis = true
this.prevDis = true;
this.nextDis = true;
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
this.loading = true;
request({
url: '/api/scm/HousingEstate/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
url: "/api/scm/HousingEstate/" + this.dataForm.id,
method: "get",
}).then((res) => {
this.dataInfo(res.data);
this.loading = false;
});
} else {
this.clearData()
this.initDefaultData()
this.clearData();
this.initDefaultData();
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
this.$store.commit("generator/UPDATE_RELATION_DATA", {});
},
//
initDefaultData() {
if (
this.userInfo.organizeIdList instanceof Array &&
this.userInfo.organizeIdList.length > 0
) {
this.dataForm.enterpriseId = this.userInfo.organizeIdList;
}
this.dataForm.firstContactPerson = this.userInfo.userId;
if (
this.$store.getters.userInfo.organizeId &&
this.$store.getters.userInfo.organizeId != null
) {
this.dataForm.enterpriseId = this.$store.getters.userInfo.organizeId;
}
},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
this.dataFormSubmitType = type ? type : 0;
this.$refs["formRef"].validate((valid) => {
if (valid) {
this.request()
this.request();
}
})
});
},
request() {
let _data = this.dataList()
let _data = this.dataList();
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
this.continueBtnLoading = true;
} else {
this.btnLoading = true
this.btnLoading = true;
}
if (!this.dataForm.id) {
request({
url: '/api/scm/HousingEstate',
method: 'post',
data: _data
}).then((res) => {
url: "/api/scm/HousingEstate",
method: "post",
data: _data,
})
.then((res) => {
this.$message({
message: res.msg,
type: 'success',
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
}
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
this.clearData();
this.initDefaultData();
});
this.continueBtnLoading = false;
return;
}
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
},
});
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
} else {
request({
url: '/api/scm/HousingEstate/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
url: "/api/scm/HousingEstate/" + this.dataForm.id,
method: "PUT",
data: _data,
})
.then((res) => {
this.$message({
message: res.msg,
type: 'success',
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
if (this.dataFormSubmitType == 2)
return (this.continueBtnLoading = false);
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
},
});
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
}
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.selectDialogVisible = true
this.currTableConf = this.addTableConf[key];
this.currVmodel = key;
this.selectDialogVisible = true;
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
this.$refs.selectDialog.init();
});
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
let t = data[i];
if (this["get" + this.currVmodel]) {
this["get" + this.currVmodel](t);
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
let timeValue = Number(timeValueData);
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
timeDataValue = timeValue;
} else if (timeType == 2) {
timeDataValue = dataValue
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
timeDataValue = new Date().getTime();
} else if (timeType == 4) {
let previousDate = '';
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
previousDate = getBeforeData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime();
}
} else if (timeType == 5) {
let previousDate = '';
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
previousDate = getLaterData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
timeDataValue = getLaterTime(timeTarget, timeValue).getTime();
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
let format = formatType == "HH:mm" ? "HH:mm:00" : formatType;
let timeDataValue = null;
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
timeDataValue = timeValue || "00:00:00";
if (timeDataValue.split(":").length == 3) {
timeDataValue = timeDataValue;
} else {
timeDataValue = timeDataValue + ':00'
timeDataValue = timeDataValue + ":00";
}
} else if (timeType == 2) {
timeDataValue = dataValue
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
timeDataValue = this.jnpf.toDate(new Date(), format);
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
let previousDate = "";
previousDate = getBeforeTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
let previousDate = "";
previousDate = getLaterTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
}
}
return timeDataValue;
@ -503,13 +623,12 @@ export default {
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex = -1
let _dataAll = dataAll;
this.dataForm = _dataAll;
this.isEdit = true;
this.dataAll();
this.childIndex = -1;
},
},
}
};
</script>

@ -79,7 +79,7 @@
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<!-- <el-col :span="8">
<jnpf-form-tip-item label="报价方" prop="buinessId">
<JnpfOrganizeSelect
v-model="dataForm.buinessId"
@ -92,7 +92,24 @@
>
</JnpfOrganizeSelect>
</jnpf-form-tip-item>
</el-col> -->
<el-col :span="8">
<jnpf-form-tip-item label="报价方" prop="buinessId">
<JnpfDepSelect
v-model="dataForm.buinessId"
@change="changeData('buinessId', -1)"
placeholder="请选择"
selectType="all"
:ableIds="ableAll.buinessId"
clearable
disabled="true"
:style="{ width: '100%' }"
>
</JnpfDepSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="价格类型" prop="priceType">
<JnpfSelect
@ -669,6 +686,13 @@ export default {
) {
this.dataForm.buinessId = this.userInfo.organizeIdList;
}
this.dataForm.firstContactPerson = this.userInfo.userId;
if (
this.$store.getters.userInfo.organizeId &&
this.$store.getters.userInfo.organizeId != null
) {
this.dataForm.buinessId = this.$store.getters.userInfo.organizeId;
}
},
//
dataFormSubmit(type) {

@ -2,97 +2,156 @@
<template>
<el-dialog :title="!dataForm.id ? '新建' :'编辑'"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-dialog
:title="!dataForm.id ? '新建' : '编辑'"
:close-on-click-modal="false"
append-to-body
:visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center"
lock-scroll
width="600px"
>
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" >
<el-form
ref="formRef"
:model="dataForm"
:rules="dataRule"
size="small"
label-width="100px"
label-position="right"
>
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="12" >
<jnpf-form-tip-item
label="编码" prop="code" >
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)"
placeholder="系统自动生成" readonly :style='{"width":"100%"}'>
<el-col :span="12">
<jnpf-form-tip-item label="编码" prop="code">
<JnpfInput
v-model="dataForm.code"
@change="changeData('code', -1)"
placeholder="系统自动生成"
readonly
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item
label="名称" prop="name" >
<JnpfInput v-model="dataForm.name" @change="changeData('name',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-col :span="12">
<jnpf-form-tip-item label="名称" prop="name">
<JnpfInput
v-model="dataForm.name"
@change="changeData('name', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item
label="规格" prop="spec" >
<JnpfInput v-model="dataForm.spec" @change="changeData('spec',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-col :span="12">
<jnpf-form-tip-item label="规格" prop="spec">
<JnpfInput
v-model="dataForm.spec"
@change="changeData('spec', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item
label="库存单位" prop="unit" >
<JnpfSelect v-model="dataForm.unit" @change="changeData('unit',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="unitOptions" :props="unitProps" >
<el-col :span="12">
<jnpf-form-tip-item label="库存单位" prop="unit">
<JnpfSelect
v-model="dataForm.unit"
@change="changeData('unit', -1)"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
:options="unitOptions"
:props="unitProps"
>
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="描述" prop="description" >
<JnpfInput v-model="dataForm.description" @change="changeData('description',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-col :span="24">
<jnpf-form-tip-item label="描述" prop="description">
<JnpfInput
v-model="dataForm.description"
@change="changeData('description', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="图片" prop="photo" >
<JnpfUploadImg v-model="dataForm.photo" @change="changeData('photo',-1)"
:fileSize="10" sizeUnit="MB" :limit="1" pathType="defaultPath" :isAccount="0" >
<el-col :span="24">
<jnpf-form-tip-item label="图片" prop="photo">
<JnpfUploadImg
v-model="dataForm.photo"
@change="changeData('photo', -1)"
:fileSize="10"
sizeUnit="MB"
:limit="1"
pathType="defaultPath"
:isAccount="0"
>
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/>
<SelectDialog
v-if="selectDialogVisible"
:config="currTableConf"
:formData="dataForm"
ref="selectDialog"
@select="addForSelect"
@close="selectDialogVisible = false"
/>
</el-row>
<span slot="footer" class="dialog-footer">
<div class="upAndDown-button" v-if="dataForm.id">
<el-button @click="prev" :disabled='prevDis'>
{{'上一条'}}
<el-button @click="prev" :disabled="prevDis">
{{ "上一条" }}
</el-button>
<el-button @click="next" :disabled='nextDis'>
{{'下一条'}}
<el-button @click="next" :disabled="nextDis">
{{ "下一条" }}
</el-button>
</div>
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-button>
<el-button
type="primary"
@click="dataFormSubmit(2)"
:loading="continueBtnLoading"
>
{{ !dataForm.id ? "确定并新增" : "确定并继续" }}</el-button
>
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading">
</el-button
>
</span>
</el-dialog>
</template>
</template>
<script>
import request from '@/utils/request'
import {mapGetters} from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { },
import request from "@/utils/request";
import { mapGetters } from "vuex";
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
import { getDefaultCurrentValueUserId } from "@/api/permission/user";
import { getDefaultCurrentValueDepartmentId } from "@/api/permission/organize";
import {
getDateDay,
getLaterData,
getBeforeData,
getBeforeTime,
getLaterTime,
} from "@/components/Generator/utils/index.js";
import { thousandsFormat } from "@/components/Generator/utils/index";
export default {
components: {},
props: [],
data() {
return {
@ -105,137 +164,137 @@
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting:{},
eventType: '',
userBoxVisible:false,
formRef: "formRef",
setting: {},
eventType: "",
userBoxVisible: false,
selectDialogVisible: false,
currTableConf:{},
dataValueAll:{},
addTableConf:{
},
currTableConf: {},
dataValueAll: {},
addTableConf: {},
//
ableAll:{
},
tableRows:{
},
Vmodel:"",
currVmodel:"",
ableAll: {},
tableRows: {},
Vmodel: "",
currVmodel: "",
dataForm: {
code : undefined,
name : undefined,
spec : undefined,
unit : undefined,
description : undefined,
creatorTime : undefined,
creatorUserId : undefined,
lastModifyTime : undefined,
lastModifyUserId : undefined,
photo : [],
code: undefined,
name: undefined,
spec: undefined,
unit: undefined,
description: undefined,
creatorTime: undefined,
creatorUserId: undefined,
lastModifyTime: undefined,
lastModifyUserId: undefined,
photo: [],
version: 0,
},
tableRequiredData: {},
dataRule:
{
dataRule: {
name: [
{
required: true,
message: '请输入',
trigger: 'blur'
message: "请输入",
trigger: "blur",
},
],
spec: [
{
required: true,
message: '请输入',
trigger: 'blur'
message: "请输入",
trigger: "blur",
},
],
unit: [
{
required: true,
message: '请选择',
trigger: 'change'
message: "请选择",
trigger: "change",
},
],
photo: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
message: "请至少选择一个",
trigger: "change",
},
],
},
unitOptions:[{"fullName":"克","id":"1"},{"fullName":"千克","id":"2"},{"fullName":"吨","id":"3"}],
unitProps:{"label":"fullName","value":"id" },
childIndex:-1,
isEdit:false,
unitOptions: [
{ fullName: "克", id: "1" },
{ fullName: "千克", id: "2" },
{ fullName: "吨", id: "3" },
],
unitProps: { label: "fullName", value: "id" },
childIndex: -1,
isEdit: false,
interfaceRes: {
code:[] ,
name:[] ,
spec:[] ,
unit:[] ,
description:[] ,
creatorTime:[] ,
creatorUserId:[] ,
lastModifyTime:[] ,
lastModifyUserId:[] ,
photo:[] ,
},
}
code: [],
name: [],
spec: [],
unit: [],
description: [],
creatorTime: [],
creatorUserId: [],
lastModifyTime: [],
lastModifyUserId: [],
photo: [],
},
};
},
computed: {
...mapGetters(['userInfo'])
...mapGetters(["userInfo"]),
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
this.dataAll();
this.initDefaultData();
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm));
},
mounted() {},
methods: {
prev() {
this.index--
this.index--;
if (this.index === 0) {
this.prevDis = true
this.prevDis = true;
}
this.nextDis = false
this.nextDis = false;
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
this.getInfo(element.id);
}
}
},
next() {
this.index++
this.index++;
if (this.index === this.allList.length - 1) {
this.nextDis = true
this.nextDis = true;
}
this.prevDis = false
this.prevDis = false;
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
this.getInfo(element.id);
}
}
},
getInfo(id) {
request({
url: '/api/scm/NxProduct/'+ id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
url: "/api/scm/NxProduct/" + id,
method: "get",
}).then((res) => {
this.dataInfo(res.data);
});
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
this.visible = false;
this.$emit("refreshDataList", true);
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
this.isEdit = false;
this.childIndex = index;
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
@ -243,236 +302,237 @@
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
let faceReList = this.interfaceRes[key];
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if(this[options]){
this[options]()
let options = "get" + key + "Options";
if (this[options]) {
this[options]();
}
this.changeData(key, index)
this.changeData(key, index);
}
}
}
}
},
changeDataFormData(type, data, model,index,defaultValue) {
if(!this.isEdit) {
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
this.dataForm[data][i][model] = defaultValue;
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
this.dataForm[data][i][model] = defaultValue;
}
}
} else {
this.dataForm[data] = defaultValue
this.dataForm[data] = defaultValue;
}
}
},
dataAll(){
},
clearData(){
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
dataAll() {},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll));
},
init(id,isDetail,allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
init(id, isDetail, allList) {
this.prevDis = false;
this.nextDis = false;
this.allList = allList || [];
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
this.index = this.allList.findIndex((item) => item.id === id);
if (this.index == 0) {
this.prevDis = true
this.prevDis = true;
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
this.nextDis = true;
}
} else {
this.prevDis = true
this.nextDis = true
this.prevDis = true;
this.nextDis = true;
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
if (this.dataForm.id) {
this.loading = true;
request({
url: '/api/scm/NxProduct/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
url: "/api/scm/NxProduct/" + this.dataForm.id,
method: "get",
}).then((res) => {
this.dataInfo(res.data);
this.loading = false;
});
}else{
this.clearData()
this.initDefaultData()
} else {
this.clearData();
this.initDefaultData();
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
this.$store.commit("generator/UPDATE_RELATION_DATA", {});
},
//
initDefaultData() {
},
initDefaultData() {},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
this.dataFormSubmitType = type ? type : 0;
this.$refs["formRef"].validate((valid) => {
if (valid) {
this.request()
this.request();
}
})
});
},
request() {
let _data =this.dataList()
let _data = this.dataList();
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
this.continueBtnLoading = true;
} else {
this.btnLoading = true
this.btnLoading = true;
}
if (!this.dataForm.id) {
request({
url: '/api/scm/NxProduct',
method: 'post',
data: _data
}).then((res) => {
url: "/api/scm/NxProduct",
method: "post",
data: _data,
})
.then((res) => {
this.$message({
message: res.msg,
type: 'success',
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
}
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
this.clearData();
this.initDefaultData();
});
this.continueBtnLoading = false;
return;
}
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
},
});
})
}).catch(()=>{
this.btnLoading = false
this.continueBtnLoading = false
})
}else{
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
} else {
request({
url: '/api/scm/NxProduct/'+this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
url: "/api/scm/NxProduct/" + this.dataForm.id,
method: "PUT",
data: _data,
})
.then((res) => {
this.$message({
message: res.msg,
type: 'success',
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(()=>{
this.btnLoading = false
this.continueBtnLoading = false
if (this.dataFormSubmitType == 2)
return (this.continueBtnLoading = false);
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
},
});
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
}
},
openSelectDialog(key) {
this.currTableConf=this.addTableConf[key]
this.currVmodel=key
this.selectDialogVisible = true
this.currTableConf = this.addTableConf[key];
this.currVmodel = key;
this.selectDialogVisible = true;
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
this.$refs.selectDialog.init();
});
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if(this['get'+this.currVmodel]){
this['get'+this.currVmodel](t)
let t = data[i];
if (this["get" + this.currVmodel]) {
this["get" + this.currVmodel](t);
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
let timeValue = Number(timeValueData);
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
timeDataValue = timeValue;
} else if (timeType == 2) {
timeDataValue = dataValue
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
timeDataValue = new Date().getTime();
} else if (timeType == 4) {
let previousDate = '';
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
previousDate = getBeforeData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime();
}
} else if (timeType == 5) {
let previousDate = '';
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
previousDate = getLaterData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
timeDataValue = getLaterTime(timeTarget, timeValue).getTime();
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
let format = formatType == "HH:mm" ? "HH:mm:00" : formatType;
let timeDataValue = null;
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
timeDataValue = timeValue || "00:00:00";
if (timeDataValue.split(":").length == 3) {
timeDataValue = timeDataValue;
} else {
timeDataValue = timeDataValue + ':00'
timeDataValue = timeDataValue + ":00";
}
} else if (timeType == 2) {
timeDataValue = dataValue
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
timeDataValue = this.jnpf.toDate(new Date(), format);
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
let previousDate = "";
previousDate = getBeforeTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
let previousDate = "";
previousDate = getLaterTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
}
}
return timeDataValue;
},
dataList(){
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex=-1
dataInfo(dataAll) {
let _dataAll = dataAll;
this.dataForm = _dataAll;
this.isEdit = true;
this.dataAll();
this.childIndex = -1;
},
},
}
};
</script>

@ -2,91 +2,159 @@
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main org-form">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack"
:content="!dataForm.id ? $t(`Organize.addCompany`) : $t(`Organize.editCompany`)" />
<el-page-header
@back="goBack"
:content="
!dataForm.id
? $t(`Organize.addCompany`)
: $t(`Organize.editCompany`)
"
/>
<div class="options">
<el-button type="primary" :loading="btnLoading" @click="handleConfirm()">
{{$t('common.confirmButton')}}</el-button>
<el-button @click="goBack">{{$t('common.cancelButton')}}</el-button>
<el-button
type="primary"
:loading="btnLoading"
@click="handleConfirm()"
>
{{ $t("common.confirmButton") }}</el-button
>
<el-button @click="goBack">{{ $t("common.cancelButton") }}</el-button>
</div>
</div>
<div class="main" v-loading="formLoading">
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="80px">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="80px"
>
<div class="JNPF-common-title mb-20">
<h2 class="bold">基础信息</h2>
</div>
<el-row :gutter="20" class="custom-row">
<el-col :sm="12" :xs="24">
<el-form-item label="上级公司" prop="parentId">
<JnpfOrganizeSelect v-model="organizeIdTree" placeholder="选择上级公司" auth isOnlyOrg
@change="onOrganizeChange" :currOrgId="dataForm.id||'0'"
:parentId="parentId||'0'" />
<JnpfOrganizeSelect
v-model="organizeIdTree"
placeholder="选择上级公司"
auth
isOnlyOrg
@change="onOrganizeChange"
:currOrgId="dataForm.id || '0'"
:parentId="parentId || '0'"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司名称" prop="fullName">
<el-input v-model="dataForm.fullName" placeholder="输入名称" maxlength="50" />
<el-input
v-model="dataForm.fullName"
placeholder="输入名称"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司编码" prop="enCode">
<el-input v-model="dataForm.enCode" placeholder="输入公司编码" />
<el-input
v-model="dataForm.enCode"
placeholder="输入公司编码"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司简称" prop="propertyJson.shortName">
<el-input v-model="dataForm.propertyJson.shortName" placeholder="输入公司简称" />
<el-input
v-model="dataForm.propertyJson.shortName"
placeholder="输入公司简称"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司性质" prop="propertyJson.enterpriseNature">
<JnpfTreeSelect v-model="dataForm.propertyJson.enterpriseNature"
:options="natureData" placeholder="请选择公司性质" style="width: 100%" />
<el-form-item
label="公司性质"
prop="propertyJson.enterpriseNature"
>
<JnpfTreeSelect
v-model="dataForm.propertyJson.enterpriseNature"
:options="natureData"
placeholder="请选择公司性质"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="所属行业" prop="propertyJson.industry">
<JnpfTreeSelect v-model="dataForm.propertyJson.industry" :options="industryData"
placeholder="请选择所属行业" style="width: 100%" />
<JnpfTreeSelect
v-model="dataForm.propertyJson.industry"
:options="industryData"
placeholder="请选择所属行业"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="成立时间" prop="propertyJson.foundedTime">
<el-date-picker v-model="dataForm.propertyJson.foundedTime" type="date"
value-format="timestamp" placeholder="选择日期" :picker-options="pickerOptions"
style="width: 100%">
<el-date-picker
v-model="dataForm.propertyJson.foundedTime"
type="date"
value-format="timestamp"
placeholder="选择日期"
:picker-options="pickerOptions"
style="width: 100%"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司电话" prop="propertyJson.telePhone">
<el-input v-model="dataForm.propertyJson.telePhone" placeholder="输入公司电话" />
<el-input
v-model="dataForm.propertyJson.telePhone"
placeholder="输入公司电话"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司传真" prop="propertyJson.fax">
<el-input v-model="dataForm.propertyJson.fax" placeholder="输入公司传真" />
<el-input
v-model="dataForm.propertyJson.fax"
placeholder="输入公司传真"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司主页" prop="propertyJson.webSite">
<el-input v-model="dataForm.propertyJson.webSite" placeholder="输入公司主页" />
<el-input
v-model="dataForm.propertyJson.webSite"
placeholder="输入公司主页"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="公司地址" prop="propertyJson.address">
<el-input v-model="dataForm.propertyJson.address" placeholder="输入公司地址" />
<el-input
v-model="dataForm.propertyJson.address"
placeholder="输入公司地址"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="排序" prop="sortCode">
<el-input-number :min="0" :max="999999" v-model="dataForm.sortCode"
controls-position="right" />
<el-input-number
:min="0"
:max="999999"
v-model="dataForm.sortCode"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="说明" prop="description">
<el-input v-model="dataForm.description" type="textarea" :rows="3" />
<el-input
v-model="dataForm.description"
type="textarea"
:rows="3"
/>
</el-form-item>
</el-col>
</el-row>
@ -96,37 +164,62 @@
<el-row :gutter="20" class="custom-row">
<el-col :sm="12" :xs="24">
<el-form-item label="公司法人" prop="propertyJson.managerName">
<el-input v-model="dataForm.propertyJson.managerName" placeholder="输入公司法人" />
<el-input
v-model="dataForm.propertyJson.managerName"
placeholder="输入公司法人"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="联系电话" prop="propertyJson.managerTelePhone">
<el-input v-model="dataForm.propertyJson.managerTelePhone" placeholder="输入联系电话" />
<el-form-item label="联系电话" prop="managerTelePhone">
<el-input
v-model="dataForm.propertyJson.managerTelePhone"
placeholder="输入联系电话"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="联系手机" prop="propertyJson.managerMobilePhone">
<el-input v-model="dataForm.propertyJson.managerMobilePhone" placeholder="输入联系手机" />
<el-form-item
label="联系手机"
prop="propertyJson.managerMobilePhone"
>
<el-input
v-model="dataForm.propertyJson.managerMobilePhone"
placeholder="输入联系手机"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="联系邮箱" prop="propertyJson.manageEmail">
<el-input v-model="dataForm.propertyJson.manageEmail" placeholder="输入联系邮箱" />
<el-input
v-model="dataForm.propertyJson.manageEmail"
placeholder="输入联系邮箱"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="开户银行" prop="propertyJson.bankName">
<el-input v-model="dataForm.propertyJson.bankName" placeholder="输入开户银行" />
<el-input
v-model="dataForm.propertyJson.bankName"
placeholder="输入开户银行"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="银行账户" prop="propertyJson.bankAccount">
<el-input v-model="dataForm.propertyJson.bankAccount" placeholder="输入银行账户" />
<el-input
v-model="dataForm.propertyJson.bankAccount"
placeholder="输入银行账户"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="经营范围" prop="propertyJson.businessscope">
<el-input v-model="dataForm.propertyJson.businessscope" type="textarea" :rows="3" />
<el-input
v-model="dataForm.propertyJson.businessscope"
type="textarea"
:rows="3"
/>
</el-form-item>
</el-col>
</el-row>
@ -137,7 +230,11 @@
</template>
<script>
import { createOrganize, updateOrganize, getOrganizeInfo } from '@/api/permission/organize'
import {
createOrganize,
updateOrganize,
getOrganizeInfo,
} from "@/api/permission/organize";
export default {
data() {
@ -146,116 +243,142 @@ export default {
btnLoading: false,
formLoading: false,
dataForm: {
id: '',
parentId: '',
fullName: '',
enCode: '',
id: "",
parentId: "",
fullName: "",
enCode: "",
enabledMark: 1,
sortCode: 0,
description: '',
description: "",
propertyJson: {
shortName: '',
enterpriseNature: '',
industry: '',
foundedTime: '',
telePhone: '',
fax: '',
webSite: '',
address: '',
managerName: '',
managerTelePhone: '',
managerMobilePhone: '',
manageEmail: '',
bankName: '',
bankAccount: '',
businessscope: ''
}
shortName: "",
enterpriseNature: "",
industry: "",
foundedTime: "",
telePhone: "",
fax: "",
webSite: "",
address: "",
managerName: "",
managerTelePhone: "",
managerMobilePhone: "",
manageEmail: "",
bankName: "",
bankAccount: "",
businessscope: "",
},
},
parentId: '',
parentId: "",
organizeIdTree: [],
natureData: [],
industryData: [],
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
}
},
},
dataRule: {
parentId: [
{ required: true, message: '上级公司不能为空', trigger: 'change' }
{ required: true, message: "上级公司不能为空", trigger: "change" },
],
fullName: [
{ required: true, message: '请输入公司名称', trigger: 'blur' }
{ required: true, message: "请输入公司名称", trigger: "blur" },
],
enCode: [
{ required: true, message: '请输入公司编码', trigger: 'blur' },
{ validator: this.formValidate('enCode', '公司编码只能输入英文、数字和小数点且小数点不能放在首尾'), trigger: 'blur' },
{ max: 50, message: '公司编码最多为50个字符', trigger: 'blur' }
{ required: true, message: "请输入公司编码", trigger: "blur" },
{
validator: this.formValidate(
"enCode",
"公司编码只能输入英文、数字和小数点且小数点不能放在首尾"
),
trigger: "blur",
},
{ max: 50, message: "公司编码最多为50个字符", trigger: "blur" },
],
managerTelePhone: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
{
pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
message: "请输入联系电话",
trigger: "blur",
},
],
}
}
},
};
},
methods: {
init(id, parentId) {
this.visible = true
this.dataForm.id = id || ''
this.parentId = parentId || ''
this.organizeIdTree = []
this.visible = true;
this.dataForm.id = id || "";
this.parentId = parentId || "";
this.organizeIdTree = [];
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
this.$refs["dataForm"].resetFields();
//
this.$store.dispatch('base/getDictionaryData', { sort: 'EnterpriseNature' }).then(res => {
this.natureData = res
})
this.$store
.dispatch("base/getDictionaryData", { sort: "EnterpriseNature" })
.then((res) => {
this.natureData = res;
});
//
this.$store.dispatch('base/getDictionaryData', { sort: 'IndustryType' }).then(res => {
this.industryData = res
})
this.$store
.dispatch("base/getDictionaryData", { sort: "IndustryType" })
.then((res) => {
this.industryData = res;
});
if (this.dataForm.id) {
this.formLoading = true
getOrganizeInfo(this.dataForm.id).then(res => {
this.dataForm = res.data
this.organizeIdTree = res.data.organizeIdTree || []
const propertyJson = res.data.propertyJson ? JSON.parse(res.data.propertyJson) : {}
this.dataForm.propertyJson = propertyJson
this.formLoading = false
}).catch(() => { this.formLoading = false })
}
this.formLoading = true;
getOrganizeInfo(this.dataForm.id)
.then((res) => {
this.dataForm = res.data;
this.organizeIdTree = res.data.organizeIdTree || [];
const propertyJson = res.data.propertyJson
? JSON.parse(res.data.propertyJson)
: {};
this.dataForm.propertyJson = propertyJson;
this.formLoading = false;
})
.catch(() => {
this.formLoading = false;
});
}
});
},
goBack() {
this.$emit('close')
this.$emit("close");
},
onOrganizeChange(val) {
if (!val || !val.length) return this.dataForm.parentId = ''
this.dataForm.parentId = val[val.length - 1]
if (!val || !val.length) return (this.dataForm.parentId = "");
this.dataForm.parentId = val[val.length - 1];
},
handleConfirm() {
this.$refs['dataForm'].validate((valid) => {
this.$refs["dataForm"].validate((valid) => {
if (valid) {
this.btnLoading = true
const formMethod = this.dataForm.id ? updateOrganize : createOrganize
formMethod(this.dataForm).then(res => {
this.btnLoading = true;
const formMethod = this.dataForm.id ? updateOrganize : createOrganize;
formMethod(this.dataForm)
.then((res) => {
this.$message({
message: res.msg,
type: 'success',
type: "success",
duration: 1500,
onClose: () => {
this.visible = false
this.btnLoading = false
this.$store.commit('generator/SET_COMPANY_TREE', [])
this.$store.commit('generator/SET_DEP_TREE', [])
this.$emit('close', true)
}
})
}).catch(() => {
this.btnLoading = false
})
}
this.visible = false;
this.btnLoading = false;
this.$store.commit("generator/SET_COMPANY_TREE", []);
this.$store.commit("generator/SET_DEP_TREE", []);
this.$emit("close", true);
},
});
})
.catch(() => {
this.btnLoading = false;
});
}
}
}
});
},
},
};
</script>
<style lang="scss" scoped>
.main {

@ -5,15 +5,21 @@
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item :label="$t('common.keyword')">
<el-input v-model="listQuery.keyword" :placeholder="$t('common.enterKeyword')"
clearable @keyup.enter.native="search()" />
<el-input
v-model="listQuery.keyword"
:placeholder="$t('common.enterKeyword')"
clearable
@keyup.enter.native="search()"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">
{{$t('common.search')}}</el-button>
<el-button icon="el-icon-refresh-right" @click="reset()">{{$t('common.reset')}}
{{ $t("common.search") }}</el-button
>
<el-button icon="el-icon-refresh-right" @click="reset()"
>{{ $t("common.reset") }}
</el-button>
</el-form-item>
</el-col>
@ -26,58 +32,110 @@
新建<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="addOrUpdateHandle('','company')">新建公司
</el-dropdown-item>
<el-dropdown-item @click.native="addOrUpdateHandle()">新建部门</el-dropdown-item>
<!-- <el-dropdown-item @click.native="addOrUpdateHandle('','company')">新建公司
</el-dropdown-item> -->
<el-dropdown-item @click.native="addOrUpdateHandle()"
>新建部门</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
<div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="展开" placement="top">
<el-link v-show="!expands" type="text"
icon="icon-ym icon-ym-btn-expand JNPF-common-head-icon" :underline="false"
@click="toggleExpand()" />
<el-link
v-show="!expands"
type="text"
icon="icon-ym icon-ym-btn-expand JNPF-common-head-icon"
:underline="false"
@click="toggleExpand()"
/>
</el-tooltip>
<el-tooltip effect="dark" content="折叠" placement="top">
<el-link v-show="expands" type="text"
icon="icon-ym icon-ym-btn-collapse JNPF-common-head-icon" :underline="false"
@click="toggleExpand()" />
<el-link
v-show="expands"
type="text"
icon="icon-ym icon-ym-btn-collapse JNPF-common-head-icon"
:underline="false"
@click="toggleExpand()"
/>
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="initData()" />
<el-tooltip
effect="dark"
:content="$t('common.refresh')"
placement="top"
>
<el-link
icon="icon-ym icon-ym-Refresh JNPF-common-head-icon"
:underline="false"
@click="initData()"
/>
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="treeList" row-key="id" v-if="refreshTable"
:default-expand-all="expands" :tree-props="{children: 'children', hasChildren: ''}">
<JNPF-table
v-loading="listLoading"
:data="treeList"
row-key="id"
v-if="refreshTable"
:default-expand-all="expands"
:tree-props="{ children: 'children', hasChildren: '' }"
>
<el-table-column prop="fullName" label="名称">
<template slot-scope="scope">
<i :class="'table-icon icon-my '+scope.row.icon"></i>{{scope.row.fullName}}
<i :class="'table-icon icon-my ' + scope.row.icon"></i
>{{ scope.row.fullName }}
</template>
</el-table-column>
<el-table-column prop="enCode" label="编码" />
<el-table-column prop="index" label="层级" width="100" align="center" />
<el-table-column
prop="index"
label="层级"
width="100"
align="center"
/>
<el-table-column prop="type" label="类型" width="100" align="center">
<template slot-scope="scope">
{{scope.row.type==='company'?'公司':'部门'}}
{{ scope.row.type === "company" ? "公司" : "部门" }}
</template>
</el-table-column>
<el-table-column prop="creatorTime" :formatter="jnpf.tableDateFormat" label="创建时间"
width="120" />
<el-table-column prop="sortCode" label="排序" width="70" align="center" />
<el-table-column
prop="creatorTime"
:formatter="jnpf.tableDateFormat"
label="创建时间"
width="120"
/>
<el-table-column
prop="sortCode"
label="排序"
width="70"
align="center"
/>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<tableOpts @edit="addOrUpdateHandle(scope.row.id,scope.row.type,scope.row.parentId)"
@del="handleDel(scope.row.id)">
<tableOpts
@edit="
addOrUpdateHandle(
scope.row.id,
scope.row.type,
scope.row.parentId
)
"
@del="handleDel(scope.row.id)"
>
<el-dropdown>
<span class="el-dropdown-link">
<el-button type="text" size="mini">{{$t('common.moreBtn')}}<i
class="el-icon-arrow-down el-icon--right"></i>
<el-button type="text" size="mini"
>{{ $t("common.moreBtn")
}}<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="checkMembers(scope.row.id,scope.row.fullName)">
查看成员</el-dropdown-item>
<el-dropdown-item
@click.native="
checkMembers(scope.row.id, scope.row.fullName)
"
>
查看成员</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</tableOpts>
@ -89,23 +147,26 @@
<Form v-show="formVisible" ref="Form" @close="closeForm" />
<DepForm v-if="depFormVisible" ref="depForm" @close="closeDepForm" />
<CheckUser v-if="checkUserFormVisible" ref="checkUserForm"
@close="checkUserFormVisible=false" />
<CheckUser
v-if="checkUserFormVisible"
ref="checkUserForm"
@close="checkUserFormVisible = false"
/>
</div>
</template>
<script>
import { getOrganizeList, delOrganize } from '@/api/permission/organize'
import Form from './Form'
import DepForm from './depForm'
import CheckUser from './checkUser.vue'
import { getOrganizeList, delOrganize } from "@/api/permission/organize";
import Form from "./Form";
import DepForm from "./depForm";
import CheckUser from "./checkUser.vue";
export default {
name: 'permission-organize',
name: "permission-organize",
components: { Form, DepForm, CheckUser },
data() {
return {
listQuery: {
keyword: ''
keyword: "",
},
treeList: [],
expands: true,
@ -114,27 +175,29 @@ export default {
listLoading: true,
formVisible: false,
depFormVisible: false,
checkUserFormVisible: false
}
checkUserFormVisible: false,
};
},
created() {
this.initData()
this.initData();
},
methods: {
initData() {
this.loading = true
getOrganizeList(this.listQuery).then(res => {
this.treeList = res.data.list
this.loading = true;
getOrganizeList(this.listQuery)
.then((res) => {
this.treeList = res.data.list;
if (this.treeList.length > 0) this.setTableIndex(this.treeList);
this.listLoading = false
this.btnLoading = false
}).catch(() => {
this.listLoading = false
this.btnLoading = false
this.listLoading = false;
this.btnLoading = false;
})
.catch(() => {
this.listLoading = false;
this.btnLoading = false;
});
},
search() {
this.initData()
this.initData();
},
// index
setTableIndex(arr, index) {
@ -145,51 +208,49 @@ export default {
});
},
reset() {
this.listQuery.keyword = ''
this.initData()
this.listQuery.keyword = "";
this.initData();
},
addOrUpdateHandle(id, type, parentId) {
if (type === 'company') {
this.addOrUpdateOrganize(id, parentId)
if (type === "company") {
this.addOrUpdateOrganize(id, parentId);
} else {
this.addOrUpdateDep(id)
this.addOrUpdateDep(id);
}
},
addOrUpdateOrganize(id, parentId) {
this.formVisible = true
this.formVisible = true;
this.$nextTick(() => {
this.$refs.Form.init(id, parentId)
})
this.$refs.Form.init(id, parentId);
});
},
addOrUpdateDep(id) {
this.depFormVisible = true
this.depFormVisible = true;
this.$nextTick(() => {
this.$refs.depForm.init(id)
})
this.$refs.depForm.init(id);
});
},
closeForm(isRefresh) {
this.formVisible = false
this.formVisible = false;
if (isRefresh) {
this.keyword = ''
this.initData()
this.keyword = "";
this.initData();
}
},
closeDepForm(isRefresh) {
this.depFormVisible = false
this.depFormVisible = false;
if (isRefresh) {
this.keyword = ''
this.initData()
this.keyword = "";
this.initData();
}
},
checkMembers(id, name) {
this.checkUserFormVisible = true
this.checkUserFormVisible = true;
this.$nextTick(() => {
this.$refs.checkUserForm.init(id, name)
})
},
checkUser() {
this.$refs.checkUserForm.init(id, name);
});
},
checkUser() {},
toggleExpand() {
this.refreshTable = false;
this.expands = !this.expands;
@ -198,25 +259,27 @@ export default {
});
},
handleDel(id) {
this.$confirm(this.$t('common.delTip'), this.$t('common.tipTitle'), {
type: 'warning'
}).then(() => {
delOrganize(id).then(res => {
this.$confirm(this.$t("common.delTip"), this.$t("common.tipTitle"), {
type: "warning",
})
.then(() => {
delOrganize(id).then((res) => {
this.$message({
type: 'success',
type: "success",
message: res.msg,
duration: 1500,
onClose: () => {
this.$store.commit('generator/SET_COMPANY_TREE', [])
this.$store.commit('generator/SET_DEP_TREE', [])
this.initData()
}
})
this.$store.commit("generator/SET_COMPANY_TREE", []);
this.$store.commit("generator/SET_DEP_TREE", []);
this.initData();
},
});
});
})
}).catch(() => { })
}
}
}
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped>
.table-icon {

@ -2,91 +2,159 @@
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main org-form">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack"
:content="!dataForm.id ? $t(`Organize.addCompany`) : $t(`Organize.editCompany`)" />
<el-page-header
@back="goBack"
:content="
!dataForm.id
? $t(`Organize.addCompany`)
: $t(`Organize.editCompany`)
"
/>
<div class="options">
<el-button type="primary" :loading="btnLoading" @click="handleConfirm()">
{{$t('common.confirmButton')}}</el-button>
<el-button @click="goBack">{{$t('common.cancelButton')}}</el-button>
<el-button
type="primary"
:loading="btnLoading"
@click="handleConfirm()"
>
{{ $t("common.confirmButton") }}</el-button
>
<el-button @click="goBack">{{ $t("common.cancelButton") }}</el-button>
</div>
</div>
<div class="main" v-loading="formLoading">
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="80px">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="80px"
>
<div class="JNPF-common-title mb-20">
<h2 class="bold">基础信息</h2>
</div>
<el-row :gutter="20" class="custom-row">
<el-col :sm="12" :xs="24">
<el-form-item label="上级公司" prop="parentId">
<JnpfOrganizeSelect v-model="organizeIdTree" placeholder="选择上级公司" auth isOnlyOrg
@change="onOrganizeChange" :currOrgId="dataForm.id||'0'"
:parentId="parentId||'0'" />
<JnpfOrganizeSelect
v-model="organizeIdTree"
placeholder="选择上级公司"
auth
isOnlyOrg
@change="onOrganizeChange"
:currOrgId="dataForm.id || '0'"
:parentId="parentId || '0'"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司名称" prop="fullName">
<el-input v-model="dataForm.fullName" placeholder="输入名称" maxlength="50" />
<el-input
v-model="dataForm.fullName"
placeholder="输入名称"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司编码" prop="enCode">
<el-input v-model="dataForm.enCode" placeholder="输入公司编码" />
<el-input
v-model="dataForm.enCode"
placeholder="输入公司编码"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司简称" prop="propertyJson.shortName">
<el-input v-model="dataForm.propertyJson.shortName" placeholder="输入公司简称" />
<el-input
v-model="dataForm.propertyJson.shortName"
placeholder="输入公司简称"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司性质" prop="propertyJson.enterpriseNature">
<JnpfTreeSelect v-model="dataForm.propertyJson.enterpriseNature"
:options="natureData" placeholder="请选择公司性质" style="width: 100%" />
<el-form-item
label="公司性质"
prop="propertyJson.enterpriseNature"
>
<JnpfTreeSelect
v-model="dataForm.propertyJson.enterpriseNature"
:options="natureData"
placeholder="请选择公司性质"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="所属行业" prop="propertyJson.industry">
<JnpfTreeSelect v-model="dataForm.propertyJson.industry" :options="industryData"
placeholder="请选择所属行业" style="width: 100%" />
<JnpfTreeSelect
v-model="dataForm.propertyJson.industry"
:options="industryData"
placeholder="请选择所属行业"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="成立时间" prop="propertyJson.foundedTime">
<el-date-picker v-model="dataForm.propertyJson.foundedTime" type="date"
value-format="timestamp" placeholder="选择日期" :picker-options="pickerOptions"
style="width: 100%">
<el-date-picker
v-model="dataForm.propertyJson.foundedTime"
type="date"
value-format="timestamp"
placeholder="选择日期"
:picker-options="pickerOptions"
style="width: 100%"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司电话" prop="propertyJson.telePhone">
<el-input v-model="dataForm.propertyJson.telePhone" placeholder="输入公司电话" />
<el-input
v-model="dataForm.propertyJson.telePhone"
placeholder="输入公司电话"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司传真" prop="propertyJson.fax">
<el-input v-model="dataForm.propertyJson.fax" placeholder="输入公司传真" />
<el-input
v-model="dataForm.propertyJson.fax"
placeholder="输入公司传真"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司主页" prop="propertyJson.webSite">
<el-input v-model="dataForm.propertyJson.webSite" placeholder="输入公司主页" />
<el-input
v-model="dataForm.propertyJson.webSite"
placeholder="输入公司主页"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="公司地址" prop="propertyJson.address">
<el-input v-model="dataForm.propertyJson.address" placeholder="输入公司地址" />
<el-input
v-model="dataForm.propertyJson.address"
placeholder="输入公司地址"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="排序" prop="sortCode">
<el-input-number :min="0" :max="999999" v-model="dataForm.sortCode"
controls-position="right" />
<el-input-number
:min="0"
:max="999999"
v-model="dataForm.sortCode"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="说明" prop="description">
<el-input v-model="dataForm.description" type="textarea" :rows="3" />
<el-input
v-model="dataForm.description"
type="textarea"
:rows="3"
/>
</el-form-item>
</el-col>
</el-row>
@ -96,37 +164,66 @@
<el-row :gutter="20" class="custom-row">
<el-col :sm="12" :xs="24">
<el-form-item label="公司法人" prop="propertyJson.managerName">
<el-input v-model="dataForm.propertyJson.managerName" placeholder="输入公司法人" />
<el-input
v-model="dataForm.propertyJson.managerName"
placeholder="输入公司法人"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="联系电话" prop="propertyJson.managerTelePhone">
<el-input v-model="dataForm.propertyJson.managerTelePhone" placeholder="输入联系电话" />
<el-form-item
label="联系电话"
prop="propertyJson.managerTelePhone"
>
<el-input
v-model="dataForm.propertyJson.managerTelePhone"
placeholder="输入联系电话"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="联系手机" prop="propertyJson.managerMobilePhone">
<el-input v-model="dataForm.propertyJson.managerMobilePhone" placeholder="输入联系手机" />
<el-form-item
:rules="dataRule"
label="联系手机"
prop="propertyJson.managerMobilePhone"
>
<el-input
v-model="dataForm.propertyJson.managerMobilePhone"
placeholder="输入联系手机"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="联系邮箱" prop="propertyJson.manageEmail">
<el-input v-model="dataForm.propertyJson.manageEmail" placeholder="输入联系邮箱" />
<el-input
v-model="dataForm.propertyJson.manageEmail"
placeholder="输入联系邮箱"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="开户银行" prop="propertyJson.bankName">
<el-input v-model="dataForm.propertyJson.bankName" placeholder="输入开户银行" />
<el-input
v-model="dataForm.propertyJson.bankName"
placeholder="输入开户银行"
/>
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="银行账户" prop="propertyJson.bankAccount">
<el-input v-model="dataForm.propertyJson.bankAccount" placeholder="输入银行账户" />
<el-input
v-model="dataForm.propertyJson.bankAccount"
placeholder="输入银行账户"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="经营范围" prop="propertyJson.businessscope">
<el-input v-model="dataForm.propertyJson.businessscope" type="textarea" :rows="3" />
<el-input
v-model="dataForm.propertyJson.businessscope"
type="textarea"
:rows="3"
/>
</el-form-item>
</el-col>
</el-row>
@ -137,7 +234,11 @@
</template>
<script>
import { createOrganize, updateOrganize, getOrganizeInfo } from '@/api/permission/organize'
import {
createOrganize,
updateOrganize,
getOrganizeInfo,
} from "@/api/permission/organize";
export default {
data() {
@ -146,116 +247,142 @@ export default {
btnLoading: false,
formLoading: false,
dataForm: {
id: '',
parentId: '',
fullName: '',
enCode: '',
id: "",
parentId: "",
fullName: "",
enCode: "",
enabledMark: 1,
sortCode: 0,
description: '',
description: "",
propertyJson: {
shortName: '',
enterpriseNature: '',
industry: '',
foundedTime: '',
telePhone: '',
fax: '',
webSite: '',
address: '',
managerName: '',
managerTelePhone: '',
managerMobilePhone: '',
manageEmail: '',
bankName: '',
bankAccount: '',
businessscope: ''
}
shortName: "",
enterpriseNature: "",
industry: "",
foundedTime: "",
telePhone: "",
fax: "",
webSite: "",
address: "",
managerName: "",
managerTelePhone: "",
managerMobilePhone: "",
manageEmail: "",
bankName: "",
bankAccount: "",
businessscope: "",
},
},
parentId: '',
parentId: "",
organizeIdTree: [],
natureData: [],
industryData: [],
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
}
},
},
dataRule: {
parentId: [
{ required: true, message: '上级公司不能为空', trigger: 'change' }
{ required: true, message: "上级公司不能为空", trigger: "change" },
],
fullName: [
{ required: true, message: '请输入公司名称', trigger: 'blur' }
{ required: true, message: "请输入公司名称", trigger: "blur" },
],
managerTelePhone: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
{
pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
message: "请输入联系电话",
trigger: "blur",
},
],
enCode: [
{ required: true, message: '请输入公司编码', trigger: 'blur' },
{ validator: this.formValidate('enCode', '公司编码只能输入英文、数字和小数点且小数点不能放在首尾'), trigger: 'blur' },
{ max: 50, message: '公司编码最多为50个字符', trigger: 'blur' }
{ required: true, message: "请输入公司编码", trigger: "blur" },
{
validator: this.formValidate(
"enCode",
"公司编码只能输入英文、数字和小数点且小数点不能放在首尾"
),
trigger: "blur",
},
{ max: 50, message: "公司编码最多为50个字符", trigger: "blur" },
],
}
}
},
};
},
methods: {
init(id, parentId) {
this.visible = true
this.dataForm.id = id || ''
this.parentId = parentId || ''
this.organizeIdTree = []
this.visible = true;
this.dataForm.id = id || "";
this.parentId = parentId || "";
this.organizeIdTree = [];
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
this.$refs["dataForm"].resetFields();
//
this.$store.dispatch('base/getDictionaryData', { sort: 'EnterpriseNature' }).then(res => {
this.natureData = res
})
this.$store
.dispatch("base/getDictionaryData", { sort: "EnterpriseNature" })
.then((res) => {
this.natureData = res;
});
//
this.$store.dispatch('base/getDictionaryData', { sort: 'IndustryType' }).then(res => {
this.industryData = res
})
this.$store
.dispatch("base/getDictionaryData", { sort: "IndustryType" })
.then((res) => {
this.industryData = res;
});
if (this.dataForm.id) {
this.formLoading = true
getOrganizeInfo(this.dataForm.id).then(res => {
this.dataForm = res.data
this.organizeIdTree = res.data.organizeIdTree || []
const propertyJson = res.data.propertyJson ? JSON.parse(res.data.propertyJson) : {}
this.dataForm.propertyJson = propertyJson
this.formLoading = false
}).catch(() => { this.formLoading = false })
}
this.formLoading = true;
getOrganizeInfo(this.dataForm.id)
.then((res) => {
this.dataForm = res.data;
this.organizeIdTree = res.data.organizeIdTree || [];
const propertyJson = res.data.propertyJson
? JSON.parse(res.data.propertyJson)
: {};
this.dataForm.propertyJson = propertyJson;
this.formLoading = false;
})
.catch(() => {
this.formLoading = false;
});
}
});
},
goBack() {
this.$emit('close')
this.$emit("close");
},
onOrganizeChange(val) {
if (!val || !val.length) return this.dataForm.parentId = ''
this.dataForm.parentId = val[val.length - 1]
if (!val || !val.length) return (this.dataForm.parentId = "");
this.dataForm.parentId = val[val.length - 1];
},
handleConfirm() {
this.$refs['dataForm'].validate((valid) => {
this.$refs["dataForm"].validate((valid) => {
if (valid) {
this.btnLoading = true
const formMethod = this.dataForm.id ? updateOrganize : createOrganize
formMethod(this.dataForm).then(res => {
this.btnLoading = true;
const formMethod = this.dataForm.id ? updateOrganize : createOrganize;
formMethod(this.dataForm)
.then((res) => {
this.$message({
message: res.msg,
type: 'success',
type: "success",
duration: 1500,
onClose: () => {
this.visible = false
this.btnLoading = false
this.$store.commit('generator/SET_COMPANY_TREE', [])
this.$store.commit('generator/SET_DEP_TREE', [])
this.$emit('close', true)
}
})
}).catch(() => {
this.btnLoading = false
})
}
this.visible = false;
this.btnLoading = false;
this.$store.commit("generator/SET_COMPANY_TREE", []);
this.$store.commit("generator/SET_DEP_TREE", []);
this.$emit("close", true);
},
});
})
.catch(() => {
this.btnLoading = false;
});
}
}
}
});
},
},
};
</script>
<style lang="scss" scoped>
.main {

@ -5,15 +5,21 @@
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item :label="$t('common.keyword')">
<el-input v-model="listQuery.keyword" :placeholder="$t('common.enterKeyword')"
clearable @keyup.enter.native="search()" />
<el-input
v-model="listQuery.keyword"
:placeholder="$t('common.enterKeyword')"
clearable
@keyup.enter.native="search()"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">
{{$t('common.search')}}</el-button>
<el-button icon="el-icon-refresh-right" @click="reset()">{{$t('common.reset')}}
{{ $t("common.search") }}</el-button
>
<el-button icon="el-icon-refresh-right" @click="reset()"
>{{ $t("common.reset") }}
</el-button>
</el-form-item>
</el-col>
@ -26,58 +32,109 @@
新建<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="addOrUpdateHandle('','company')">新建公司
<el-dropdown-item @click.native="addOrUpdateHandle('', 'company')"
>新建公司
</el-dropdown-item>
<el-dropdown-item @click.native="addOrUpdateHandle()">新建部门</el-dropdown-item>
<!-- <el-dropdown-item @click.native="addOrUpdateHandle()">新建部门</el-dropdown-item> -->
</el-dropdown-menu>
</el-dropdown>
<div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="展开" placement="top">
<el-link v-show="!expands" type="text"
icon="icon-ym icon-ym-btn-expand JNPF-common-head-icon" :underline="false"
@click="toggleExpand()" />
<el-link
v-show="!expands"
type="text"
icon="icon-ym icon-ym-btn-expand JNPF-common-head-icon"
:underline="false"
@click="toggleExpand()"
/>
</el-tooltip>
<el-tooltip effect="dark" content="折叠" placement="top">
<el-link v-show="expands" type="text"
icon="icon-ym icon-ym-btn-collapse JNPF-common-head-icon" :underline="false"
@click="toggleExpand()" />
<el-link
v-show="expands"
type="text"
icon="icon-ym icon-ym-btn-collapse JNPF-common-head-icon"
:underline="false"
@click="toggleExpand()"
/>
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="initData()" />
<el-tooltip
effect="dark"
:content="$t('common.refresh')"
placement="top"
>
<el-link
icon="icon-ym icon-ym-Refresh JNPF-common-head-icon"
:underline="false"
@click="initData()"
/>
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="treeList" row-key="id" v-if="refreshTable"
:default-expand-all="expands" :tree-props="{children: 'children', hasChildren: ''}">
<JNPF-table
v-loading="listLoading"
:data="treeList"
row-key="id"
v-if="refreshTable"
:default-expand-all="expands"
:tree-props="{ children: 'children', hasChildren: '' }"
>
<el-table-column prop="fullName" label="名称">
<template slot-scope="scope">
<i :class="'table-icon icon-my '+scope.row.icon"></i>{{scope.row.fullName}}
<i :class="'table-icon icon-my ' + scope.row.icon"></i
>{{ scope.row.fullName }}
</template>
</el-table-column>
<el-table-column prop="enCode" label="编码" />
<el-table-column prop="index" label="层级" width="100" align="center" />
<el-table-column
prop="index"
label="层级"
width="100"
align="center"
/>
<el-table-column prop="type" label="类型" width="100" align="center">
<template slot-scope="scope">
{{scope.row.type==='company'?'公司':'部门'}}
{{ scope.row.type === "company" ? "公司" : "部门" }}
</template>
</el-table-column>
<el-table-column prop="creatorTime" :formatter="jnpf.tableDateFormat" label="创建时间"
width="120" />
<el-table-column prop="sortCode" label="排序" width="70" align="center" />
<el-table-column
prop="creatorTime"
:formatter="jnpf.tableDateFormat"
label="创建时间"
width="120"
/>
<el-table-column
prop="sortCode"
label="排序"
width="70"
align="center"
/>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<tableOpts @edit="addOrUpdateHandle(scope.row.id,scope.row.type,scope.row.parentId)"
@del="handleDel(scope.row.id)">
<tableOpts
@edit="
addOrUpdateHandle(
scope.row.id,
scope.row.type,
scope.row.parentId
)
"
@del="handleDel(scope.row.id)"
>
<el-dropdown>
<span class="el-dropdown-link">
<el-button type="text" size="mini">{{$t('common.moreBtn')}}<i
class="el-icon-arrow-down el-icon--right"></i>
<el-button type="text" size="mini"
>{{ $t("common.moreBtn")
}}<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="checkMembers(scope.row.id,scope.row.fullName)">
查看成员</el-dropdown-item>
<el-dropdown-item
@click.native="
checkMembers(scope.row.id, scope.row.fullName)
"
>
查看成员</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</tableOpts>
@ -89,23 +146,26 @@
<Form v-show="formVisible" ref="Form" @close="closeForm" />
<DepForm v-if="depFormVisible" ref="depForm" @close="closeDepForm" />
<CheckUser v-if="checkUserFormVisible" ref="checkUserForm"
@close="checkUserFormVisible=false" />
<CheckUser
v-if="checkUserFormVisible"
ref="checkUserForm"
@close="checkUserFormVisible = false"
/>
</div>
</template>
<script>
import { getOrganizeList, delOrganize } from '@/api/permission/organize'
import Form from './Form'
import DepForm from './depForm'
import CheckUser from './checkUser.vue'
import { getOrganizeList, delOrganize } from "@/api/permission/organize";
import Form from "./Form";
import DepForm from "./depForm";
import CheckUser from "./checkUser.vue";
export default {
name: 'permission-organize',
name: "permission-organize",
components: { Form, DepForm, CheckUser },
data() {
return {
listQuery: {
keyword: ''
keyword: "",
},
treeList: [],
expands: true,
@ -114,27 +174,29 @@ export default {
listLoading: true,
formVisible: false,
depFormVisible: false,
checkUserFormVisible: false
}
checkUserFormVisible: false,
};
},
created() {
this.initData()
this.initData();
},
methods: {
initData() {
this.loading = true
getOrganizeList(this.listQuery).then(res => {
this.treeList = res.data.list
this.loading = true;
getOrganizeList(this.listQuery)
.then((res) => {
this.treeList = res.data.list;
if (this.treeList.length > 0) this.setTableIndex(this.treeList);
this.listLoading = false
this.btnLoading = false
}).catch(() => {
this.listLoading = false
this.btnLoading = false
this.listLoading = false;
this.btnLoading = false;
})
.catch(() => {
this.listLoading = false;
this.btnLoading = false;
});
},
search() {
this.initData()
this.initData();
},
// index
setTableIndex(arr, index) {
@ -145,51 +207,49 @@ export default {
});
},
reset() {
this.listQuery.keyword = ''
this.initData()
this.listQuery.keyword = "";
this.initData();
},
addOrUpdateHandle(id, type, parentId) {
if (type === 'company') {
this.addOrUpdateOrganize(id, parentId)
if (type === "company") {
this.addOrUpdateOrganize(id, parentId);
} else {
this.addOrUpdateDep(id)
this.addOrUpdateDep(id);
}
},
addOrUpdateOrganize(id, parentId) {
this.formVisible = true
this.formVisible = true;
this.$nextTick(() => {
this.$refs.Form.init(id, parentId)
})
this.$refs.Form.init(id, parentId);
});
},
addOrUpdateDep(id) {
this.depFormVisible = true
this.depFormVisible = true;
this.$nextTick(() => {
this.$refs.depForm.init(id)
})
this.$refs.depForm.init(id);
});
},
closeForm(isRefresh) {
this.formVisible = false
this.formVisible = false;
if (isRefresh) {
this.keyword = ''
this.initData()
this.keyword = "";
this.initData();
}
},
closeDepForm(isRefresh) {
this.depFormVisible = false
this.depFormVisible = false;
if (isRefresh) {
this.keyword = ''
this.initData()
this.keyword = "";
this.initData();
}
},
checkMembers(id, name) {
this.checkUserFormVisible = true
this.checkUserFormVisible = true;
this.$nextTick(() => {
this.$refs.checkUserForm.init(id, name)
})
},
checkUser() {
this.$refs.checkUserForm.init(id, name);
});
},
checkUser() {},
toggleExpand() {
this.refreshTable = false;
this.expands = !this.expands;
@ -198,25 +258,27 @@ export default {
});
},
handleDel(id) {
this.$confirm(this.$t('common.delTip'), this.$t('common.tipTitle'), {
type: 'warning'
}).then(() => {
delOrganize(id).then(res => {
this.$confirm(this.$t("common.delTip"), this.$t("common.tipTitle"), {
type: "warning",
})
.then(() => {
delOrganize(id).then((res) => {
this.$message({
type: 'success',
type: "success",
message: res.msg,
duration: 1500,
onClose: () => {
this.$store.commit('generator/SET_COMPANY_TREE', [])
this.$store.commit('generator/SET_DEP_TREE', [])
this.initData()
}
})
this.$store.commit("generator/SET_COMPANY_TREE", []);
this.$store.commit("generator/SET_DEP_TREE", []);
this.initData();
},
});
});
})
}).catch(() => { })
}
}
}
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped>
.table-icon {

Loading…
Cancel
Save