退料驳回,工地直转接口对接

This commit is contained in:
zhouzy062 2024-03-08 17:13:59 +08:00
parent f55234d3ad
commit 1f36650c1c
5 changed files with 365 additions and 351 deletions

View File

@ -0,0 +1,35 @@
import request from '@/utils/request'
// 记录列表
export function getWorkSiteList(query) {
return request({
url: '/material/workSite/list',
method: 'get',
params: query
})
}
// 工地直转-根据协议号获取设备
export function getUseringData(query) {
return request({
url: '/material/workSite/getUseringData',
method: 'get',
params: query
})
}

View File

@ -103,6 +103,15 @@ export function submitBackApplyApi(data) {
data: data
})
}
// 退料审核-驳回重新提交
export function submitRefuseBackApply(data) {
return request({
url: '/material/backApply/submitRefuseBackApply',
method: 'post',
data: data
})
}
// 退料申请-详情
export function materialReturnNoteByApply(query) {

View File

@ -1,54 +1,56 @@
<template>
<div class="app-container" id="constructionSite">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="关键字" prop="dictName">
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.dictName"
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单位名称" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入单位名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
<el-form-item label="单位名称" prop="unitId">
<el-select v-model="queryParams.unitId" placeholder="请选择单位名称" clearable>
<el-option
v-for="item in unitList"
:key="item.unitId" filterable
:label="item.unitName"
:value="item.unitId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="工程名称" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入工程名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
<el-form-item label="工程名称" prop="projectId">
<el-select v-model="queryParams.projectId" filterable placeholder="请选择工程名称" clearable>
<el-option
v-for="item in projectList"
:key="item.projectId"
:label="item.projectName"
:value="item.projectId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="联系人姓名" prop="dictName">
<el-form-item label="联系人姓名" prop="cName">
<el-input
v-model="queryParams.dictName"
v-model="queryParams.cName"
placeholder="请输入联系人姓名"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系人电话" prop="dictName">
<el-form-item label="联系人电话" prop="cPhone">
<el-input
v-model="queryParams.dictName"
v-model="queryParams.cPhone"
placeholder="请输入联系人电话"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="完成情况" prop="dictName">
<el-form-item label="完成情况" prop="status">
<el-input
v-model="queryParams.dictName"
v-model="queryParams.status"
placeholder="请选择完成情况"
clearable
style="width: 240px"
@ -70,7 +72,6 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['store:labelType:add']"
>直转申请</el-button>
</el-col>
<el-col :span="1.5">
@ -80,14 +81,13 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['store:labelType:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="dictId" />
<el-table-column label="转让方单位名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
@ -106,29 +106,23 @@
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['store:labelType:edit']"
>查看</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['store:labelType:edit']"
>审核</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['store:labelType:edit']"
>直转单</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['store:labelType:remove']"
>删除</el-button>
</template>
</el-table-column>
@ -144,125 +138,118 @@
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form :model="dialogParams" ref="dialogForm" size="small" :inline="true" label-width="100px">
<el-row>
<el-form-item label="退料单位" prop="dictName">
<el-form-item label="退料单位" prop="backUnitId">
<el-select v-model="dialogParams.backUnitId" filterable clearable @change="GetProData" style="width: 240px" placeholder="请选择">
<el-option
v-for="item in backUnitList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="退料工程" prop="backProId">
<el-select v-model="dialogParams.backProId" filterable clearable @change="GetUnitData" style="width: 240px" placeholder="请选择">
<el-option
v-for="item in backProjectList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="退料协议编号" prop="backAgreementCode">
<el-input
v-model="queryParams.dictName"
v-model="dialogParams.backAgreementCode"
placeholder="请输入退料协议编号"
clearable disabled
style="width: 240px"
/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="退料人" prop="backUserName">
<el-input
v-model="dialogParams.backUserName"
placeholder="请输入退料人"
clearable
style="width: 240px"
/>
</el-form-item>
<el-form-item label="退料人电话" prop="backPhone">
<el-input
v-model="dialogParams.backPhone"
placeholder="请输入退料人电话"
clearable
style="width: 240px"
/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="领料单位" prop="leaseUnitId">
<el-input
v-model="dialogParams.dictName"
placeholder="请输入借出方单位"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="退料工程" prop="dictName">
<el-form-item label="领料工程" prop="leaseProId">
<el-input
v-model="queryParams.dictName"
v-model="dialogParams.dictName"
placeholder="请输入借入方单位"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="退料协议编号" prop="dictName">
<el-form-item label="领料协议编号" prop="leaseAgreementId">
<el-input
v-model="queryParams.dictName"
v-model="dialogParams.dictName"
placeholder="请输入领料协议编号"
clearable disabled
style="width: 240px"
/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="领料人" prop="leaseUserName">
<el-input
v-model="dialogParams.leaseUserName"
placeholder="请输入领料人"
clearable
style="width: 240px"
/>
</el-form-item>
<el-form-item label="领料人电话" prop="leasePhone">
<el-input
v-model="dialogParams.leasePhone"
placeholder="请输入领料人电话"
clearable
style="width: 240px"
/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="dialogParams.keyWord"
placeholder="请输入关键字"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="退料人" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入借出方单位"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="退料人电话" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入借入方单位"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="领料单位" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入借出方单位"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="领料工程" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入借入方单位"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="领料协议编号" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入关键字"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="领料人" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入借出方单位"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="领料人电话" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入借入方单位"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="关键字" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入借出方单位"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetDialogQuery">重置</el-button>
</el-form-item>
</el-row>
</el-form>
<el-table v-loading="loading" :data="typeList" height="350px" @selection-change="handleSelectionChange">
<el-table v-loading="dialogLoading" :data="deviceList" height="350px" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="dictId" />
<el-table-column label="机具名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
@ -280,15 +267,6 @@
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="submitForm">保存</el-button>
<el-button @click="cancel"> </el-button>
@ -302,7 +280,8 @@
</template>
<script>
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { getUnitList, getProjectList, getProData, getUnitData, getAgreementInfoById,} from "@/api/claimAndRefund/receive";
import { getWorkSiteList,getUseringData} from "@/api/claimAndRefund/constructionSite";
export default {
name: "ConstructionSite",
@ -310,7 +289,7 @@ export default {
data() {
return {
//
loading: true,
loading: false,
//
ids: [],
//
@ -319,24 +298,31 @@ export default {
multiple: true,
//
showSearch: true,
//
unitList: [],
//
projectList: [],
//
total: 0,
//
typeList: [],
//
title: "",
//
open: false,
//
dateRange: [],
//
tableList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined
},
//
title: "",
//
open: false,
dialogLoading: false,
dialogParams:{},
deviceList: [],//table
backUnitList: [],//退
backProjectList: [],//退
//
form: {},
//
@ -351,14 +337,30 @@ export default {
};
},
created() {
this.getList();
this.getUnitList();
this.getProjectList();
// this.getList();
this.GetUnitData()
this.GetProData()
},
methods: {
/** 查询字典类型列表 */
// ,getUnitList, getProjectList
getUnitList(){
getUnitList().then(response => {
this.unitList = response.data;
})
},
getProjectList(){
getProjectList().then(response => {
this.projectList = response.data;
})
},
/** 查询列表 */
getList() {
this.loading = true;
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.typeList = response.rows;
getWorkSiteList(this.queryParams).then(response => {
this.tableList = response.rows;
this.total = response.total;
this.loading = false;
}
@ -372,11 +374,11 @@ export default {
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: "0",
remark: undefined
// dictId: undefined,
// dictName: undefined,
// dictType: undefined,
// status: "0",
// remark: undefined
};
this.resetForm("form");
},
@ -387,15 +389,73 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
async GetUnitData(){
const params = {
id:this.dialogParams.backProId
}
const res = await getUnitData(params)
this.backUnitList = res.data
this.GetAgreementInfoById()
},
//
async GetProData(){
const params = {
id:this.dialogParams.backUnitId
}
const res = await getProData(params)
this.backProjectList = res.data
this.GetAgreementInfoById()
},
// id
async GetAgreementInfoById(){
if(this.dialogParams.backUnitId && this.dialogParams.backProId){
const params = {
unitId: this.dialogParams.backUnitId,
projectId: this.dialogParams.backProId
}
const res = await getAgreementInfoById(params)
if( !(res.data && res.data.agreementId) ){
this.$message.error('当前单位和工程未上传');
this.dialogParams.backUnitId = null
this.dialogParams.backProId = null
this.GetUnitData()
this.GetProData()
}else{
this.dialogParams.backAgreementId = res.data.agreementId;
this.dialogParams.backAgreementCode = res.data.agreementCode;
this.getDialogList()
}
}
},
/** 查询列表 */
getDialogList() {
this.dialogLoading = true;
let param = {
agreementId:this.dialogParams.backAgreementId
}
getUseringData(param).then(response => {
this.deviceList = response.rows;
this.dialogLoading = false;
}
);
},
resetDialogQuery() {
this.resetForm("dialogForm");
this.getDialogList();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.resetForm("dialogForm");
this.open = true;
this.title = "计划借调";
this.title = "工地直转";
},
//
handleSelectionChange(selection) {
@ -405,43 +465,31 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const dictId = row.dictId || this.ids
getType(dictId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改";
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addType(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
// addType(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除该数据项?').then(function() {
return delType(dictIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
// const dictIds = row.dictId || this.ids;
// this.$modal.confirm('').then(function() {
// return delType(dictIds);
// }).then(() => {
// this.getList();
// this.$modal.msgSuccess("");
// }).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
@ -449,13 +497,7 @@ export default {
...this.queryParams
}, `type_${new Date().getTime()}.xlsx`)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess("刷新成功");
this.$store.dispatch('dict/cleanDict');
});
}
}
};
</script>

View File

@ -1,5 +1,5 @@
<template>
<div class="app-container" id="returnApplyAdd">
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
@ -236,7 +236,7 @@ import {
getUseTypeTreee
} from '@/api/claimAndRefund/receive'
import { ApiSubmitBackApply } from "@/api/claimAndRefund/return"
import { submitBackApplyApi,materialReturnNoteByApply } from "@/api/claimAndRefund/return.js"
import { submitBackApplyApi,materialReturnNoteByApply,submitRefuseBackApply } from "@/api/claimAndRefund/return.js"
import { mapState } from 'vuex'
import {
getInfo, h
@ -333,9 +333,6 @@ export default {
leaseApplyDetails: []
},
leaseApplyDetails: [],
//退
leaseApplyDetailsItem: {
createBy: null,
@ -410,6 +407,7 @@ export default {
companyId: '',
createBy: '',
isEdit:'true',
rowId:''
};
},
created() {
@ -420,6 +418,7 @@ export default {
// console.log('this.$route.query.isEdit', this.$route.query.isEdit)
this.isEdit = this.$route.query.isEdit;
if (this.$route.query.Id) {
this.rowId = this.$route.query.Id
this.GetViewByApply(this.$route.query.Id)
}
getInfo().then(res => {
@ -490,16 +489,17 @@ export default {
const res = await materialReturnNoteByApply({ id:Id })
const data = res.data[0]
// console.log(data)
// this.queryParams.taskId = data.taskId
this.queryParams.unitId = data.unitId
this.queryParams.proId = Number(data.proId)
this.$set(this.queryParams,'phone',data.phone)
this.queryParams.backPerson = data.backPerson
this.queryParams.backTime = data.backTime
this.queryParams.agreementCode = data.agreementCode
this.queryParams.agreementId = data.agreementId
this.queryParams.remark = data.remark
this.leaseApplyDetails = res.data
this.GetDeviceTypeTreeFn(data.agreementId)
},
//
@ -639,6 +639,16 @@ export default {
this.$message.error('请添加数据');
return
}
// const isRemark = this.queryParams.leaseApplyDetails.some(
// (item) => item.remark == '' || item.remark == undefined
// );
const isNum = this.queryParams.leaseApplyDetails.some(
(item) => item.num == '' || item.num == undefined
);
if (isNum) {
this.$message.error('退料数量不能为空!');
return;
}
this.queryParams.createBy = this.user.name
this.queryParams.companyId = this.companyId
this.queryParams.backApplyInfo = {
@ -648,6 +658,23 @@ export default {
backTime: this.queryParams.backTime,
companyId: this.companyId,
}
if(this.rowId!=''){
let params = {
companyId: this.companyId,
createBy: this.createBy,
id:this.rowId,
agreementId: this.queryParams.agreementId,
backApplyInfo: this.queryParams.backApplyInfo,
backApplyDetails: this.queryParams.leaseApplyDetails,
}
const res = await submitRefuseBackApply(params)
if (res.code == 200) {
this.$message({ type: 'success', message: '申请成功'})
setTimeout(() => {
this.$tab.closeOpenPage({ path: "/claimAndRefund/return/returnApply"});
}, 1000)
}
}else{
let params = {
companyId: this.companyId,
createBy: this.createBy,
@ -655,31 +682,16 @@ export default {
backApplyInfo: this.queryParams.backApplyInfo,
backApplyDetails: this.queryParams.leaseApplyDetails,
}
const isRemark = this.queryParams.leaseApplyDetails.some(
(item) => item.remark == '' || item.remark == undefined
);
const isNum = this.queryParams.leaseApplyDetails.some(
(item) => item.num == '' || item.num == undefined
);
// if (isRemark) {
// this.$message.error('');
// return;
// }
if (isNum) {
this.$message.error('退料数量不能为空!');
return;
}
const res = await submitBackApplyApi(params)
if (res.code == 200) {
this.$message({
type: 'success',
message: '申请成功'
})
this.$message({ type: 'success', message: '申请成功'})
setTimeout(() => {
this.$tab.closeOpenPage({ path: "/claimAndRefund/return/returnApply"});
}, 1000)
}
}
}
})

View File

@ -59,17 +59,6 @@
>新增
</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['system:user:import']"
>导入
</el-button>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="warning"
@ -173,7 +162,7 @@
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="所属上级分类" prop="parentId">
<el-form-item label="所属上级" prop="parentId">
<treeselect v-model="form.parentId" :options="treeOptions" :show-count="true" placeholder="请选择所属上级分类"/>
</el-form-item>
</el-col>
@ -310,40 +299,6 @@
</div>
</el-dialog>
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport"/>
是否更新已经存在的用户数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
@click="importTemplate">下载模板
</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" height="650px" :src="dialogImageUrl" alt="">
</el-dialog>
@ -351,7 +306,7 @@
<!-- 配置弹窗 -->
<el-dialog :title="title" :visible.sync="configOpen" width="650px" append-to-body>
<el-form ref="cform" :model="cform" :rules="crules" label-width="100px">
<el-form ref="cform" :model="cform" :rules="crules" label-width="110px">
<el-row>
<el-col :span="24">
<el-form-item label="调整前价格">
@ -361,17 +316,17 @@
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="调整后价格">
<el-form-item label="调整后价格" prop="leasePrice">
<el-input-number v-model="cform.leasePrice" style="width: 100%;" controls-position="right" :min="0"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="开始使用日期">
<el-form-item label="开始使用日期" prop="effTime">
<el-date-picker
v-model="cform.effTime"
style="width: 240px"
style="width: 100%"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="开始使用日期"
@ -469,21 +424,7 @@ export default {
children: "children",
label: "label"
},
//
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: {Authorization: "Bearer " + getToken()},
//
url: process.env.VUE_APP_BASE_API + "/system/user/importData"
},
//
queryParams: {
// pageNum: 1,
@ -496,31 +437,31 @@ export default {
//
rules: {
// typeName: [
// {required: true, message: "", trigger: "blur"},
// {min: 2, max: 20, message: ' 2 20 ', trigger: 'blur'}
typeName: [
{required: true, message: "设备名称不能为空", trigger: "blur"},
{min: 2, max: 20, message: '设备名称长度必须介于 2 和 20 之间', trigger: 'blur'}
],
parentId: [
{required: true, message: "所属上级不能为空", trigger: "blur"}
],
// password: [
// {required: true, message: "", trigger: "blur"},
// {min: 5, max: 20, message: ' 5 20 ', trigger: 'blur'}
// ],
nickName: [
{required: true, message: "用户昵称不能为空", trigger: "blur"}
],
password: [
{required: true, message: "用户密码不能为空", trigger: "blur"},
{min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur'}
],
email: [
{
type: "email",
message: "请输入正确的邮箱地址",
trigger: ["blur", "change"]
}
],
phonenumber: [
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur"
}
]
// email: [
// {
// type: "email",
// message: "",
// trigger: ["blur", "change"]
// }
// ],
// phonenumber: [
// {
// pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
// message: "",
// trigger: "blur"
// }
// ]
},
dialogImageUrl: '',
dialogVisible: false,
@ -535,9 +476,9 @@ export default {
{required: true, message: "调整后价格不能为空", trigger: "blur"},
// { min: 2, max: 20, message: ' 2 20 ', trigger: 'blur' }
],
effTime: [
{required: true, message: "开始日期不能为空", trigger: "blur"}
],
// effTime: [
// {required: true, message: "", trigger: "blur"}
// ],
}
};
},
@ -791,35 +732,10 @@ export default {
/** 导出按钮操作 */
handleExport() {
this.download('system/user/export', {
...this.queryParams
}, `user_${new Date().getTime()}.xlsx`)
// this.download('system/user/export', {
// ...this.queryParams
// }, `user_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "用户导入";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download('system/user/importTemplate', {}, `user_template_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}
}
};
</script>