新增资产、新增单位校验

main
吕天方 2 months ago
parent d4e8fab0be
commit 6ed013218e

@ -5,7 +5,8 @@ VUE_APP_TITLE = 太仓资产管理系统
ENV = 'development'
# 若依管理系统/开发环境
VUE_APP_BASE_API = 'http://192.168.0.108:9015'
# VUE_APP_BASE_API = 'http://192.168.0.109:9115'
VUE_APP_BASE_API = 'http://39.101.188.84:9115'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

@ -26,6 +26,15 @@ export function listUnitdw(query) {
})
}
// 新增资产查询单位列表
export function unitAllList(params){
return request({
url: '/tc/unit/allList',
method: 'get',
params
})
}
// 删除单位
export function delUnit(unitId) {
return request({

@ -451,6 +451,7 @@
}
.el-select,
.el-autocomplete,
.el-date-editor,
.el-cascader {
width: 100%;

@ -40,12 +40,14 @@ export default {
//
let sidebarRouters = this.sidebarRouters
let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
if(matched[0].path == "/assetsAuth" ) {
// ----
const activeRoute = sidebarRouters.filter(item => item.path == '/' && item.children[0].path == 'assets')
this.levelList = [activeRoute[0].children[0],matched[0]]
// const activeRoute = sidebarRouters.filter(item => item.path == '/assetsManage')
// const childrenRoute = activeRoute.children;
// console.log(activeRoute,"activeRoute");
// this.levelList = [activeRoute[0],activeRoute[0].children[0],matched[0]]
} else if(matched[0].path == "/taskInfo" || matched[0].path == "/taskAudit") {
// ----/
const activeRoute = sidebarRouters.filter(item => item.path == '/' && item.children[0].path == 'task')
@ -86,7 +88,6 @@ export default {
return name.trim() === 'Index'
},
handleLink(item) {
const { redirect, path } = item
if (redirect) {
this.$router.push(redirect)

@ -101,7 +101,8 @@ export default {
type: 'warning'
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = '/login';
// location.href = '/login';
this.$router.replace("/login");
})
}).catch(() => {});
},

@ -78,6 +78,7 @@ export const constantRoutes = [
component: () => import('@/views/auditPages/assetsManagement/assetsAuth'),
name: 'AssetsAuth',
meta: { title: '新增资产', icon: 'user', activeMenu: "/assets" }
// meta: { title: '新增资产', icon: 'user', activeMenu: "/assetsManage/assets" }
},{
path: 'taskInfo',
component: () => import('@/views/auditPages/taskManagement/info'),

@ -9,13 +9,19 @@
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="170px" class="demo-ruleForm" label-position="right" :disabled="disabled">
<el-row>
<el-col :span="12">
<el-form-item label="系统名称" required>
<el-form-item label="系统名称" required prop="xtmc">
<el-input v-model="ruleForm.xtmc" placeholder="请输入系统名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位名称" required>
<el-input v-model="ruleForm.dwmc" placeholder="请输入单位名称"></el-input>
<el-form-item label="单位名称" required prop="dwmc">
<!-- <el-input v-model="ruleForm.dwmc" placeholder="请输入单位名称"></el-input> -->
<el-autocomplete
v-model="ruleForm.dwmc"
:fetch-suggestions="querySearchAsync"
placeholder="请输入单位名称"
></el-autocomplete>
</el-form-item>
</el-col>
</el-row>
@ -58,13 +64,13 @@
<el-form-item label="IpPort" required class="IpPort">
<el-row>
<el-col :span="19">
<el-form-item prop="name">
<el-form-item>
<el-input v-model="ruleForm.ipAddress" style="width: 100%;" placeholder="请输入IP地址"></el-input>
</el-form-item>
</el-col>
<el-col class="line" :span="1">:</el-col>
<el-col :span="4">
<el-form-item prop="name">
<el-form-item>
<el-input v-model="ruleForm.ipPort" style="width: 100%;" placeholder="端口号"></el-input>
</el-form-item>
</el-col>
@ -101,7 +107,7 @@
<el-form-item label="到期提醒人" class="daoqitixingren">
<el-row>
<el-col :span="6">
<el-form-item prop="Ip">
<el-form-item>
<el-input v-model="ruleForm.ymtxrXm" style="width: 100%;" placeholder="请输入姓名"></el-input>
</el-form-item>
</el-col>
@ -656,7 +662,7 @@
<el-form-item label="分管责任人" required class="daoqitixingren">
<el-row>
<el-col :span="8">
<el-form-item prop="name">
<el-form-item >
<el-input v-model="ruleForm.fgfzrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
@ -695,7 +701,7 @@
<el-form-item label="部门负责人" required class="daoqitixingren">
<el-row>
<el-col :span="8">
<el-form-item prop="name">
<el-form-item>
<el-input v-model="ruleForm.bmfzrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
@ -734,7 +740,7 @@
<el-form-item label="第一联系人" required class="daoqitixingren">
<el-row>
<el-col :span="8">
<el-form-item prop="name">
<el-form-item>
<el-input v-model="ruleForm.dylxrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
@ -773,7 +779,7 @@
<el-form-item :label="'其他联系人' + (index == 0 ? '' : index)" v-for="(domain, index) in ruleForm.otherConcat" :key="domain.key" :prop="'otherConcat.' + index + '.value'">
<el-row style="display: flex;">
<el-col :span="8">
<el-form-item prop="name">
<el-form-item>
<el-input v-model="domain.qtlxrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
@ -812,7 +818,7 @@
</el-row>
<el-row v-if="$route.query.pageType !== 'look'">
<el-col :span="24">
<el-form-item prop="btn">
<el-form-item>
<el-button @click="addOtherConcat('otherConcat')"></el-button>
</el-form-item>
</el-col>
@ -1507,16 +1513,18 @@
</el-form-item>
</el-col>
<el-col :span="12" style="margin-left: 10px;">
<el-form-item class="daoqitixingren" required :prop="'xtjsUnit.' + index + '.tyshxydm'" :label="'统一社会信用代码' + (index == 0 ? '' : index)"
:rules="[
{
pattern: /^[a-zA-Z0-9]{18}$/,
message: '请输入正确格式的18位统一社会信用代码',
trigger: 'blur'
}
]"
>
<el-input v-model="domain.tyshxydm" placeholder="请输入统一信用代码"></el-input>
<el-form-item class="daoqitixingren" required :label="'统一社会信用代码' + (index == 0 ? '' : index)">
<el-form-item class="daoqitixingren" :prop="'xtjsUnit.' + index + '.tyshxydm'"
:rules="[
{
pattern: /^[a-zA-Z0-9]{18}$/,
message: '请输入正确格式的18位统一社会信用代码',
trigger: 'blur'
}
]"
>
<el-input v-model="domain.tyshxydm" placeholder="请输入统一信用代码"></el-input>
</el-form-item>
</el-form-item>
</el-col>
</el-row>
@ -1527,16 +1535,18 @@
</el-form-item>
</el-col>
<el-col :span="12" style="margin-left: 10px;">
<el-form-item class="daoqitixingren" required :label="'联系电话' + (index == 0 ? '' : index)" :prop="'xtjsUnit.' + index + '.lxdh'"
:rules="[
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: '请输入正确的手机号码',
trigger: 'blur'
}
]"
>
<el-input v-model="domain.lxdh" placeholder="请输入联系电话"></el-input>
<el-form-item class="daoqitixingren" required :label="'联系电话' + (index == 0 ? '' : index)">
<el-form-item class="daoqitixingren" :prop="'xtjsUnit.' + index + '.lxdh'"
:rules="[
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: '请输入正确的手机号码',
trigger: 'blur'
}
]"
>
<el-input v-model="domain.lxdh" placeholder="请输入联系电话"></el-input>
</el-form-item>
</el-form-item>
</el-col>
</el-row>
@ -1572,16 +1582,18 @@
</el-form-item>
</el-col>
<el-col :span="12" style="margin-left: 10px;">
<el-form-item class="daoqitixingren" :prop="'xtyyUnit.' + index + '.tyshxydm'" required :label="'统一社会信用代码' + (index == 0 ? '' : index)"
:rules="[
{
pattern: /^[a-zA-Z0-9]{18}$/,
message: '请输入正确格式的18位统一社会信用代码',
trigger: 'blur'
}
]"
>
<el-input v-model="domain.tyshxydm" placeholder="请输入统一信用代码"></el-input>
<el-form-item class="daoqitixingren" required :label="'统一社会信用代码' + (index == 0 ? '' : index)">
<el-form-item class="daoqitixingren" :prop="'xtyyUnit.' + index + '.tyshxydm'"
:rules="[
{
pattern: /^[a-zA-Z0-9]{18}$/,
message: '请输入正确格式的18位统一社会信用代码',
trigger: 'blur'
}
]"
>
<el-input v-model="domain.tyshxydm" placeholder="请输入统一信用代码"></el-input>
</el-form-item>
</el-form-item>
</el-col>
</el-row>
@ -1592,16 +1604,18 @@
</el-form-item>
</el-col>
<el-col :span="12" style="margin-left: 10px;">
<el-form-item class="daoqitixingren" required :label="'联系电话' + (index == 0 ? '' : index)" :prop="'xtyyUnit.' + index + '.lxdh'"
:rules="[
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: '请输入正确的手机号码',
trigger: 'blur'
}
]"
>
<el-input v-model="domain.lxdh" placeholder="请输入联系电话"></el-input>
<el-form-item class="daoqitixingren" required :label="'联系电话' + (index == 0 ? '' : index)">
<el-form-item class="daoqitixingren" :prop="'xtyyUnit.' + index + '.lxdh'"
:rules="[
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: '请输入正确的手机号码',
trigger: 'blur'
}
]"
>
<el-input v-model="domain.lxdh" placeholder="请输入联系电话"></el-input>
</el-form-item>
</el-form-item>
</el-col>
</el-row>
@ -2777,7 +2791,7 @@
<script>
import pcas from "@/utils/pca-code.json"
import myUpload from "@/views/components/myUpload/index.vue";
import { assetUnitData, assetInfo } from "@/api/auditPagesApi/index";
import { assetUnitData, assetInfo, unitAllList } from "@/api/auditPagesApi/index";
export default {
name: "AssetsAuth",
dicts:[
@ -2959,7 +2973,14 @@ export default {
type: 3,
}
],
rules:{},
rules:{
xtmc: [
{ required: true, message: '请输入系统名称', trigger: 'blur' },
],
dwmc: [
{ required: true, message: '请输入单位名称', trigger: 'blur' },
],
},
disabled:false,
loading:false,
}
@ -3043,6 +3064,20 @@ export default {
}
})
},
//
querySearchAsync(queryString, cb){
let results = [];
unitAllList({nickName: queryString}).then(res => {
res.data.forEach(item => {
results.push({
value: item.nickName,
id: item.id,
})
})
})
cb(results);
},
//
changeRadio(id){
this.ruleForm.xjgywxt = {
remark: id,
@ -3163,37 +3198,41 @@ export default {
},
//
newAssets(){
this.ruleForm.xttz = this.xttz.join(',');
this.ruleForm.xtfhqkFcg = this.xtfhqkFcg.join(',');
this.ruleForm.xtfhqkFxl = this.xtfhqkFxl.join(',');
this.ruleForm.xtfhqkFzd = this.xtfhqkFzd.join(',');
this.ruleForm.xtfhqkFls = this.xtfhqkFls.join(',');
this.ruleForm.gylxxList = [...this.ruleForm.chepingUnit,...this.ruleForm.yjgysUnit,...this.ruleForm.jfywUnit,...this.ruleForm.xtsjUnit,...this.ruleForm.xtjsUnit,...this.ruleForm.xtyyUnit,...this.ruleForm.aqfwUnit]
this.ruleForm.jcwlList = [...this.fwqxx,...this.wlsb,...this.aqsb]
if(this.dlwz.length > 0) {
this.ruleForm.sheng = this.dlwz[0]
this.ruleForm.shi = this.dlwz[1]
this.ruleForm.qu = this.dlwz[2]
}
if(this.ruleForm.fwwz) {
this.ruleForm.fwwz = this.select + "-" + this.ruleForm.fwwz
}
this.loading = true;
if(this.$route.query.pageType == 'change') {
assetUnitData('put',this.ruleForm).then(res=>{
// console.log(res,"res");
this.loading = false;
this.$modal.msgSuccess("修改成功");
this.$router.go(-1);
})
} else {
assetUnitData('post',this.ruleForm).then(res=>{
// console.log(res,"res");
this.loading = false;
this.$modal.msgSuccess("新增成功");
this.$router.go(-1);
})
}
this.$refs['ruleForm'].validate((valid) => {
if(valid) {
this.ruleForm.xttz = this.xttz.join(',');
this.ruleForm.xtfhqkFcg = this.xtfhqkFcg.join(',');
this.ruleForm.xtfhqkFxl = this.xtfhqkFxl.join(',');
this.ruleForm.xtfhqkFzd = this.xtfhqkFzd.join(',');
this.ruleForm.xtfhqkFls = this.xtfhqkFls.join(',');
this.ruleForm.gylxxList = [...this.ruleForm.chepingUnit,...this.ruleForm.yjgysUnit,...this.ruleForm.jfywUnit,...this.ruleForm.xtsjUnit,...this.ruleForm.xtjsUnit,...this.ruleForm.xtyyUnit,...this.ruleForm.aqfwUnit]
this.ruleForm.jcwlList = [...this.fwqxx,...this.wlsb,...this.aqsb]
if(this.dlwz.length > 0) {
this.ruleForm.sheng = this.dlwz[0]
this.ruleForm.shi = this.dlwz[1]
this.ruleForm.qu = this.dlwz[2]
}
if(this.ruleForm.fwwz) {
this.ruleForm.fwwz = this.select + "-" + this.ruleForm.fwwz
}
this.loading = true;
if(this.$route.query.pageType == 'change') {
assetUnitData('put',this.ruleForm).then(res=>{
// console.log(res,"res");
this.loading = false;
this.$modal.msgSuccess("修改成功");
this.$router.go(-1);
})
} else {
assetUnitData('post',this.ruleForm).then(res=>{
// console.log(res,"res");
this.loading = false;
this.$modal.msgSuccess("新增成功");
this.$router.go(-1);
})
}
}
})
},
sendBack(){
this.$router.go(-1);

@ -9,7 +9,7 @@
<el-form v-loading="loading" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="170px" class="demo-ruleForm" label-position="right" :disabled="disabled">
<el-row>
<el-col :span="12">
<el-form-item label="新增单位名称" required>
<el-form-item label="新增单位名称" required prop="nickName">
<el-input v-model="ruleForm.nickName" placeholder="请输入单位名称"></el-input>
</el-form-item>
</el-col>
@ -142,7 +142,7 @@
<el-form-item label="单位负责人" required class="daoqitixingren">
<el-row>
<el-col :span="6">
<el-form-item prop="dwfzrxm">
<el-form-item>
<el-input v-model="ruleForm.dwfzrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
@ -173,7 +173,7 @@
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="dwfzrzwzc">
<el-form-item>
<el-input v-model="ruleForm.dwfzrzwzc" style="width: 100%;" placeholder="请输入职务职称"></el-input>
</el-form-item>
</el-col>
@ -186,7 +186,7 @@
<el-form-item label="分管负责人" class="daoqitixingren">
<el-row>
<el-col :span="6">
<el-form-item prop="fgfzrxm">
<el-form-item>
<el-input v-model="ruleForm.fgfzrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
@ -217,7 +217,7 @@
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="fgfzrzwzc">
<el-form-item>
<el-input v-model="ruleForm.fgfzrzwzc" style="width: 100%;" placeholder="请输入职务职称"></el-input>
</el-form-item>
</el-col>
@ -230,7 +230,7 @@
<el-form-item label="部门负责人" class="daoqitixingren">
<el-row>
<el-col :span="6">
<el-form-item prop="bmfzrxm">
<el-form-item>
<el-input v-model="ruleForm.bmfzrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
@ -261,7 +261,7 @@
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="bmfzrzwzc">
<el-form-item>
<el-input v-model="ruleForm.bmfzrzwzc" style="width: 100%;" placeholder="请输入职务职称"></el-input>
</el-form-item>
</el-col>
@ -274,7 +274,7 @@
<el-form-item label="第一联系人" class="daoqitixingren">
<el-row>
<el-col :span="6">
<el-form-item prop="dylxrxm">
<el-form-item>
<el-input v-model="ruleForm.dylxrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
@ -305,7 +305,7 @@
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="dylxrzwzc">
<el-form-item>
<el-input v-model="ruleForm.dylxrzwzc" style="width: 100%;" placeholder="请输入职务职称"></el-input>
</el-form-item>
</el-col>
@ -318,7 +318,7 @@
<el-form-item label="其他联系人" class="daoqitixingren" v-for="(domain, index) in ruleForm.otherConcat" :key="domain.key" :prop="'otherConcat.' + index + '.qtlxrlxfs'">
<el-row>
<el-col :span="6">
<el-form-item prop="name">
<el-form-item>
<el-input v-model="domain.qtlxrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
@ -349,7 +349,7 @@
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="zhiwu">
<el-form-item>
<el-input v-model="domain.qtlxrzwzc" style="width: 100%;" placeholder="请输入职务职称"></el-input>
</el-form-item>
</el-col>
@ -362,7 +362,7 @@
</el-row>
<el-row v-if="$route.query.pageType !== 'look'">
<el-col :span="24">
<el-form-item prop="btn">
<el-form-item>
<el-button @click="addForm('otherConcat')"></el-button>
</el-form-item>
</el-col>
@ -474,6 +474,7 @@
<script>
import pcas from "@/utils/pca-code.json"
import { lookUnit, postUnit } from "@/api/auditPagesApi/index";
import { MessageBox } from 'element-ui'
export default {
dicts:['zc_xtzyx', 'is_no', 'sshy', 'dwlx', 'dwjs', 'dwzsxz', 'dbxx_dbdj'],
data() {
@ -521,8 +522,12 @@ export default {
},
rules:{
userName: [
{ required: true, message: '请输入统一社会信用代码', trigger: 'blur' },
{ required: true, trigger: "blur" ,validator: validateTyshxydm},
]
],
nickName: [
{ required: true, message: '请输入单位名称', trigger: 'blur' },
],
},
disabled:false,
loading:false,
@ -592,33 +597,59 @@ export default {
}
},
newUnit(){
if(this.$route.query.pageType == 'look') {
this.$router.go(-1);
return;
}
if(this.ruleForm.ssqy?.length > 0) {
this.ruleForm.ssqyprovince = this.ruleForm.ssqy[0]
this.ruleForm.ssqycity = this.ruleForm.ssqy[1]
this.ruleForm.ssqycounty = this.ruleForm.ssqy[2]
}
this.loading = true;
if(this.$route.query.pageType == 'change') {
postUnit('put',this.ruleForm).then(res=>{
this.loading = false;
this.$modal.msgSuccess("修改成功");
this.$router.go(-1);
}).catch(err=>{
this.loading = false;
})
} else if(this.$route.query.pageType == 'add') {
postUnit('post',this.ruleForm).then(res=>{
this.loading = false;
this.$modal.msgSuccess("新增成功");
this.$router.go(-1);
}).catch(err=>{
this.loading = false;
})
}
this.$refs['ruleForm'].validate((valid) => {
if(valid) {
if(this.ruleForm.ssqy?.length > 0) {
this.ruleForm.ssqyprovince = this.ruleForm.ssqy[0]
this.ruleForm.ssqycity = this.ruleForm.ssqy[1]
this.ruleForm.ssqycounty = this.ruleForm.ssqy[2]
}
this.loading = true;
if(this.$route.query.pageType == 'change') {
postUnit('put',this.ruleForm).then(res=>{
this.loading = false;
this.$modal.msgSuccess("修改成功");
this.$router.go(-1);
}).catch(err=>{
this.loading = false;
})
} else if(this.$route.query.pageType == 'add') {
postUnit('post',this.ruleForm).then(res=>{
this.loading = false;
// this.$modal.msgSuccess("");
if(res.code == 200 && res.msg) {
let msg = res.msg
MessageBox.confirm(`${msg}`, '生成密码', {
confirmButtonText: '确定',
showClose:false,
type:"success ",
callback: action => {
if (window.clipboardData) {
window.clipboardData.setData('text', msg);
} else {
(function () {
document.oncopy = function (e) {
e.clipboardData.setData('text', msg);
e.preventDefault();
document.oncopy = null;
}
})(msg);
document.execCommand('Copy');
}
this.$message({
type: 'success',
message: `密码复制成功: ${ msg }`
});
this.$router.go(-1);
}
});
}
}).catch(err=>{
this.loading = false;
})
}
}
})
},
cancel(){
this.$router.go(-1);

Loading…
Cancel
Save