zhangtao
laozt 1 year ago
parent a50cea522f
commit 1cceb15e92

@ -29,7 +29,7 @@ export function getNew(id) {
// 新增企业新
export function addNew(data) {
return request({
url: '/system/new',
url: '/pharmaceuticals/new',
method: 'post',
data: data
})

@ -2,7 +2,7 @@
* @Author: laozt 2721205210@qq.com
* @Date: 2023-10-12 09:29:26
* @LastEditors: laozt 2721205210@qq.com
* @LastEditTime: 2023-12-19 11:22:07
* @LastEditTime: 2024-01-03 10:29:53
* @FilePath: \suzhouyingjiPC\src\layout\newyjLayout.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@ -56,9 +56,9 @@
</div>
</div>
<el-dropdown-menu slot="dropdown">
<!-- <router-link v-show="userInfo.userName == 'admin'" to="/system/user">
<router-link v-show="userInfo.userName == 'admin'" to="/system/user">
<el-dropdown-item>进入后台管理</el-dropdown-item>
</router-link> -->
</router-link>
<router-link to="/user/profile">
<el-dropdown-item>修改密码</el-dropdown-item>
</router-link>

@ -79,6 +79,12 @@
>重置</el-button
>
</el-form-item>
<el-form-item>
<el-button class="btn-add" size="mini" @click="handleAddNew"
>企业补录</el-button
>
</el-form-item>
</el-form>
</div>
<div class="tables">
@ -179,6 +185,38 @@
</div>
<firm-dialog ref="firmDialog"></firm-dialog>
<!-- 添加或修改企业新对话框 -->
<el-dialog
:title="titleNew"
:visible.sync="openNew"
width="500px"
append-to-body
>
<el-form
ref="formNew"
:model="formNew"
:rules="rulesNew"
label-width="80px"
>
<el-form-item label="信用代码" prop="enterpriseId">
<el-input v-model="formNew.enterpriseId" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="企业名称" prop="enterpriseName">
<el-input v-model="formNew.enterpriseName" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="行政区划" prop="district">
<AreaCascader
@change="onChange"
@select="onSelect"
ref="areaCascader"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFormNew"> </el-button>
<el-button @click="cancelNew"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
@ -188,6 +226,7 @@ import firmDialog from "@/views/components/firmDialog/index.vue";
import dictzh from "@/utils/dictzh.js";
//
import executive from "../../yingji/echarts/executive.vue";
import AreaCascader from "../../yingji/planmanage/components/AreaCascader.vue";
import {
listNew,
listGetNew,
@ -214,7 +253,7 @@ export default {
"dict_risk_level",
"dict_stand_level",
],
components: { firmDialog, executive },
components: { firmDialog, executive, AreaCascader },
data() {
return {
options: [
@ -293,6 +332,22 @@ export default {
enterpriseTotal: 0,
//
formPlanEnterprise: {},
titleNew: "",
//
openNew: false,
//
formNew: {},
rulesNew: {
enterpriseId: [
{ required: true, message: "信用代码不能为空", trigger: "blur" },
],
enterpriseName: [
{ required: true, message: "企业名称不能为空", trigger: "blur" },
],
district: [
{ required: true, message: "行政区划不能为空", trigger: "blur" },
],
},
};
},
created() {
@ -412,6 +467,76 @@ export default {
this.getPlanEnterpriseList();
});
},
//
onChange(e) {
this.formNew.district = e;
},
onSelect(e) {
this.formNew.district = e;
},
/** 新增按钮操作 */
handleAddNew() {
this.resetNew();
let userInfo = JSON.parse(sessionStorage.getItem("USER_INFO"));
if (userInfo.lawLevel == "镇级") {
let code = userInfo.permissionCode.split(",");
console.log(userInfo.permissionCode);
if (code.length > 1) {
} else {
this.formNew.district = userInfo.permissionCode;
}
}
this.openNew = true;
this.titleNew = "企业补录";
},
//
resetNew() {
this.formNew = {
id: null,
enterpriseId: null,
enterpriseName: null,
district: null,
supervisionLarge: "/",
riskLevel: "D",
standLevel: "/",
examineEndTime: null,
createId: null,
createBy: null,
createTime: null,
updateId: null,
updateBy: null,
updateTime: null,
remark: null,
userId: null,
deptId: null,
};
},
/** 提交按钮 */
submitFormNew() {
console.log(this.formNew);
this.$refs["formNew"].validate((valid) => {
if (valid) {
// if (this.formNew.id != null) {
// updateNew(this.formNew).then((response) => {
// this.$modal.msgSuccess("");
// this.openNew = false;
// this.getList();
// });
// } else {
// addNew(this.formNew).then((response) => {
// this.$modal.msgSuccess("");
// this.openNew = false;
// this.getList();
// });
// }
}
});
},
//
cancelNew() {
this.openNew = false;
this.resetNew();
},
//
resetPlanEnterprise() {
this.formPlanEnterprise = {
@ -456,6 +581,8 @@ export default {
this.$refs.executive.onClear();
this.handleQuery();
},
//
onAddEnterprise() {},
quhua(e) {
this.queryParams.district = e;
},
@ -607,6 +734,16 @@ export default {
border-radius: 2px;
border: none;
}
.btn-add {
border-radius: 2px;
background-color: #0ad9a5;
font-size: 15px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
color: #eff6ff;
cursor: pointer;
}
}
.tables {
.tabs-btns {

@ -0,0 +1,186 @@
<!--
* @Descripttion:
* @version:
* @Author: JC9527
* @Date: 2023-09-27 14:01:34
* @LastEditors: 张涛
* @LastEditTime: 2023-10-20 09:23:51
-->
<template>
<div>
<el-cascader
size="small"
v-model="district"
:options="treeData"
:show-all-levels="false"
:disabled="isNoneDivision"
:props="props"
@change="onChange"
v-if="isShow"
></el-cascader>
<el-select
v-else-if="options.length > 1"
v-model="district"
placeholder="请选择"
@change="onSelect"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-input v-else v-model="text" placeholder="" :disabled="!isShow" />
</div>
</template>
<script>
import { mapState } from "vuex";
export default {
data() {
return {
//
district: "",
treeData: [],
text: null,
compartment: [], //
isShow: true,
isNoneDivision: false,
props: {
value: "value",
label: "label",
children: "children",
},
options: [],
};
},
created() {
this.treeList();
},
computed: {
...mapState({
//dept.parentId
dept: (state) => state.user.dept,
}),
},
props: {
none: {
type: Boolean,
default: false,
},
},
methods: {
onClear() {
this.district = "";
},
treeList() {
let treeData = JSON.parse(localStorage.getItem("TREE_DATA"));
treeData.forEach((value, index) => {
this.compartment.push({
value: value.districtCode,
label: value.district,
children: [],
});
if (value.children.length > 0) {
value.children.forEach((value1, index1) => {
this.compartment[index].children.push({
value: value1.countyCode,
label: value1.county,
});
});
}
});
let userInfo = JSON.parse(sessionStorage.getItem("USER_INFO"));
// console.log(userInfo.lawLevel);
//
if (userInfo.lawLevel == "市级") {
this.treeData = this.compartment;
}
//
else if (userInfo.lawLevel == "县级") {
this.district = userInfo.permissionCode;
this.treeData = this.compartment.filter(
(item) => item.value === this.district
);
}
//
else if (userInfo.lawLevel == "镇级") {
this.isShow = false;
let code = userInfo.permissionCode.split(",");
let label = userInfo.permissionDescription.split(",");
let array = [];
if (code.length > 1) {
code.map((item, index) => {
array.push({
value: item,
label: label[index],
});
});
this.options = array;
} else {
this.text = userInfo.permissionDescription;
}
} else {
this.treeData = this.compartment;
}
// this.district = "320582403"
// console.log(JSON.stringify(this.compartment));
this.$emit("quhuadizhi", this.compartment);
},
onSelect(e) {
this.$emit("select", e);
console.log(e);
},
onChange(e) {
console.log(e);
console.log(e[e.length - 1]);
this.$emit("quhua", e[e.length - 1]);
this.$emit("change", e[e.length - 1]);
// if (!this.none) {
// if (e.length == 1) {
// this.$emit("quhua", e[0].slice(0, 7));
// } else if (e.length == 2 && e[0] == e[1]) {
// this.$emit("quhua", e[0].slice(0, 7));
// } else {
// this.$emit("quhua", e[1].slice(0, 10));
// }
// } else {
// if (e.length == 1) {
// this.$emit("quhua", e[0]);
// } else if (e.length == 2 && e[0] == e[1]) {
// this.$emit("quhua", e[0]);
// } else {
// this.$emit("quhua", e[1]);
// }
// }
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-cascader {
background-color: transparent;
width: 210px;
.el-input__inner {
height: 33px;
}
.el-input
.el-input__suffix
.el-input__suffix-inner
.el-icon-arrow-down::before {
content: "";
background: url("../../../../assets/images/down2.png") center center
no-repeat;
background-size: cover;
position: absolute;
width: 10px;
height: 7px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
</style>
Loading…
Cancel
Save